18
18
import mekhq .MekHQ ;
19
19
import mekhq .campaign .Campaign ;
20
20
import mekhq .campaign .force .Force ;
21
- import mekhq .campaign .mission .ScenarioForceTemplate .ForceAlignment ;
22
21
import mekhq .campaign .stratcon .*;
23
22
import mekhq .campaign .stratcon .StratconBiomeManifest .ImageType ;
24
23
import mekhq .gui .stratcon .StratconScenarioWizard ;
40
39
import java .util .HashMap ;
41
40
import java .util .Map ;
42
41
42
+ import static mekhq .campaign .mission .ScenarioForceTemplate .ForceAlignment .Allied ;
43
+
43
44
/**
44
45
* This panel handles AtB-Stratcon GUI interactions with a specific scenario
45
46
* track.
@@ -144,7 +145,7 @@ public void selectTrack(StratconCampaignState campaignState, StratconTrackState
144
145
// clear hex selection
145
146
boardState .selectedX = null ;
146
147
boardState .selectedY = null ;
147
- infoArea .setText (buildSelectedHexInfo ());
148
+ infoArea .setText (buildSelectedHexInfo (campaign ));
148
149
149
150
repaint ();
150
151
}
@@ -471,7 +472,7 @@ private boolean imageLoaded(String imageKey) {
471
472
}
472
473
473
474
private BufferedImage getFacilityImage (StratconFacility facility ) {
474
- String imageKeyPrefix = facility .getOwner () == ForceAlignment . Allied ? StratconBiomeManifest .FACILITY_ALLIED
475
+ String imageKeyPrefix = facility .getOwner () == Allied ? StratconBiomeManifest .FACILITY_ALLIED
475
476
: StratconBiomeManifest .FACILITY_HOSTILE ;
476
477
String imageKey = imageKeyPrefix + facility .getFacilityType ().name ();
477
478
@@ -569,7 +570,7 @@ private void drawScenarios(Graphics2D g2D) {
569
570
570
571
if (currentTrack .getFacility (currentCoords ) == null ) {
571
572
drawTextEffect (g2D , scenarioMarker , "Hostile Force Detected" , currentCoords );
572
- } else if (currentTrack .getFacility (currentCoords ).getOwner () == ForceAlignment . Allied ) {
573
+ } else if (currentTrack .getFacility (currentCoords ).getOwner () == Allied ) {
573
574
drawTextEffect (g2D , scenarioMarker , "Under Attack!" , currentCoords );
574
575
}
575
576
}
@@ -610,7 +611,7 @@ private void drawFacilities(Graphics2D g2D) {
610
611
StratconFacility facility = currentTrack .getFacility (currentCoords );
611
612
612
613
if ((facility != null ) && (facility .isVisible () || trackRevealed || currentTrack .isGmRevealed ())) {
613
- g2D .setColor (facility .getOwner () == ForceAlignment . Allied ? Color .CYAN : Color .RED );
614
+ g2D .setColor (facility .getOwner () == Allied ? Color .CYAN : Color .RED );
614
615
615
616
BufferedImage facilityImage = getFacilityImage (facility );
616
617
@@ -813,7 +814,7 @@ public void mouseReleasedHandler(MouseEvent e) {
813
814
boolean pointFoundOnBoard = detectClickedHex ();
814
815
815
816
if (pointFoundOnBoard ) {
816
- infoArea .setText (buildSelectedHexInfo ());
817
+ infoArea .setText (buildSelectedHexInfo (campaign ));
817
818
}
818
819
819
820
repaint ();
@@ -850,7 +851,7 @@ public StratconCoords getSelectedCoords() {
850
851
* containing info such as whether it's been revealed, assigned forces,
851
852
* scenarios, facilities, etc.
852
853
*/
853
- private String buildSelectedHexInfo () {
854
+ private String buildSelectedHexInfo (Campaign campaign ) {
854
855
StringBuilder infoBuilder = new StringBuilder ();
855
856
infoBuilder .append ("<html><br/>" );
856
857
@@ -864,13 +865,13 @@ private String buildSelectedHexInfo() {
864
865
boolean coordsRevealed = currentTrack .hasActiveTrackReveal ()
865
866
|| currentTrack .getRevealedCoords ().contains (boardState .getSelectedCoords ());
866
867
if (coordsRevealed ) {
867
- infoBuilder .append ("<span color='" + MekHQ .getMHQOptions ().getFontColorPositiveHexColor ()
868
- + "'>Recon complete </span><br/>" );
868
+ infoBuilder .append ("<span color='" ). append ( MekHQ .getMHQOptions ().getFontColorPositiveHexColor () )
869
+ . append ( "'>Recon Complete </span><br/>" );
869
870
}
870
871
871
872
if (currentTrack .getAssignedCoordForces ().containsKey (boardState .getSelectedCoords ())) {
872
873
for (int forceID : currentTrack .getAssignedCoordForces ().get (boardState .getSelectedCoords ())) {
873
- Force force = campaign .getForce (forceID );
874
+ Force force = this . campaign .getForce (forceID );
874
875
infoBuilder .append (force .getName ()).append (" assigned" );
875
876
876
877
if (currentTrack .getStickyForces ().contains (forceID )) {
@@ -890,12 +891,12 @@ private String buildSelectedHexInfo() {
890
891
if ((facility != null ) && (facility .getFacilityType () != null )) {
891
892
if (facility .isStrategicObjective ()) {
892
893
infoBuilder .append (String .format ("<br/><span color='%s'>Contract objective located</span>" ,
893
- facility .getOwner () == ForceAlignment . Allied
894
+ facility .getOwner () == Allied
894
895
? MekHQ .getMHQOptions ().getFontColorPositiveHexColor ()
895
896
: MekHQ .getMHQOptions ().getFontColorNegativeHexColor ()));
896
897
}
897
898
infoBuilder .append ("<span color='" )
898
- .append (facility .getOwner () == ForceAlignment . Allied
899
+ .append (facility .getOwner () == Allied
899
900
? MekHQ .getMHQOptions ().getFontColorPositiveHexColor ()
900
901
: MekHQ .getMHQOptions ().getFontColorNegativeHexColor ())
901
902
.append ("'>" )
@@ -912,14 +913,14 @@ private String buildSelectedHexInfo() {
912
913
913
914
} else {
914
915
infoBuilder .append ("<span color='" ).append (MekHQ .getMHQOptions ().getFontColorNegative ())
915
- .append ("'>Recon incomplete </span>" );
916
+ .append ("'>Recon Incomplete </span>" );
916
917
}
917
918
infoBuilder .append ("<br/>" );
918
919
919
920
StratconScenario selectedScenario = getSelectedScenario ();
920
921
if ((selectedScenario != null ) &&
921
922
((selectedScenario .getDeploymentDate () != null ) || currentTrack .isGmRevealed ())) {
922
- infoBuilder .append (selectedScenario .getInfo ());
923
+ infoBuilder .append (selectedScenario .getInfo (campaign , true ));
923
924
}
924
925
925
926
infoBuilder .append ("</html>" );
0 commit comments