summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--u_skins/depends.txt1
-rw-r--r--u_skins/init.lua11
2 files changed, 11 insertions, 1 deletions
diff --git a/u_skins/depends.txt b/u_skins/depends.txt
index 4b9cd19..050b422 100644
--- a/u_skins/depends.txt
+++ b/u_skins/depends.txt
@@ -1,2 +1,3 @@
unified_inventory
default
+simple_skins? \ No newline at end of file
diff --git a/u_skins/init.lua b/u_skins/init.lua
index 1673954..bd223a2 100644
--- a/u_skins/init.lua
+++ b/u_skins/init.lua
@@ -9,6 +9,7 @@ u_skins.default = "character_1"
u_skins.pages = {}
u_skins.u_skins = {}
u_skins.file_save = false
+u_skins.simple_skins = false
-- ( Deprecated
u_skins.type = { SPRITE=0, MODEL=1, ERROR=99 }
@@ -33,15 +34,22 @@ end
dofile(u_skins.modpath.."/skinlist.lua")
dofile(u_skins.modpath.."/players.lua")
+if rawget(_G, "skins") then
+ u_skins.simple_skins = true
+end
+
u_skins.update_player_skin = function(player)
local name = player:get_player_name()
+ if u_skins.simple_skins and u_skins.u_skins[name] == u_skins.default then
+ return
+ end
+
if not u_skins.is_skin(u_skins.u_skins[name]) then
u_skins.u_skins[name] = u_skins.default
end
player:set_properties({
textures = {u_skins.u_skins[name]..".png"},
})
- u_skins.file_save = true
end
-- Display Current Skin
@@ -145,6 +153,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if current[1] == "u_skins_set" then
u_skins.u_skins[player:get_player_name()] = u_skins.list[tonumber(current[2])]
u_skins.update_player_skin(player)
+ u_skins.file_save = true
unified_inventory.set_inventory_formspec(player, "u_skins")
elseif current[1] == "u_skins_page" then
u_skins.pages[player:get_player_name()] = current[2]