1
0
mirror of https://github.com/SmallJoker/minetest-u_skinsdb.git synced 2025-06-30 07:01:01 +02:00

Version MFF.

This commit is contained in:
sys4-fr
2018-09-08 23:10:14 +02:00
parent 71bebbeb09
commit f0d5f20a3a
166 changed files with 290 additions and 162 deletions

15
u_skins/init.lua Normal file → Executable file
View File

@ -51,12 +51,12 @@ unified_inventory.register_page("u_skins", {
if not u_skins.is_skin(u_skins.u_skins[name]) then
u_skins.u_skins[name] = u_skins.default
end
local formspec = ("background[0.06,0.99;7.92,7.52;ui_misc_form.png]"
.."image[0,.75;1,2;"..u_skins.u_skins[name].."_preview.png]"
.."label[6,.5;Raw texture:]"
.."image[6,1;2,1;"..u_skins.u_skins[name]..".png]")
local meta = u_skins.meta[u_skins.u_skins[name]]
if meta then
if meta.name ~= "" then
@ -84,6 +84,8 @@ unified_inventory.register_page("u_skins", {
unified_inventory.register_button("u_skins", {
type = "image",
image = "u_skins_button.png",
tooltip = "Skin inventory",
show_with = false, -- modif MFF (Crabman 30/06/2015)
})
-- Create all of the skin-picker pages.
@ -109,8 +111,9 @@ u_skins.generate_pages = function(texture)
if i > 1 and x == 0 then
y = 1.8
end
formspec = (formspec.."image_button["..x..","..y..";1,2;"
..skin[2].."_preview.png;u_skins_set$"..skin[1]..";]")
formspec = (formspec.."image_button["..x..","..y..";1,2;"..
skin[2].."_preview.png;u_skins_set$"..skin[1]..";]"..
"tooltip[u_skins_set$"..skin[1]..";"..u_skins.meta[skin[2]].name.."]")
end
local page_prev = page - 2
local page_next = page
@ -124,7 +127,7 @@ u_skins.generate_pages = function(texture)
.."button[0,3.8;1,.5;u_skins_page$"..page_prev..";<<]"
.."button[.75,3.8;6.5,.5;u_skins_null;Page "..page.."/"..total_pages.."]"
.."button[7,3.8;1,.5;u_skins_page$"..page_next..";>>]")
unified_inventory.register_page("u_skins_page$"..(page - 1), {
get_formspec = function(player)
return {formspec=formspec}
@ -162,4 +165,4 @@ minetest.register_on_joinplayer(function(player)
end)
u_skins.generate_pages()
u_skins.load_players()
u_skins.load_players()