Skip to content

Commit e0fb583

Browse files
authored
Merge pull request #5154 from IllianiCBT/stratCon_sectors2
Renamed Tracks and AtB Campaign State in StratCon
2 parents d9d7381 + 6a46b2e commit e0fb583

File tree

5 files changed

+32
-46
lines changed

5 files changed

+32
-46
lines changed

MekHQ/resources/mekhq/resources/CampaignGUI.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ panOrganization.TabConstraints.tabTitle=TO&E
119119
panMap.TabConstraints.tabTitle=Interstellar Map
120120
panBriefing.TabConstraints.tabTitle=Briefing Room
121121
panMekLab.TabConstraints.tabTitle=Mek Lab
122-
panStratcon.TabConstraints.tabTitle=AtB Campaign State
122+
panStratcon.TabConstraints.tabTitle=Area of Operations
123123
panCustom.TabConstraints.tabTitle=Custom
124124
btnAssignDoc.text=Assign
125125
btnUnassignDoc.text=Unassign

MekHQ/resources/mekhq/resources/GUI.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ MHQTabType.REPAIR_BAY.text=Repair Bay
824824
MHQTabType.INFIRMARY.text=Infirmary
825825
MHQTabType.FINANCES.text=Finances
826826
MHQTabType.MEK_LAB.text=Mek Lab
827-
MHQTabType.STRAT_CON.text=AtB Campaign State
827+
MHQTabType.STRAT_CON.text=Area of Operations
828828

829829
#### PersonnelFilter Enum
830830
PersonnelFilter.ALL.text=All Personnel

MekHQ/src/mekhq/campaign/stratcon/StratconContractInitializer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019-2022 - The MegaMek Team. All Rights Reserved.
2+
* Copyright (c) 2019-2024 - The MegaMek Team. All Rights Reserved.
33
*
44
* This file is part of MekHQ.
55
*
@@ -79,7 +79,7 @@ public static void initializeCampaignState(AtBContract contract, Campaign campai
7979

8080
StratconTrackState track = initializeTrackState(NUM_LANCES_PER_TRACK, scenarioOdds, deploymentTime,
8181
planetaryTemperature);
82-
track.setDisplayableName(String.format("Track %d", x));
82+
track.setDisplayableName(String.format("Sector %d", x));
8383
campaignState.addTrack(track);
8484
}
8585

@@ -95,7 +95,7 @@ public static void initializeCampaignState(AtBContract contract, Campaign campai
9595

9696
StratconTrackState track = initializeTrackState(oddLanceCount, scenarioOdds, deploymentTime,
9797
planetaryTemperature);
98-
track.setDisplayableName(String.format("Track %d", campaignState.getTracks().size()));
98+
track.setDisplayableName(String.format("Sector %d", campaignState.getTracks().size()));
9999
campaignState.addTrack(track);
100100
}
101101

MekHQ/src/mekhq/gui/StratconPanel.java

Lines changed: 24 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* MegaMek - Copyright (c) 2020-2023 - The MegaMek Team. All Rights Reserved.
2+
* MegaMek - Copyright (c) 2020-2024 - The MegaMek Team. All Rights Reserved.
33
*
44
* This program is free software; you can redistribute it and/or modify it under
55
* the terms of the GNU General Public License as published by the Free Software
@@ -13,6 +13,19 @@
1313
*/
1414
package mekhq.gui;
1515

16+
import megamek.common.util.ImageUtil;
17+
import megamek.logging.MMLogger;
18+
import mekhq.MekHQ;
19+
import mekhq.campaign.Campaign;
20+
import mekhq.campaign.force.Force;
21+
import mekhq.campaign.mission.ScenarioForceTemplate.ForceAlignment;
22+
import mekhq.campaign.stratcon.*;
23+
import mekhq.campaign.stratcon.StratconBiomeManifest.ImageType;
24+
import mekhq.gui.stratcon.StratconScenarioWizard;
25+
import mekhq.gui.stratcon.TrackForceAssignmentUI;
26+
27+
import javax.imageio.ImageIO;
28+
import javax.swing.*;
1629
import java.awt.*;
1730
import java.awt.event.ActionEvent;
1831
import java.awt.event.ActionListener;
@@ -27,37 +40,10 @@
2740
import java.util.HashMap;
2841
import java.util.Map;
2942

