1818import mekhq .MekHQ ;
1919import mekhq .campaign .Campaign ;
2020import mekhq .campaign .force .Force ;
21- import mekhq .campaign .mission .ScenarioForceTemplate .ForceAlignment ;
2221import mekhq .campaign .stratcon .*;
2322import mekhq .campaign .stratcon .StratconBiomeManifest .ImageType ;
2423import mekhq .gui .stratcon .StratconScenarioWizard ;
4039import java .util .HashMap ;
4140import java .util .Map ;
4241
42+ import static mekhq .campaign .mission .ScenarioForceTemplate .ForceAlignment .Allied ;
43+
4344/**
4445 * This panel handles AtB-Stratcon GUI interactions with a specific scenario
4546 * track.
@@ -144,7 +145,7 @@ public void selectTrack(StratconCampaignState campaignState, StratconTrackState
144145 // clear hex selection
145146 boardState .selectedX = null ;
146147 boardState .selectedY = null ;
147- infoArea .setText (buildSelectedHexInfo ());
148+ infoArea .setText (buildSelectedHexInfo (campaign ));
148149
149150 repaint ();
150151 }
@@ -471,7 +472,7 @@ private boolean imageLoaded(String imageKey) {
471472 }
472473
473474 private BufferedImage getFacilityImage (StratconFacility facility ) {
474- String imageKeyPrefix = facility .getOwner () == ForceAlignment . Allied ? StratconBiomeManifest .FACILITY_ALLIED
475+ String imageKeyPrefix = facility .getOwner () == Allied ? StratconBiomeManifest .FACILITY_ALLIED
475476 : StratconBiomeManifest .FACILITY_HOSTILE ;
476477 String imageKey = imageKeyPrefix + facility .getFacilityType ().name ();
477478
@@ -569,7 +570,7 @@ private void drawScenarios(Graphics2D g2D) {
569570
570571 if (currentTrack .getFacility (currentCoords ) == null ) {
571572 drawTextEffect (g2D , scenarioMarker , "Hostile Force Detected" , currentCoords );
572- } else if (currentTrack .getFacility (currentCoords ).getOwner () == ForceAlignment . Allied ) {
573+ } else if (currentTrack .getFacility (currentCoords ).getOwner () == Allied ) {
573574 drawTextEffect (g2D , scenarioMarker , "Under Attack!" , currentCoords );
574575 }
575576 }
@@ -610,7 +611,7 @@ private void drawFacilities(Graphics2D g2D) {
610611 StratconFacility facility = currentTrack .getFacility (currentCoords );
611612
612613 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 );
614615
615616 BufferedImage facilityImage = getFacilityImage (facility );
616617
@@ -813,7 +814,7 @@ public void mouseReleasedHandler(MouseEvent e) {
813814 boolean pointFoundOnBoard = detectClickedHex ();
814815
815816 if (pointFoundOnBoard ) {
816- infoArea .setText (buildSelectedHexInfo ());
817+ infoArea .setText (buildSelectedHexInfo (campaign ));
817818 }
818819
819820 repaint ();
@@ -850,7 +851,7 @@ public StratconCoords getSelectedCoords() {
850851 * containing info such as whether it's been revealed, assigned forces,
851852 * scenarios, facilities, etc.
852853 */
853- private String buildSelectedHexInfo () {
854+ private String buildSelectedHexInfo (Campaign campaign ) {
854855 StringBuilder infoBuilder = new StringBuilder ();
855856 infoBuilder .append ("<html><br/>" );
856857
@@ -864,13 +865,13 @@ private String buildSelectedHexInfo() {
864865 boolean coordsRevealed = currentTrack .hasActiveTrackReveal ()
865866 || currentTrack .getRevealedCoords ().contains (boardState .getSelectedCoords ());
866867 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/>" );
869870 }
870871
871872 if (currentTrack .getAssignedCoordForces ().containsKey (boardState .getSelectedCoords ())) {
872873 for (int forceID : currentTrack .getAssignedCoordForces ().get (boardState .getSelectedCoords ())) {
873- Force force = campaign .getForce (forceID );
874+ Force force = this . campaign .getForce (forceID );
874875 infoBuilder .append (force .getName ()).append (" assigned" );
875876
876877 if (currentTrack .getStickyForces ().contains (forceID )) {
@@ -890,12 +891,12 @@ private String buildSelectedHexInfo() {
890891 if ((facility != null ) && (facility .getFacilityType () != null )) {
891892 if (facility .isStrategicObjective ()) {
892893 infoBuilder .append (String .format ("<br/><span color='%s'>Contract objective located</span>" ,
893- facility .getOwner () == ForceAlignment . Allied
894+ facility .getOwner () == Allied
894895 ? MekHQ .getMHQOptions ().getFontColorPositiveHexColor ()
895896 : MekHQ .getMHQOptions ().getFontColorNegativeHexColor ()));
896897 }
897898 infoBuilder .append ("<span color='" )
898- .append (facility .getOwner () == ForceAlignment . Allied
899+ .append (facility .getOwner () == Allied
899900 ? MekHQ .getMHQOptions ().getFontColorPositiveHexColor ()
900901 : MekHQ .getMHQOptions ().getFontColorNegativeHexColor ())
901902 .append ("'>" )
@@ -912,14 +913,14 @@ private String buildSelectedHexInfo() {
912913
913914 } else {
914915 infoBuilder .append ("<span color='" ).append (MekHQ .getMHQOptions ().getFontColorNegative ())
915- .append ("'>Recon incomplete </span>" );
916+ .append ("'>Recon Incomplete </span>" );
916917 }
917918 infoBuilder .append ("<br/>" );
918919
919920 StratconScenario selectedScenario = getSelectedScenario ();
920921 if ((selectedScenario != null ) &&
921922 ((selectedScenario .getDeploymentDate () != null ) || currentTrack .isGmRevealed ())) {
922- infoBuilder .append (selectedScenario .getInfo ());
923+ infoBuilder .append (selectedScenario .getInfo (campaign , true ));
923924 }
924925
925926 infoBuilder .append ("</html>" );
0 commit comments