Filename seperator setting to fix #54 (#83)

Adds a filename split seperator setting that lets you choose between old style `_` and `.` because dot is the only char that isn´t allowed in playername but in texturenames.
Default value is `_` to keep it compatible with older versions, while `.` offers a solution to fix #54.
This commit is contained in:
blaboing
2023-05-10 21:41:35 +02:00
committed by GitHub
parent 1d1053dbc2
commit d3c7fa71c0
6 changed files with 30 additions and 5 deletions

View File

@ -88,7 +88,7 @@ local function safe_single_skin(skin)
skin.license
}
local name = "character_" .. skin.id
local name = "character" .. skins.fsep .. skin.id
-- core.safe_file_write does not work here
unsafe_file_write(
@ -101,7 +101,7 @@ local function safe_single_skin(skin)
core.decode_base64(skin.img)
)
fetch_url(preview_url:format(skin.id), function(preview)
unsafe_file_write(skins_path .. name .. "_preview.png", preview)
unsafe_file_write(skins_path .. name .. skins.fsep .. "preview.png", preview)
end)
core.log("action", ("%s: Completed skin %s"):format(_ID_, name))
end