Skip to content

Commit

Permalink
Add minable painting, extra default legends.
Browse files Browse the repository at this point in the history
  • Loading branch information
mOctave committed Sep 17, 2024
1 parent 543bbbe commit 680d352
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ Right now, the following painting modes are allowed:

- `government` This is the default painting mode. It gives each system a color according to the color of the government that controls it.
- `trade <commodity>` Paints the map according to the price of a selected commodity relative to its game defined minimum and maximum typical values.
- `minables <commodity>` Paints the map according to the number of a selected minable present in a system. Best used with `paint uninhabited`.

## Concluding Note

Expand Down
107 changes: 107 additions & 0 deletions default config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,113 @@ legend "governments"
item "Pug" "governments: Pug"
item "Uninhabited" "governments: Ungoverned"

legend "minable count"
align right
item "not present" "governments: Ungoverned"
item "1 asteroid" 0 .12 .6
item "8 asteroids" .12 .48 .48
item "15 asteroids" .6 .48 0

legend "food price"
align right
header "Price of Food"
item "unavailable" "governments: Ungoverned"
item "100 credits/ton" 0 .12 .6
item "225 credits/ton" .06 .3 .54
item "350 credits/ton" .12 .48 .48
item "475 credits/ton" .36 .48 .24
item "600 credits/ton" .6 .48 0

legend "clothing price"
align right
header "Price of Clothing"
item "unavailable" "governments: Ungoverned"
item "140 credits/ton" 0 .12 .6
item "215 credits/ton" .06 .3 .54
item "290 credits/ton" .12 .48 .48
item "365 credits/ton" .36 .48 .24
item "440 credits/ton" .6 .48 0

legend "metal price"
align right
header "Price of Metal"
item "unavailable" "governments: Ungoverned"
item "190 credits/ton" 0 .12 .6
item "290 credits/ton" .06 .3 .54
item "390 credits/ton" .12 .48 .48
item "490 credits/ton" .36 .48 .24
item "590 credits/ton" .6 .48 0

legend "plastic price"
align right
header "Price of Plastic"
item "unavailable" "governments: Ungoverned"
item "240 credits/ton" 0 .12 .6
item "315 credits/ton" .06 .3 .54
item "390 credits/ton" .12 .48 .48
item "465 credits/ton" .36 .48 .24
item "540 credits/ton" .6 .48 0

legend "equipment price"
align right
header "Price of Equipment"
item "unavailable" "governments: Ungoverned"
item "330 credits/ton" 0 .12 .6
item "430 credits/ton" .06 .3 .54
item "530 credits/ton" .12 .48 .48
item "630 credits/ton" .36 .48 .24
item "730 credits/ton" .6 .48 0

legend "medical price"
align right
header "Price of Medical"
item "unavailable" "governments: Ungoverned"
item "430 credits/ton" 0 .12 .6
item "555 credits/ton" .06 .3 .54
item "680 credits/ton" .12 .48 .48
item "805 credits/ton" .36 .48 .24
item "930 credits/ton" .6 .48 0

legend "industrial price"
align right
header "Price of Industrial"
item "unavailable" "governments: Ungoverned"
item "520 credits/ton" 0 .12 .6
item "620 credits/ton" .06 .3 .54
item "720 credits/ton" .12 .48 .48
item "820 credits/ton" .36 .48 .24
item "920 credits/ton" .6 .48 0

legend "electronics price"
align right
header "Price of Electronics"
item "unavailable" "governments: Ungoverned"
item "590 credits/ton" 0 .12 .6
item "665 credits/ton" .06 .3 .54
item "740 credits/ton" .12 .48 .48
item "815 credits/ton" .36 .48 .24
item "890 credits/ton" .6 .48 0

legend "heavy metals price"
align right
header "Price of Heavy Metals"
item "unavailable" "governments: Ungoverned"
item "610 credits/ton" 0 .12 .6
item "785 credits/ton" .06 .3 .54
item "960 credits/ton" .12 .48 .48
item "1135 credits/ton" .36 .48 .24
item "1310 credits/ton" .6 .48 0

legend "luxury goods price"
align right
header "Price of Luxury Goods"
item "unavailable" "governments: Ungoverned"
item "920 credits/ton" 0 .12 .6
item "1070 credits/ton" .06 .3 .54
item "1220 credits/ton" .12 .48 .48
item "1370 credits/ton" .36 .48 .24
item "1520 credits/ton" .6 .48 0

"event list" "label"
"label coalition space"
"gegno space label"
Expand Down
14 changes: 14 additions & 0 deletions src/moctave/esmapper/GalacticMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,27 @@ public Color selectColor(StarSystem system, String[] paintMode) {
return getGovernment("Uninhabited").getColor();

if (paintMode[0].equals("trade")) {
if (system.getCommodityPrice(paintMode[1]) == 0)
return getGovernment("Uninhabited").getColor();

return getGeneralColor(getScore(
system.getCommodityPrice(paintMode[1]),
Trade.getMinCommodityPrice(paintMode[1]),
Trade.getMaxCommodityPrice(paintMode[1])
));
}

if (paintMode[0].equals("minables")) {
if (system.getMinableCount(paintMode[1]) == 0)
return getGovernment("Uninhabited").getColor();

return getGeneralColor(getScore(
system.getMinableCount(paintMode[1]),
1,
15
));
}

// Default is government paint
return getGovernment(system.getGovernment()).getColor();
}
Expand Down
4 changes: 2 additions & 2 deletions src/moctave/esmapper/StarSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public StarSystem(Node node) {
Builder.mapDouble(child, hazards, TYPE);
} else if (child.getName().equals("asteroid")) {
Builder.mapDoubleArray(child, asteroids, TYPE);
} else if (child.getName().equals("minable")) {
} else if (child.getName().equals("minables")) {
Builder.mapDoubleArray(child, minables, TYPE);
}
}
Expand Down Expand Up @@ -200,7 +200,7 @@ public void applyModifiers(Node node) {
Builder.mapDouble(child, hazards, TYPE);
} else if (child.getName().equals("asteroid")) {
Builder.mapDoubleArray(child, asteroids, TYPE);
} else if (child.getName().equals("minable")) {
} else if (child.getName().equals("minables")) {
Builder.mapDoubleArray(child, minables, TYPE);
}
}
Expand Down

0 comments on commit 680d352

Please sign in to comment.