NavigationBetweenViewController: rm setMenuView
This commit is contained in:
parent
99db8d4956
commit
aa32caaf42
@ -9,13 +9,12 @@ import fr.enssat.BoulderDash.helpers.LevelSaveHelper;
|
||||
import fr.enssat.BoulderDash.models.LevelModel;
|
||||
import fr.enssat.BoulderDash.views.HelpView;
|
||||
import fr.enssat.BoulderDash.views.LevelEditorView;
|
||||
import fr.enssat.BoulderDash.controllers.NavigationBetweenViewController;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
/**
|
||||
* LevelEditorController
|
||||
*
|
||||
* <p>
|
||||
* Manages the level editor controller.
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
@ -53,7 +52,7 @@ public class LevelEditorController implements ActionListener {
|
||||
switch (event.getActionCommand()) {
|
||||
case "menu":
|
||||
this.levelEditorView.setVisible(false);
|
||||
this.nav.setMenuView();
|
||||
this.nav.getMenuView().setVisible(true);
|
||||
this.nav.getAudioLoadHelper().startMusic("game");
|
||||
|
||||
break;
|
||||
|
@ -6,14 +6,11 @@ import java.awt.event.ActionListener;
|
||||
import fr.enssat.BoulderDash.helpers.AudioLoadHelper;
|
||||
import fr.enssat.BoulderDash.models.LevelModel;
|
||||
import fr.enssat.BoulderDash.views.MenuView;
|
||||
import fr.enssat.BoulderDash.controllers.LevelEditorController;
|
||||
import fr.enssat.BoulderDash.controllers.GameController;
|
||||
|
||||
/**
|
||||
* Controller to navigate between the different views
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
*
|
||||
*/
|
||||
public class NavigationBetweenViewController implements ActionListener {
|
||||
private LevelEditorController levelEditorController;
|
||||
@ -100,15 +97,12 @@ public class NavigationBetweenViewController implements ActionListener {
|
||||
return this.menuView;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the first view
|
||||
*
|
||||
* @param menuView
|
||||
*/
|
||||
public MenuView setMenuView() {
|
||||
this.menuView = new MenuView(this);
|
||||
return menuView;
|
||||
}
|
||||
// menuView has already been created in the constructor! No need to recreate it.
|
||||
//
|
||||
//public MenuView setMenuView() {
|
||||
// this.menuView = new MenuView(this);
|
||||
// return menuView;
|
||||
//}
|
||||
|
||||
/**
|
||||
* Get the pickedLevel
|
||||
|
Loading…
x
Reference in New Issue
Block a user