@Override public IAction catchAction(IAction action) { if ((action.getActionType() == EActionType.MOVE_TO || action.getActionType() == EActionType.ABORT) && activeBuilding != null) { action = new ShowConstructionMarksAction(null); } if (action.getActionType() == EActionType.SHOW_CONSTRUCTION_MARK) { setActiveBuilding(((ShowConstructionMarksAction) action).getBuildingType()); } return super.catchAction(action); }
@Override public IAction catchAction(IAction action) { if (action.getActionType() == EActionType.ABORT) { return new Action(EActionType.DESELECT); } return super.catchAction(action); } }
/** * This allows the current panel to catch actions that are executed. * * @param action * The action to catch. * @return The action to override with. May be <code>null</code> to cancel. */ public IAction catchAction(IAction action) { PointAction overrideAction; if (action.getActionType() == EActionType.SELECT_POINT && (overrideAction = getSelectAction(((PointAction) action).getPosition())) != null) { return overrideAction; } else { return action; } }
System.out.println("Got action: " + action.getActionType()); if (action.getActionType() == EActionType.SELECT_AREA) { validator.reValidate(); }); } else if (action.getActionType() == EActionType.SELECT_POINT) { if (tool != null) { SwingUtilities.invokeLater(() -> {
@Override public void action(IAction action) { controls.action(action); switch (action.getActionType()) { case TOGGLE_DEBUG: debugColorMode = EDebugColorModes.getNextMode(debugColorMode);
public synchronized IAction catchAction(IAction action) { action = activeContent.catchAction(action); EActionType type = action.getActionType(); switch (type) { case MOVE_TO:
@Override public void action(IAction action) { if (action.getActionType() != EActionType.SCREEN_CHANGE) { System.out.println("action(Action): " + action.getActionType() + " at game time: " + MatchConstants.clock().getTime()); switch (action.getActionType()) { case BUILD: handleBuildAction((BuildAction) action); System.out.println("WARNING: GuiInterface.action() called, but event can't be handled... (" + action.getActionType() + ")");