/** * Returns true if a dialog is visible on top of the <code>ClientGUI</code>. * For example, the <code>MegaMekController</code> should ignore hotkeys * if there is a dialog, like the <code>CommonSettingsDialog</code>, open. * @return */ public boolean shouldIgnoreHotKeys(){ return ignoreHotKeys || (gameOptionsDialog != null && gameOptionsDialog.isVisible()) || (about != null && about.isVisible()) || (help != null && help.isVisible()) || (setdlg != null && setdlg.isVisible()); }
private int chooseMineToLay() { MineLayingDialog mld = new MineLayingDialog(clientgui.frame, ce()); mld.setVisible(true); if (mld.getAnswer()) { return mld.getMine(); } return -1; }
public void customizePlayer() { Client c = getPlayerSelected(); if (null != c) { PlayerSettingsDialog psd = new PlayerSettingsDialog(clientgui, c); psd.setVisible(true); } }
/** * Shows a dialog where the player can select the entity types * used in the LOS tool. */ private void showLOSSettingDialog() { GUIPreferences gp = GUIPreferences.getInstance(); LOSDialog ld = new LOSDialog(frame, gp.getMechInFirst(), gp.getMechInSecond()); ld.setVisible(true); gp.setMechInFirst(ld.getMechInFirst()); gp.setMechInSecond(ld.getMechInSecond()); }
@Override public Integer getIntegerVal(String key) { switch(key) { case "numOtherUnits": return currentCard().numOtherUnits(); case "otherUnitType": return currentCard().getOtherUnitType(); case "network": return currentCard().getNetwork(); } return null; }
/** * Display the board editor. */ void showEditor() { BoardEditor editor = new BoardEditor(controller); controller.boardEditor = editor; launch(editor.getFrame()); editor.boardNew(); }
/** * Display the board editor and open an "open" dialog. */ void showEditorOpen() { BoardEditor editor = new BoardEditor(controller); controller.boardEditor = editor; launch(editor.getFrame()); editor.boardLoad(); }
private void setDockEnabled(boolean enabled) { getBtn(MoveCommand.MOVE_DOCK).setEnabled(enabled); clientgui.getMenuBar().setMoveLaunchEnabled(enabled); }
public void actionPerformed(ActionEvent e) { myTarget = decodeTargetInfo(e.getActionCommand()); if (currentPanel instanceof FiringDisplay) { ((FiringDisplay) currentPanel).target(myTarget); } else if (currentPanel instanceof PhysicalDisplay) { ((PhysicalDisplay) currentPanel).target(myTarget); } else if (currentPanel instanceof TargetingPhaseDisplay) { ((TargetingPhaseDisplay) currentPanel).target(myTarget); } } });
public void optionsChanged() { if (getUnitType() != null) { ((CardLayout)getLayout()).show(this, getUnitType() < UnitType.CONV_FIGHTER? "Ground" : "Air"); } currentCard().updateUnitType(getUnitType()); }
@Override public Integer getIntegerVal(String key) { switch (key) { case "networkMask": return currentCard().getNetworkMask(); case "roleStrictness": return currentCard().getRoleStrictness(); } return null; }
@Override public Boolean getBooleanVal(String key) { switch(key) { case "mechBA": return currentCard().mechBA(); case "airLance": return currentCard().airLance(); } return null; }
@Override public String getStringVal(String key) { switch(key) { case "formationType": return currentCard().getFormation(); } return null; }
@Override public void updateGeneratedUnits(List<MechSummary> list) { currentCard().setGeneratedUnits(list); } }
/** * Display a system message in the chat box. * * @param message the <code>String</code> message to be shown. */ public void systemMessage(String message) { cb.systemMessage(message); cb2.addChatMessage("Megamek: " + message); }
public void closeDialog() { if (asd != null) { aimingAt = Entity.LOC_NONE; aimingMode = IAimingModes.AIM_MODE_NONE; asd.dispose(); asd = null; this.firingDisplay.updateTarget(); } }
/** * Targets something */ void target(Targetable t) { target = t; updateTarget(); ash.showDialog(); }
public void closeDialog() { if (asd != null) { aimingAt = Entity.LOC_NONE; aimingMode = IAimingModes.AIM_MODE_NONE; asd.dispose(); asd = null; updateTarget(); } }
/** * Pop up the dialog to load a mech */ private void loadMech() { clientgui.getMechSelectorDialog().setVisible(true); }
private void loadArmy() { clientgui.getRandomArmyDialog().setVisible(true); }