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