/** * Gets the name of a {@link ESoldierType}. * * @param type * The soldier type * @return The localized name. */ public static String getName(ESoldierType type) { return getString("soldier_" + type); }
/** * Gets the name of a movable. * * @param type * The movable type * @return The name. */ public static String getName(EMovableType type) { return getString("movable_" + type); }
/** * Gets a String for a progress constant. * * @param progress * The progress constant. * @return The localized name, */ public static String getProgress(EProgressState progress) { return getString("progress_" + progress); } }
/** * Gets the name of a resource. * * @param type * The resource type * @return The name. */ public static String getName(EResourceType type) { return getString("resource_" + type); }
@Override public void startFailed(EGameError errorType, Exception exception) { String errorMessage; if (errorType == EGameError.MAPLOADING_ERROR) { errorMessage = Labels.getString("errordlg-map-loading-failed"); } else { errorMessage = Labels.getString("errordlg-start-failed") + " " + exception.getMessage(); } JOptionPane.showMessageDialog(settlersFrame, errorMessage, Labels.getString("errordlg-header"), JOptionPane.ERROR_MESSAGE); settlersFrame.showMainMenu(); }
@Override public String toString() { return Labels.getString("player-type-" + playerType.name()); } }
/** * Constructor */ EMapFilter() { this.name = Labels.getString("mapfilter." + name()); }
@Override public void systemMessageReceived(IMultiplayerPlayer author, ENetworkMessage message) { chatArea.append(Labels.getString("network-message-" + message.name()) + "\n"); } });
@Override public String toString() { return Labels.getString("peace-time-" + name()); } }
@Override public String toString() { return Labels.getString("map-start-resources-" + startResources.name()); } }
/** * Creates a new {@link MinimapOccupiedButton}. * * @param minimapSettings * The settings to influence. */ public MinimapOccupiedButton(final MinimapMode minimapSettings) { super(new NextDisplayMode(minimapSettings), null, null, Labels.getString("minimap-occupied")); this.minimapSettings = minimapSettings; }
/** * Creates a new {@link MinimapBuildingButton}. * * @param minimapSettings * The settings to influence. */ public MinimapBuildingButton(final MinimapMode minimapSettings) { super(new NextDisplayMode(minimapSettings), null, null, Labels.getString("minimap-buildings")); this.minimapSettings = minimapSettings; }
private void initButtonPanel() { buttonPanel.setLayout(new GridLayout(0, 1, 20, 20)); mainButtonPanel.setLayout(new BorderLayout()); mainButtonPanel.add(buttonPanel, BorderLayout.NORTH); JButton btExit = new JButton(Labels.getString("main-panel-exit-button")); btExit.addActionListener(e -> settlersFrame.exit()); btExit.putClientProperty(ELFStyle.KEY, ELFStyle.BUTTON_MENU); mainButtonPanel.add(btExit, BorderLayout.SOUTH); add(mainButtonPanel); add(emptyPanel); getTitleLabel().setVisible(false); }
@Override public void update(IMannaInformation mannaInformation) { setText(Labels.getString("upgrade_warriors_progress", mannaInformation.getNextUpdateProgressPercent())); } }
private void drawActionThreadSlow(GLDrawContext gl) { TextDrawer drawer = textDrawer.getTextDrawer(gl, EFontSize.NORMAL); String string = Labels.getString("action_firerer_slow"); float x = windowWidth - drawer.getWidth(string) - 5; float y = windowHeight - 3 * drawer.getHeight(string); drawer.drawString(x, y, string); }
private UIPanel buildPanel() { List<MaterialDistributionTab> materialDistributionTabs = createTabs(uiContentUpdater::getPosition); UIPanel panel = new UIPanel(); panel.addChild(new Label(Labels.getString("controlpanel_distribution_title"), EFontSize.NORMAL), 0f, titleTop - titleTextHeight, 1f, titleTop); float top = marginTop; for (MaterialDistributionTab materialDistributionTab : materialDistributionTabs) { MaterialButton materialButton = materialDistributionTab.materialButton; panel.addChild(materialButton, marginH, top - rowHeight, marginH + tileWidth, top); top -= (rowHeight + marginV); } return panel; }
public ShipSelectionContent(ISelectionSet selection) { panel = new UIPanel(); addRowsToPanel(panel, selection, shiptypes); UIPanel kill = new LabeledButton(Labels.getString("kill"), new Action(EActionType.DESTROY)); UIPanel unload = new LabeledButton(Labels.getString("unload"), new Action(EActionType.UNLOAD_FERRIES)); panel.addChild(kill, .1f, .3f, .9f, .4f); panel.addChild(unload, .1f, .1f, .9f, .2f); }
public SoilderSelectionContent(ISelectionSet selection) { panel = new UIPanel(); addRowsToPanel(panel, selection, soildertypes); UIPanel kill = new LabeledButton(Labels.getString("kill"), new Action(EActionType.DESTROY)); UIPanel stop = new LabeledButton(Labels.getString("stop"), new Action(EActionType.STOP_WORKING)); panel.addChild(kill, .1f, .1f, .5f, .2f); panel.addChild(stop, .5f, .1f, .9f, .2f); }
private BuildingBackgroundPanel createDockyardBuildingContent(BuildingState state) { DockyardSelectionLayout layout = new DockyardSelectionLayout(); loadPriorityButton(layout.background, layout.priority, state); layout.nameText.setType(building.getBuildingType(), state.isConstruction()); if (state.isWorkingDockyard()) { layout.materialText.setText(Labels.getString("materials_required")); addRequestAndOfferStacks(layout.materialArea, state); } return layout._root; }