From 6a46b2e9b1f2ca307b8ddf7fa3dc5c6be974c3f6 Mon Sep 17 00:00:00 2001 From: IllianiCBT Date: Wed, 30 Oct 2024 15:18:24 -0500 Subject: [PATCH] Renamed Tracks and AtB Campaign State in StratCon Updated terminology in various GUI and code components from "Track" to "Sector" to improve flavor. Additionally, renamed the 'AtB Campaign State' labels to 'Area of Operations'. --- .../mekhq/resources/CampaignGUI.properties | 2 +- .../resources/mekhq/resources/GUI.properties | 2 +- .../stratcon/StratconContractInitializer.java | 6 +- MekHQ/src/mekhq/gui/StratconPanel.java | 62 +++++++------------ MekHQ/src/mekhq/gui/StratconTab.java | 6 +- 5 files changed, 32 insertions(+), 46 deletions(-) diff --git a/MekHQ/resources/mekhq/resources/CampaignGUI.properties b/MekHQ/resources/mekhq/resources/CampaignGUI.properties index 7264303d81..fe6f428723 100644 --- a/MekHQ/resources/mekhq/resources/CampaignGUI.properties +++ b/MekHQ/resources/mekhq/resources/CampaignGUI.properties @@ -119,7 +119,7 @@ panOrganization.TabConstraints.tabTitle=TO&E panMap.TabConstraints.tabTitle=Interstellar Map panBriefing.TabConstraints.tabTitle=Briefing Room panMekLab.TabConstraints.tabTitle=Mek Lab -panStratcon.TabConstraints.tabTitle=AtB Campaign State +panStratcon.TabConstraints.tabTitle=Area of Operations panCustom.TabConstraints.tabTitle=Custom btnAssignDoc.text=Assign btnUnassignDoc.text=Unassign diff --git a/MekHQ/resources/mekhq/resources/GUI.properties b/MekHQ/resources/mekhq/resources/GUI.properties index 42f9f15646..8242f7e24a 100644 --- a/MekHQ/resources/mekhq/resources/GUI.properties +++ b/MekHQ/resources/mekhq/resources/GUI.properties @@ -824,7 +824,7 @@ MHQTabType.REPAIR_BAY.text=Repair Bay MHQTabType.INFIRMARY.text=Infirmary MHQTabType.FINANCES.text=Finances MHQTabType.MEK_LAB.text=Mek Lab -MHQTabType.STRAT_CON.text=AtB Campaign State +MHQTabType.STRAT_CON.text=Area of Operations #### PersonnelFilter Enum PersonnelFilter.ALL.text=All Personnel diff --git a/MekHQ/src/mekhq/campaign/stratcon/StratconContractInitializer.java b/MekHQ/src/mekhq/campaign/stratcon/StratconContractInitializer.java index d44bc4ea9d..2a18790323 100644 --- a/MekHQ/src/mekhq/campaign/stratcon/StratconContractInitializer.java +++ b/MekHQ/src/mekhq/campaign/stratcon/StratconContractInitializer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2022 - The MegaMek Team. All Rights Reserved. + * Copyright (c) 2019-2024 - The MegaMek Team. All Rights Reserved. * * This file is part of MekHQ. * @@ -79,7 +79,7 @@ public static void initializeCampaignState(AtBContract contract, Campaign campai StratconTrackState track = initializeTrackState(NUM_LANCES_PER_TRACK, scenarioOdds, deploymentTime, planetaryTemperature); - track.setDisplayableName(String.format("Track %d", x)); + track.setDisplayableName(String.format("Sector %d", x)); campaignState.addTrack(track); } @@ -95,7 +95,7 @@ public static void initializeCampaignState(AtBContract contract, Campaign campai StratconTrackState track = initializeTrackState(oddLanceCount, scenarioOdds, deploymentTime, planetaryTemperature); - track.setDisplayableName(String.format("Track %d", campaignState.getTracks().size())); + track.setDisplayableName(String.format("Sector %d", campaignState.getTracks().size())); campaignState.addTrack(track); } diff --git a/MekHQ/src/mekhq/gui/StratconPanel.java b/MekHQ/src/mekhq/gui/StratconPanel.java index 7dd32bb540..08d28eca98 100644 --- a/MekHQ/src/mekhq/gui/StratconPanel.java +++ b/MekHQ/src/mekhq/gui/StratconPanel.java @@ -1,5 +1,5 @@ /* -* MegaMek - Copyright (c) 2020-2023 - The MegaMek Team. All Rights Reserved. +* MegaMek - Copyright (c) 2020-2024 - The MegaMek Team. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software @@ -13,6 +13,19 @@ */ package mekhq.gui; +import megamek.common.util.ImageUtil; +import megamek.logging.MMLogger; +import mekhq.MekHQ; +import mekhq.campaign.Campaign; +import mekhq.campaign.force.Force; +import mekhq.campaign.mission.ScenarioForceTemplate.ForceAlignment; +import mekhq.campaign.stratcon.*; +import mekhq.campaign.stratcon.StratconBiomeManifest.ImageType; +import mekhq.gui.stratcon.StratconScenarioWizard; +import mekhq.gui.stratcon.TrackForceAssignmentUI; + +import javax.imageio.ImageIO; +import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -27,37 +40,10 @@ import java.util.HashMap; import java.util.Map; -import javax.imageio.ImageIO; -import javax.swing.JCheckBoxMenuItem; -import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuItem; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.SwingUtilities; - -import megamek.common.util.ImageUtil; -import megamek.logging.MMLogger; -import mekhq.MekHQ; -import mekhq.campaign.Campaign; -import mekhq.campaign.force.Force; -import mekhq.campaign.mission.ScenarioForceTemplate.ForceAlignment; -import mekhq.campaign.stratcon.StratconBiomeManifest; -import mekhq.campaign.stratcon.StratconBiomeManifest.ImageType; -import mekhq.campaign.stratcon.StratconCampaignState; -import mekhq.campaign.stratcon.StratconCoords; -import mekhq.campaign.stratcon.StratconFacility; -import mekhq.campaign.stratcon.StratconFacilityFactory; -import mekhq.campaign.stratcon.StratconRulesManager; -import mekhq.campaign.stratcon.StratconScenario; -import mekhq.campaign.stratcon.StratconTrackState; -import mekhq.gui.stratcon.StratconScenarioWizard; -import mekhq.gui.stratcon.TrackForceAssignmentUI; - /** * This panel handles AtB-Stratcon GUI interactions with a specific scenario * track. - * + * * @author NickAragua */ public class StratconPanel extends JPanel implements ActionListener { @@ -209,7 +195,7 @@ private void buildRightClickMenu(StratconCoords coords) { rightClickMenu.addSeparator(); menuItemGMReveal = new JMenuItem(); - menuItemGMReveal.setText(currentTrack.isGmRevealed() ? "Hide Track" : "Reveal Track"); + menuItemGMReveal.setText(currentTrack.isGmRevealed() ? "Hide Sector" : "Reveal Sector"); menuItemGMReveal.setActionCommand(RCLICK_COMMAND_REVEAL_TRACK); menuItemGMReveal.addActionListener(this); rightClickMenu.add(menuItemGMReveal); @@ -329,7 +315,7 @@ private Polygon generateGraphHex() { * The point of it is to draw all the hexes for the board. * If it's a "dry run", we don't actually draw the hexes, we just pretend to * until we "draw" one that encompasses the clicked point. - * + * * @param g2D - graphics object on which to draw * @param drawHexType - whether to draw the hex backgrounds, hex outlines or a * dry run for click detection @@ -522,7 +508,7 @@ private BufferedImage getImage(String imageKey, ImageType imageType) { try { image = ImageIO.read(biomeImageFile); } catch (Exception e) { - logger.error("Unable to load image: " + imageName + " with ID '" + imageKey + "'"); + logger.error("Unable to load image: " + imageName + " with ID '" + imageKey + '\''); return null; } @@ -742,7 +728,7 @@ private void drawTextEffect(Graphics2D g2D, Shape marker, String text, StratconC /** * Returns the translation that we need to make to render the "next downward" * hex. - * + * * @return Two dimensional array with the first element being the x vector and * the second being the y vector */ @@ -754,14 +740,14 @@ private int[] getDownwardYVector() { * Returns the translation that we need to make to move from the bottom of a * column to the top of the next * column to the right. - * + * * @param evenColumn Whether the column we're currently in is odd or even * @return Two dimensional array with the first element being the x vector and * the second being the y vector */ private int[] getRightAndUpVector(boolean evenColumn) { - int yRadius = (int) (HEX_Y_RADIUS); - int xRadius = (int) (HEX_X_RADIUS); + int yRadius = HEX_Y_RADIUS; + int xRadius = HEX_X_RADIUS; int yTranslation = currentTrack.getHeight() * yRadius * 2; if (evenColumn) { @@ -777,7 +763,7 @@ private int[] getRightAndUpVector(boolean evenColumn) { * Go to the origin of the hex board and reset the scaling. */ private void performInitialTransform(Graphics2D g2D) { - g2D.translate(0, 0 + HEX_Y_RADIUS); + g2D.translate(0, HEX_Y_RADIUS); g2D.scale(scale, scale); } @@ -789,7 +775,7 @@ private void performInitialTransform(Graphics2D g2D) { * for this class. * * Side effects: the dry run sets the boardState clicked hex coordinates. - * + * * @return Whether or not the clicked point was found on the hex board */ private boolean detectClickedHex() { diff --git a/MekHQ/src/mekhq/gui/StratconTab.java b/MekHQ/src/mekhq/gui/StratconTab.java index 66fb5db9d6..5999cfc3d3 100644 --- a/MekHQ/src/mekhq/gui/StratconTab.java +++ b/MekHQ/src/mekhq/gui/StratconTab.java @@ -133,7 +133,7 @@ private void initializeInfoPanel() { expandedObjectivePanel.setAlignmentX(LEFT_ALIGNMENT); infoPanel.add(expandedObjectivePanel); - JLabel lblCurrentTrack = new JLabel("Current Track:"); + JLabel lblCurrentTrack = new JLabel("Current Sector:"); infoPanel.add(lblCurrentTrack); cboCurrentTrack = new JComboBox<>(); @@ -350,7 +350,7 @@ private String buildStrategicObjectiveText(StratconCampaignState campaignState) sb.append("Engage and defeat hostile forces in ") .append(objective.getCurrentObjectiveCount()).append('/') .append(objective.getDesiredObjectiveCount()) - .append(" scenarios on ").append(track.getDisplayableName()); + .append(" scenarios in ").append(track.getDisplayableName()); break; default: break; @@ -414,7 +414,7 @@ private void repopulateTrackList() { stratconPanel.selectTrack(selectedTrack.contract.getStratconCampaignState(), currentTDI.track); stratconPanel.setVisible(true); } else { - infoPanelText.setText("No active campaign tracks"); + infoPanelText.setText("No active sectors"); stratconPanel.setVisible(false); } }