Skip to content

Commit

Permalink
Add pollution and spore colors
Browse files Browse the repository at this point in the history
Pollution is no longer pulled from utility-colors, hence why a new
method was needed.
  • Loading branch information
Rycieos committed Nov 9, 2024
1 parent fcfcfc6 commit 1a9624c
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 6 deletions.
7 changes: 7 additions & 0 deletions data/base/data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,10 @@ then
table.insert(animation.layers, sprite_sheet)
end
end

if config("pollution-color") then
local prototype = data:get("airborne-pollutant", "pollution")
if prototype and not color_equals(config("pollution-color"), prototype.chart_color) then
prototype.chart_color = config("pollution-color")
end
end
2 changes: 2 additions & 0 deletions data/base/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ add_bool_setting(
"train-stop-signal-red",
{ "", { "entity-name.train-stop" }, " ", { "virtual-signal-name.signal-red" } }
)

add_color_setting("pollution", { "airborne-pollutant-name.pollution" }, { r = 140, g = 0, b = 0, a = 149 })
1 change: 0 additions & 1 deletion data/core/constants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ DefaultColors = {
capsule_range = { r = 0.05, g = 0.1, b = 0.05, a = 0.15 },
enemy = { r = 1, g = 0.1, b = 0.1, a = 1 },
enemy_territory = { r = 0.3, g = 0.03, b = 0.03, a = 0.3 },
--pollution = { r = 140, g = 0, b = 0, a = 149 },
turret_range = { r = 0.05, g = 0.1, b = 0.05, a = 0.15 },
turret_range_map = { r = 0.8, g = 0.25, b = 0.25, a = 1 },

Expand Down
1 change: 0 additions & 1 deletion data/core/data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ do_replace_color("artillery_range_map", chart_colors.artillery_range_color)
do_replace_color("capsule_range", utility_colors.capsule_range_visualization_color)
do_replace_color("enemy", chart_colors.default_enemy_color)
do_replace_color("enemy_territory", chart_colors.default_enemy_territory_color)
--do_replace_color("pollution", chart_colors.pollution_color)
do_replace_color("turret_range", utility_colors.turret_range_visualization_color)
do_replace_color("turret_range_map", chart_colors.turret_range_color)

Expand Down
1 change: 0 additions & 1 deletion data/core/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ add_core_color_setting(
"enemy_territory",
{ "", { "gui-map-generator.enemy-expansion-group-tile" }, " ", { "description.range" } }
)
--add_core_color_setting("pollution", { "item-name.pollution" })
add_core_color_setting(
"turret_range",
{ "", { "tooltip-category.turret" }, " ", { "description.range" }, " ", { "colorblind_ultimate-word.in-game" } }
Expand Down
7 changes: 7 additions & 0 deletions data/space-age/data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,10 @@ end
do_replace_casting("copper-plate", "copper")
do_replace_casting("copper-cable", "copper-cable")
do_replace_casting("iron-plate", "iron")

if config("spores-color") then
local prototype = data:get("airborne-pollutant", "spores")
if prototype and not color_equals(config("spores-color"), prototype.chart_color) then
prototype.chart_color = config("spores-color")
end
end
2 changes: 2 additions & 0 deletions data/space-age/settings.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
local prototypes = require("data.space-age.prototypes")
settings_from_prototypes(prototypes)

add_color_setting("spores", { "airborne-pollutant-name.spores" }, { r = 140, g = 140, b = 0, a = 149 })
6 changes: 3 additions & 3 deletions settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function add_bool_setting(name, localised_name, localised_description)
type = "bool-setting",
setting_type = "startup",
default_value = false,
order = order_prefix .. name .. "b",
order = order_prefix .. "b" .. name .. "b",
localised_name = localised_name or { "item-name." .. name },
localised_description = localised_description or { "colorblind_ultimate-description.custom-overlay" },
},
Expand All @@ -22,7 +22,7 @@ function add_option_setting(name, localised_name, options)
setting_type = "startup",
default_value = Options.none,
allowed_values = { Options.none, table.unpack(options) },
order = order_prefix .. name .. "d",
order = order_prefix .. "b" .. name .. "d",
localised_name = localised_name,
localised_description = { "colorblind_ultimate-description.custom-overlay-all" },
},
Expand All @@ -36,7 +36,7 @@ function add_color_setting(name, localised_name, default)
type = "color-setting",
setting_type = "startup",
default_value = default,
order = order_prefix .. "c",
order = order_prefix .. "a",
localised_name = localised_name,
},
})
Expand Down

0 comments on commit 1a9624c

Please sign in to comment.