initial commit
This commit is contained in:
commit
8a006de576
3 changed files with 34 additions and 0 deletions
22
scripts/replace_sprites.lua
Normal file
22
scripts/replace_sprites.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
local function replace_sprite_filenames(t)
|
||||
if type(t) == "table" then
|
||||
for key, value in pairs(t) do
|
||||
if key == "filename" and type(value) == "string" then
|
||||
-- Extract the base filename (assumes the original filenames are in some folder)
|
||||
local base_filename = value:match("([^/\\]+)$")
|
||||
-- Construct your new path using the new mod name
|
||||
t[key] = "__factorio_high_contrast_mod__/graphics/" .. base_filename
|
||||
else
|
||||
replace_sprite_filenames(value)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Iterate over all prototypes in data.raw
|
||||
for type_name, prototypes in pairs(data.raw) do
|
||||
for _, prototype in pairs(prototypes) do
|
||||
replace_sprite_filenames(prototype)
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue