Skip to content

Commit be45537

Browse files
committed
Add color options for spitter and worm acid
1 parent c54c155 commit be45537

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed

data/base/constants.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,8 @@ BaseDefaultColors = {
1717
["electric-pole-visualization"] = { r = 55, g = 85, b = 217, a = 255 },
1818
-- Source: __base__/graphics/entity/electric-mining-drill/electric-mining-drill-radius-visualization.png
1919
["mining-drill-visualization"] = { r = 78, g = 173, b = 159, a = 255 },
20+
-- Source: __base__/prototypes/entity/enemy-constants.lua
21+
["acid-stream"] = { 0.917, 1.000, 0.282, 1.000 },
22+
["acid-splash"] = { 1.000, 0.992, 0.512, 1.000 },
23+
["acid-sticker"] = { r = 0.714, g = 0.669, b = 0.291, a = 0.745 },
2024
}

data/base/data.lua

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,67 @@ if color and not color_equals(color, BaseDefaultColors["mining-drill-visualizati
141141
update_radius_visualization_color("mining-drill", "electric-mining-drill", color)
142142
update_radius_visualization_color("mining-drill", "pumpjack", color)
143143
end
144+
145+
color = config("acid-splash-color") --[[@as Color]]
146+
if color and not color_equals(color, BaseDefaultColors["acid-splash"]) then
147+
for _, prototype in pairs(data.raw["fire"]) do
148+
if prototype.pictures then
149+
for i = 1, 4 do
150+
if
151+
prototype.pictures[i]
152+
and prototype.pictures[i].layers
153+
and prototype.pictures[i].layers[1]
154+
and prototype.pictures[i].layers[1].filename
155+
== "__base__/graphics/entity/acid-splash/acid-splash-" .. i .. ".png"
156+
then
157+
prototype.pictures[i].layers[1].tint = color
158+
end
159+
end
160+
end
161+
if prototype.secondary_pictures then
162+
for i = 1, 4 do
163+
if
164+
prototype.secondary_pictures[i]
165+
and prototype.secondary_pictures[i].layers
166+
and prototype.secondary_pictures[i].layers[1]
167+
and prototype.secondary_pictures[i].layers[1].filename
168+
== "__base__/graphics/entity/acid-splash/acid-splash-" .. i .. ".png"
169+
then
170+
-- 0.7 Source: __base__/prototypes/entity/enemy-constants.lua#L145
171+
prototype.secondary_pictures[i].layers[1].tint = util.multiply_color(color, 0.7)
172+
end
173+
end
174+
end
175+
end
176+
end
177+
color = config("acid-stream-color") --[[@as Color]]
178+
if color and not color_equals(color, BaseDefaultColors["acid-stream"]) then
179+
for _, prototype in pairs(data.raw["stream"]) do
180+
if
181+
prototype.particle
182+
and prototype.particle
183+
and prototype.particle.filename == "__base__/graphics/entity/acid-projectile/acid-projectile-head.png"
184+
then
185+
prototype.particle.tint = color
186+
end
187+
if
188+
prototype.spine_animation
189+
and prototype.spine_animation
190+
and prototype.spine_animation.filename == "__base__/graphics/entity/acid-projectile/acid-projectile-tail.png"
191+
then
192+
prototype.spine_animation.tint = color
193+
end
194+
end
195+
end
196+
color = config("acid-sticker-color") --[[@as Color]]
197+
if color and not color_equals(color, BaseDefaultColors["acid-sticker"]) then
198+
for _, prototype in pairs(data.raw["sticker"]) do
199+
if
200+
prototype.animation
201+
and prototype.animation
202+
and prototype.animation.filename == "__base__/graphics/entity/acid-sticker/acid-sticker.png"
203+
then
204+
prototype.animation.tint = color
205+
end
206+
end
207+
end

data/base/settings.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,17 @@ add_color_setting(
9292
BaseDefaultColors["mining-drill-visualization"],
9393
{ "", { "description.mining-area" }, " ", { "description.range" }, " ", { "gui-interface-settings.visualization" } }
9494
)
95+
96+
add_color_setting("acid-splash", "sticker", BaseDefaultColors["acid-splash"], { "", { "entity-name.acid-splash" } })
97+
add_color_setting(
98+
"acid-stream",
99+
"sticker",
100+
BaseDefaultColors["acid-stream"],
101+
{ "", { "entity-name.acid-splash" }, " stream" }
102+
)
103+
add_color_setting(
104+
"acid-sticker",
105+
"sticker",
106+
BaseDefaultColors["acid-sticker"],
107+
{ "", { "entity-name.acid-splash" }, " sticker" }
108+
)

0 commit comments

Comments
 (0)