30-
import javax.imageio.ImageIO;
31-
import javax.swing.JCheckBoxMenuItem;
32-
import javax.swing.JLabel;
33-
import javax.swing.JMenu;
34-
import javax.swing.JMenuItem;
35-
import javax.swing.JPanel;
36-
import javax.swing.JPopupMenu;
37-
import javax.swing.SwingUtilities;
38-
39-
import megamek.common.util.ImageUtil;
40-
import megamek.logging.MMLogger;
41-
import mekhq.MekHQ;
42-
import mekhq.campaign.Campaign;
43-
import mekhq.campaign.force.Force;
44-
import mekhq.campaign.mission.ScenarioForceTemplate.ForceAlignment;
45-
import mekhq.campaign.stratcon.StratconBiomeManifest;
46-
import mekhq.campaign.stratcon.StratconBiomeManifest.ImageType;
47-
import mekhq.campaign.stratcon.StratconCampaignState;
48-
import mekhq.campaign.stratcon.StratconCoords;
49-
import mekhq.campaign.stratcon.StratconFacility;
50-
import mekhq.campaign.stratcon.StratconFacilityFactory;
51-
import mekhq.campaign.stratcon.StratconRulesManager;
52-
import mekhq.campaign.stratcon.StratconScenario;
53-
import mekhq.campaign.stratcon.StratconTrackState;
54-
import mekhq.gui.stratcon.StratconScenarioWizard;
55-
import mekhq.gui.stratcon.TrackForceAssignmentUI;
56-
5743
/**
5844
* This panel handles AtB-Stratcon GUI interactions with a specific scenario
5945
* track.
60-
*
46+
*
6147
* @author NickAragua
6248
*/
6349
public class StratconPanel extends JPanel implements ActionListener {
@@ -209,7 +195,7 @@ private void buildRightClickMenu(StratconCoords coords) {
209195
rightClickMenu.addSeparator();
210196

211197
menuItemGMReveal = new JMenuItem();
212-
menuItemGMReveal.setText(currentTrack.isGmRevealed() ? "Hide Track" : "Reveal Track");
198+
menuItemGMReveal.setText(currentTrack.isGmRevealed() ? "Hide Sector" : "Reveal Sector");
213199
menuItemGMReveal.setActionCommand(RCLICK_COMMAND_REVEAL_TRACK);
214200
menuItemGMReveal.addActionListener(this);
215201
rightClickMenu.add(menuItemGMReveal);
@@ -329,7 +315,7 @@ private Polygon generateGraphHex() {
329315
* The point of it is to draw all the hexes for the board.
330316
* If it's a "dry run", we don't actually draw the hexes, we just pretend to
331317
* until we "draw" one that encompasses the clicked point.
332-
*
318+
*
333319
* @param g2D - graphics object on which to draw
334320
* @param drawHexType - whether to draw the hex backgrounds, hex outlines or a
335321
* dry run for click detection
@@ -522,7 +508,7 @@ private BufferedImage getImage(String imageKey, ImageType imageType) {
522508
try {
523509
image = ImageIO.read(biomeImageFile);
524510
} catch (Exception e) {
525-
logger.error("Unable to load image: " + imageName + " with ID '" + imageKey + "'");
511+
logger.error("Unable to load image: " + imageName + " with ID '" + imageKey + '\'');
526512
return null;
527513
}
528514

@@ -742,7 +728,7 @@ private void drawTextEffect(Graphics2D g2D, Shape marker, String text, StratconC
742728
/**
743729
* Returns the translation that we need to make to render the "next downward"
744730
* hex.
745-
*
731+
*
746732
* @return Two dimensional array with the first element being the x vector and
747733
* the second being the y vector
748734
*/
@@ -754,14 +740,14 @@ private int[] getDownwardYVector() {
754740
* Returns the translation that we need to make to move from the bottom of a
755741
* column to the top of the next
756742
* column to the right.
757-
*
743+
*
758744
* @param evenColumn Whether the column we're currently in is odd or even
759745
* @return Two dimensional array with the first element being the x vector and
760746
* the second being the y vector
761747
*/
762748
private int[] getRightAndUpVector(boolean evenColumn) {
763-
int yRadius = (int) (HEX_Y_RADIUS);
764-
int xRadius = (int) (HEX_X_RADIUS);
749+
int yRadius = HEX_Y_RADIUS;
750+
int xRadius = HEX_X_RADIUS;
765751

766752
int yTranslation = currentTrack.getHeight() * yRadius * 2;
767753
if (evenColumn) {
@@ -777,7 +763,7 @@ private int[] getRightAndUpVector(boolean evenColumn) {
777763
* Go to the origin of the hex board and reset the scaling.
778764
*/
779765
private void performInitialTransform(Graphics2D g2D) {
780-
g2D.translate(0, 0 + HEX_Y_RADIUS);
766+
g2D.translate(0, HEX_Y_RADIUS);
781767
g2D.scale(scale, scale);
782768
}
783769

@@ -789,7 +775,7 @@ private void performInitialTransform(Graphics2D g2D) {
789775
* for this class.
790776
*
791777
* Side effects: the dry run sets the boardState clicked hex coordinates.
792-
*
778+
*
793779
* @return Whether or not the clicked point was found on the hex board
794780
*/
795781
private boolean detectClickedHex() {

MekHQ/src/mekhq/gui/StratconTab.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private void initializeInfoPanel() {
133133
expandedObjectivePanel.setAlignmentX(LEFT_ALIGNMENT);
134134
infoPanel.add(expandedObjectivePanel);
135135

136-
JLabel lblCurrentTrack = new JLabel("Current Track:");
136+
JLabel lblCurrentTrack = new JLabel("Current Sector:");
137137
infoPanel.add(lblCurrentTrack);
138138

139139
cboCurrentTrack = new JComboBox<>();
@@ -350,7 +350,7 @@ private String buildStrategicObjectiveText(StratconCampaignState campaignState)
350350
sb.append("Engage and defeat hostile forces in ")
351351
.append(objective.getCurrentObjectiveCount()).append('/')
352352
.append(objective.getDesiredObjectiveCount())
353-
.append(" scenarios on ").append(track.getDisplayableName());
353+
.append(" scenarios in ").append(track.getDisplayableName());
354354
break;
355355
default:
356356
break;
@@ -414,7 +414,7 @@ private void repopulateTrackList() {
414414
stratconPanel.selectTrack(selectedTrack.contract.getStratconCampaignState(), currentTDI.track);
415415
stratconPanel.setVisible(true);
416416
} else {
417-
infoPanelText.setText("No active campaign tracks");
417+
infoPanelText.setText("No active sectors");
418418
stratconPanel.setVisible(false);
419419
}
420420
}

0 commit comments

Comments
 (0)