Minimale Anpassung an Actionlistener fuer MainMenu zu LocalGame

This commit is contained in:
Kaver 2024-11-19 13:39:43 +01:00
parent 5bedfddc60
commit d95df0cf5f
3 changed files with 13 additions and 4 deletions

View File

@ -2,9 +2,10 @@ public class HalloSchiffeVersenken {
public static void main(String[] args) throws InterruptedException { public static void main(String[] args) throws InterruptedException {
//LUCAS CODE //LUCAS CODE
MainMenuModel model = new MainMenuModel(); coinToss ct = new coinToss();
MainMenuView view = new MainMenuView(); //MainMenuModel model = new MainMenuModel();
MainMenuController controller = new MainMenuController(model, view); //MainMenuView view = new MainMenuView();
//MainMenuController controller = new MainMenuController(model, view);
//System.out.println("HelloSchiffeVersenekn"); //System.out.println("HelloSchiffeVersenekn");
@ -21,7 +22,7 @@ public class HalloSchiffeVersenken {
*/ */
//JOSHUA CODE //JOSHUA CODE
startLocalGame localTest = new startLocalGame(); //startLocalGame localTest = new startLocalGame();
//startMultiplayerGame multiplayerTest = new startMultiplayerGame(); //startMultiplayerGame multiplayerTest = new startMultiplayerGame();
} }
} }

View File

@ -25,6 +25,11 @@ public class MainMenuController implements ActionListener {
view.showPanel("MultiMenu"); view.showPanel("MultiMenu");
}else if (e.getSource() == view.getSoundButton()) { }else if (e.getSource() == view.getSoundButton()) {
view.toggleMute(); view.toggleMute();
}else if(e.getSource() == view.getLocalButton()) {
model.setGameMode("LocalGame");
startLocalGame localGame = new startLocalGame();
view.addPanel(localGame.getLocalPanel(), "LocalMenu");
view.showPanel("LocalMenu");
} }
} }
} }

View File

@ -224,4 +224,7 @@ public class startLocalGame {
rightPlayerTextField.setText("Leicht"); rightPlayerTextField.setText("Leicht");
} }
} }
public JPanel getLocalPanel() {
return localGamePanel;
}
} }