mirror of
https://github.com/minetest-mods/skinsdb.git
synced 2025-01-09 07:30:17 +01:00
Add default; do not use character.x
This commit is contained in:
parent
29332b7cf3
commit
7c25df22dc
@ -5,6 +5,7 @@
|
||||
u_skins = {}
|
||||
u_skins.modpath = minetest.get_modpath("u_skins")
|
||||
u_skins.file = minetest.get_worldpath().."/u_skins.mt"
|
||||
u_skins.default = "character_1"
|
||||
u_skins.pages = {}
|
||||
u_skins.u_skins = {}
|
||||
u_skins.file_save = false
|
||||
@ -35,13 +36,10 @@ dofile(u_skins.modpath.."/players.lua")
|
||||
u_skins.update_player_skin = function(player)
|
||||
local name = player:get_player_name()
|
||||
if not u_skins.is_skin(u_skins.u_skins[name]) then
|
||||
u_skins.u_skins[name] = "character_1"
|
||||
u_skins.u_skins[name] = u_skins.default
|
||||
end
|
||||
player:set_properties({
|
||||
visual = "mesh",
|
||||
mesh = "character.x",
|
||||
textures = {u_skins.u_skins[name]..".png"},
|
||||
visual_size = {x=1, y=1},
|
||||
})
|
||||
u_skins.file_save = true
|
||||
end
|
||||
@ -51,7 +49,7 @@ unified_inventory.register_page("u_skins", {
|
||||
get_formspec = function(player)
|
||||
local name = player:get_player_name()
|
||||
if not u_skins.is_skin(u_skins.u_skins[name]) then
|
||||
u_skins.u_skins[name] = "character_1"
|
||||
u_skins.u_skins[name] = u_skins.default
|
||||
end
|
||||
|
||||
local formspec = ("background[0.06,0.99;7.92,7.52;ui_misc_form.png]"
|
||||
@ -158,7 +156,7 @@ end)
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local player_name = player:get_player_name()
|
||||
if not u_skins.is_skin(u_skins.u_skins[player_name]) then
|
||||
u_skins.u_skins[player_name] = "character_1"
|
||||
u_skins.u_skins[player_name] = u_skins.default
|
||||
end
|
||||
u_skins.update_player_skin(player)
|
||||
end)
|
||||
|
@ -30,7 +30,7 @@ u_skins.save = function()
|
||||
local output = io.open(u_skins.file, "w")
|
||||
for name, skin in pairs(u_skins.u_skins) do
|
||||
if name and skin then
|
||||
if skin ~= "character_1" then
|
||||
if skin ~= u_skins.default then
|
||||
output:write(name.." "..skin.."\n")
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user