From e2e2927fe87b0da2844c29d266b62aea6a2d48c4 Mon Sep 17 00:00:00 2001 From: Alexander Weber Date: Mon, 24 Jul 2017 17:39:16 +0200 Subject: moved character_1 to character for overriding the default character --- init.lua | 2 +- meta/character.txt | 3 +++ meta/character_1.txt | 3 --- meta/readme.txt | 2 +- skinlist.lua | 12 +++++++++--- textures/character.png | Bin 0 -> 1778 bytes textures/character_1.png | Bin 1778 -> 0 bytes textures/character_1_preview.png | Bin 783 -> 0 bytes textures/character_preview.png | Bin 0 -> 783 bytes 9 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 meta/character.txt delete mode 100644 meta/character_1.txt create mode 100644 textures/character.png delete mode 100644 textures/character_1.png delete mode 100644 textures/character_1_preview.png create mode 100644 textures/character_preview.png diff --git a/init.lua b/init.lua index 105a68a..325aa94 100644 --- a/init.lua +++ b/init.lua @@ -7,7 +7,7 @@ skins = {} skins.modpath = minetest.get_modpath(minetest.get_current_modname()) -skins.default = "character_1" +skins.default = "character" dofile(skins.modpath.."/skin_meta_api.lua") dofile(skins.modpath.."/api.lua") diff --git a/meta/character.txt b/meta/character.txt new file mode 100644 index 0000000..b4599e6 --- /dev/null +++ b/meta/character.txt @@ -0,0 +1,3 @@ +Sam 0 +Jordach +CC BY-SA 3.0 diff --git a/meta/character_1.txt b/meta/character_1.txt deleted file mode 100644 index b4599e6..0000000 --- a/meta/character_1.txt +++ /dev/null @@ -1,3 +0,0 @@ -Sam 0 -Jordach -CC BY-SA 3.0 diff --git a/meta/readme.txt b/meta/readme.txt index d91806f..77882e9 100644 --- a/meta/readme.txt +++ b/meta/readme.txt @@ -1,4 +1,4 @@ -For each skin in textures folder a metadata file can be applied with "txt" suffilx. See character_1.txt for skin character_1.png for reference. +For each skin in textures folder a metadata file can be applied with "txt" suffilx. See character.txt for skin character.png for reference. The file contains: Skin name Author diff --git a/skinlist.lua b/skinlist.lua index e1be623..5d29fe4 100644 --- a/skinlist.lua +++ b/skinlist.lua @@ -6,9 +6,15 @@ for _, fn in pairs(skins_dir_list) do local name, sort_id, assignment, is_preview if nameparts[1] == "character" then - sort_id = tonumber(nameparts[2])+5000 - name = "character_"..nameparts[2] - is_preview = (nameparts[3] == "preview") + if tonumber(nameparts[2]) == nil then --default skin character.png + sort_id = 5000 + name = "character" + is_preview = (nameparts[2] == "preview") + else + sort_id = tonumber(nameparts[2])+5000 + name = "character_"..nameparts[2] + is_preview = (nameparts[3] == "preview") + end elseif nameparts[1] == "player" then assignment = "player:"..nameparts[2] name = "player_"..nameparts[2] diff --git a/textures/character.png b/textures/character.png new file mode 100644 index 0000000..24d794a Binary files /dev/null and b/textures/character.png differ diff --git a/textures/character_1.png b/textures/character_1.png deleted file mode 100644 index 24d794a..0000000 Binary files a/textures/character_1.png and /dev/null differ diff --git a/textures/character_1_preview.png b/textures/character_1_preview.png deleted file mode 100644 index 62a9ff2..0000000 Binary files a/textures/character_1_preview.png and /dev/null differ diff --git a/textures/character_preview.png b/textures/character_preview.png new file mode 100644 index 0000000..62a9ff2 Binary files /dev/null and b/textures/character_preview.png differ -- cgit v1.2.3