public GameMenu(final TripleAMenuBar menuBar, final TripleAFrame frame) { this.frame = frame; game = frame.getGame(); gameData = frame.getGame().getData(); iuiContext = frame.getUIContext(); menuBar.add(createGameMenu()); }
private void addShowVerifiedDice(final JMenu parentMenu) { final Action showVerifiedDice = SwingAction.of( "Show Verified Dice", e -> new VerifiedRandomNumbersDialog(frame.getRootPane()).setVisible(true)); if (game instanceof ClientGame) { parentMenu.add(showVerifiedDice).setMnemonic(KeyEvent.VK_V); } }
private JMenu createGameMenu() { final JMenu menuGame = SwingComponents.newJMenu("Game", SwingComponents.KeyboardCode.G); addEditMode(menuGame); menuGame.addSeparator(); menuGame.add(SwingAction.of("Engine Settings", e -> SettingsWindow.showWindow())); SoundOptions.addGlobalSoundSwitchMenu(menuGame); SoundOptions.addToMenu(menuGame); menuGame.addSeparator(); menuGame.add(frame.getShowGameAction()).setMnemonic(KeyEvent.VK_G); menuGame.add(frame.getShowHistoryAction()).setMnemonic(KeyEvent.VK_H); menuGame.add(frame.getShowMapOnlyAction()).setMnemonic(KeyEvent.VK_M); menuGame.addSeparator(); addGameOptionsMenu(menuGame); addShowVerifiedDice(menuGame); addPoliticsMenu(menuGame); addNotificationSettings(menuGame); addShowDiceStats(menuGame); addRollDice(menuGame); addBattleCalculatorMenu(menuGame); return menuGame; }
private void addEditMode(final JMenu parentMenu) { final JCheckBoxMenuItem editMode = new JCheckBoxMenuItem("Enable Edit Mode"); editMode.setModel(frame.getEditModeButtonModel()); parentMenu.add(editMode).setMnemonic(KeyEvent.VK_E); }