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

@ -2,7 +2,7 @@ local skins_dir_list = minetest.get_dir_list(skins.modpath.."/textures")
for _, fn in pairs(skins_dir_list) do
local name, sort_id, is_preview, playername
local nameparts = string.gsub(fn, "[.]", "_"):split("_")
local nameparts = string.gsub(fn, "[.]", skins.fsep):split(skins.fsep)
-- check allowed prefix and file extension
if (nameparts[1] == 'player' or nameparts[1] == 'character') and