Use simple_skins if default selected
This commit is contained in:
parent
5cb484e251
commit
e762283dec
@ -1,2 +1,3 @@
|
|||||||
unified_inventory
|
unified_inventory
|
||||||
default
|
default
|
||||||
|
simple_skins?
|
@ -9,6 +9,7 @@ u_skins.default = "character_1"
|
|||||||
u_skins.pages = {}
|
u_skins.pages = {}
|
||||||
u_skins.u_skins = {}
|
u_skins.u_skins = {}
|
||||||
u_skins.file_save = false
|
u_skins.file_save = false
|
||||||
|
u_skins.simple_skins = false
|
||||||
|
|
||||||
-- ( Deprecated
|
-- ( Deprecated
|
||||||
u_skins.type = { SPRITE=0, MODEL=1, ERROR=99 }
|
u_skins.type = { SPRITE=0, MODEL=1, ERROR=99 }
|
||||||
@ -33,15 +34,22 @@ end
|
|||||||
dofile(u_skins.modpath.."/skinlist.lua")
|
dofile(u_skins.modpath.."/skinlist.lua")
|
||||||
dofile(u_skins.modpath.."/players.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)
|
u_skins.update_player_skin = function(player)
|
||||||
local name = player:get_player_name()
|
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
|
if not u_skins.is_skin(u_skins.u_skins[name]) then
|
||||||
u_skins.u_skins[name] = u_skins.default
|
u_skins.u_skins[name] = u_skins.default
|
||||||
end
|
end
|
||||||
player:set_properties({
|
player:set_properties({
|
||||||
textures = {u_skins.u_skins[name]..".png"},
|
textures = {u_skins.u_skins[name]..".png"},
|
||||||
})
|
})
|
||||||
u_skins.file_save = true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Display Current Skin
|
-- Display Current Skin
|
||||||
@ -145,6 +153,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
if current[1] == "u_skins_set" then
|
if current[1] == "u_skins_set" then
|
||||||
u_skins.u_skins[player:get_player_name()] = u_skins.list[tonumber(current[2])]
|
u_skins.u_skins[player:get_player_name()] = u_skins.list[tonumber(current[2])]
|
||||||
u_skins.update_player_skin(player)
|
u_skins.update_player_skin(player)
|
||||||
|
u_skins.file_save = true
|
||||||
unified_inventory.set_inventory_formspec(player, "u_skins")
|
unified_inventory.set_inventory_formspec(player, "u_skins")
|
||||||
elseif current[1] == "u_skins_page" then
|
elseif current[1] == "u_skins_page" then
|
||||||
u_skins.pages[player:get_player_name()] = current[2]
|
u_skins.pages[player:get_player_name()] = current[2]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user