66import java .util .Properties ;
77import org .apache .logging .log4j .LogManager ;
88import org .apache .logging .log4j .Logger ;
9+ import sh .okx .civmodern .common .features .CompactedItem ;
910import sh .okx .civmodern .common .gui .Alignment ;
1011
1112public class CivMapConfig {
@@ -16,7 +17,6 @@ public class CivMapConfig {
1617 public static final int DEFAULT_CHEVRON_COLOUR = 0xFF0000 ;
1718 public static final int DEFAULT_BORDER_COLOUR = 0x7a7a7a ;
1819 private final File file ;
19- private int compactedColour ;
2020 private int radarCircles ;
2121 private int radarSize ;
2222 private float iconSize ;
@@ -47,15 +47,14 @@ public class CivMapConfig {
4747 private int minimapSize ;
4848 private boolean playerWaypointsEnabled ;
4949 private float minimapZoom ;
50- private boolean cratesAreCompacted ;
5150 private boolean showRepairCost ;
5251 private boolean radarLogarithm ;
5352 private boolean showMinimapCoords ;
5453 private int borderColour ;
5554
5655 public CivMapConfig (File file , Properties properties ) {
5756 this .file = file ;
58- this . compactedColour = Integer .parseInt (properties .getProperty ("compacted_colour" , "16777048" ));
57+ CompactedItem . COMPACTED . setRBG ( Integer .parseInt (properties .getProperty ("compacted_colour" , Integer . toString ( CompactedItem . COMPACTED . defaultColour )) ));
5958 this .radarCircles = Integer .parseInt (properties .getProperty ("radar_circles" , "4" ));
6059 this .radarSize = Integer .parseInt (properties .getProperty ("radar_size" , "80" ));
6160 this .alignment = Alignment .valueOf (properties .getProperty ("alignment" , "top_left" ).toUpperCase ());
@@ -86,17 +85,17 @@ public CivMapConfig(File file, Properties properties) {
8685 this .minimapSize = Integer .parseInt (properties .getProperty ("minimap_size" , "100" ));
8786 this .playerWaypointsEnabled = Boolean .parseBoolean (properties .getProperty ("player_waypoints_enabled" , "true" ));
8887 this .minimapZoom = Float .parseFloat (properties .getProperty ("minimap_zoom" , "4" ));
89- this .cratesAreCompacted = Boolean .parseBoolean (properties .getProperty ("crates_are_compacted" , "true" ));
9088 this .showRepairCost = Boolean .parseBoolean (properties .getProperty ("show_repair_cost" , "true" ));
9189 this .radarLogarithm = Boolean .parseBoolean (properties .getProperty ("radar_logarithm" , "false" ));
9290 this .showMinimapCoords = Boolean .parseBoolean (properties .getProperty ("show_minimap_coords" , "true" ));
9391 this .borderColour = Integer .parseInt (properties .getProperty ("border_colour" , Integer .toString (DEFAULT_BORDER_COLOUR )));
92+ CompactedItem .CRATE .setRBG (Integer .parseInt (properties .getProperty ("crate_colour" , Integer .toString (CompactedItem .CRATE .defaultColour ))));
9493 }
9594
9695 public void save () {
9796 try {
9897 Properties properties = new Properties ();
99- properties .setProperty ("compacted_colour" , Integer .toString (compactedColour ));
98+ properties .setProperty ("compacted_colour" , Integer .toString (CompactedItem . COMPACTED . getRBG () ));
10099 properties .setProperty ("radar_circles" , Integer .toString (radarCircles ));
101100 properties .setProperty ("radar_size" , Integer .toString (radarSize ));
102101 properties .setProperty ("alignment" , alignment .name ().toLowerCase ());
@@ -126,11 +125,11 @@ public void save() {
126125 properties .setProperty ("minimap_size" , Integer .toString (minimapSize ));
127126 properties .setProperty ("player_waypoints_enabled" , Boolean .toString (playerWaypointsEnabled ));
128127 properties .setProperty ("minimap_zoom" , Float .toString (minimapZoom ));
129- properties .setProperty ("crates_are_compacted" , Boolean .toString (cratesAreCompacted ));
130128 properties .setProperty ("show_repair_cost" , Boolean .toString (showRepairCost ));
131129 properties .setProperty ("radar_logarithm" , Boolean .toString (radarLogarithm ));
132130 properties .setProperty ("show_minimap_coords" , Boolean .toString (showMinimapCoords ));
133131 properties .setProperty ("border_colour" , Integer .toString (borderColour ));
132+ properties .setProperty ("crate_colour" , Integer .toString (CompactedItem .CRATE .getRBG ()));
134133
135134 try (FileOutputStream output = new FileOutputStream (file )) {
136135 properties .store (output , null );
@@ -149,14 +148,6 @@ public void setShowItems(boolean showItems) {
149148 this .showItems = showItems ;
150149 }
151150
152- public int getColour () {
153- return compactedColour ;
154- }
155-
156- public void setColour (int compactedColour ) {
157- this .compactedColour = compactedColour ;
158- }
159-
160151 public void setRadarCircles (int radarCircles ) {
161152 this .radarCircles = radarCircles ;
162153 }
@@ -389,14 +380,6 @@ public void setMinimapZoom(float minimapZoom) {
389380 this .minimapZoom = minimapZoom ;
390381 }
391382
392- public boolean isCratesAreCompacted () {
393- return cratesAreCompacted ;
394- }
395-
396- public void setCratesAreCompacted (boolean cratesAreCompacted ) {
397- this .cratesAreCompacted = cratesAreCompacted ;
398- }
399-
400383 public boolean isShowRepairCost () {
401384 return showRepairCost ;
402385 }
0 commit comments