@Override public void eventDataChanged(GOEvent event) { Action action = getActionForDraw((GODrawEvent) event); if (action != null && action.getActionType() == EActionType.PAN_TO) { minimap.getContext().scrollTo( ((PointAction) action).getPosition()); } }
@Override public Action getActionFor(UIPoint position, boolean selecting) { float relativex = (float) position.getX() / this.uiBase.getPosition().getWidth(); float relativey = (float) position.getY() / this.uiBase.getPosition().getHeight(); Action action; if (minimap != null && relativey > layoutProperties.MAIN_PANEL_TOP && getMinimapOffset(position.getY()) < position.getX()) { action = getForMinimap(relativex, relativey, selecting); startMapPosition = null; // to prevent it from jumping back. } else { action = uiBase.getAction(relativex, relativey); } if (action != null && action.getActionType() == EActionType.CHANGE_PANEL) { mainPanel.setContent(((ChangePanelAction) action).getContent()); return null; } else { return action; } }