mirror of
https://github.com/minetest-mods/skinsdb.git
synced 2024-12-23 07:50:18 +01:00
hide paging if 1 page only
This commit is contained in:
parent
e2e2927fe8
commit
7791ac7fdf
@ -54,6 +54,8 @@ local function get_formspec(player, context)
|
||||
skin:get_preview()..";skins_set$"..i..";]"..
|
||||
"tooltip[skins_set$"..i..";"..minetest.formspec_escape(skin:get_meta_string("name")).."]"
|
||||
end
|
||||
|
||||
if context.total_pages > 1 then
|
||||
local page_prev = page - 1
|
||||
local page_next = page + 1
|
||||
if page_prev < 1 then
|
||||
@ -74,7 +76,7 @@ local function get_formspec(player, context)
|
||||
.."button[0,8.3;1,.5;skins_page$"..page_prev..";<<]"
|
||||
.."dropdown[1,8.16;6.5,.5;skins_selpg;"..page_list..";"..page.."]"
|
||||
.."button[7,8.3;1,.5;skins_page$"..page_next..";>>]"
|
||||
|
||||
end
|
||||
return formspec
|
||||
end
|
||||
|
||||
|
@ -71,6 +71,7 @@ for page=1, total_pages do
|
||||
skin:get_preview()..";skins_set$"..i..";]"..
|
||||
"tooltip[skins_set$"..i..";"..minetest.formspec_escape(skin:get_meta_string("name")).."]")
|
||||
end
|
||||
if total_pages > 1 then
|
||||
local page_prev = page - 1
|
||||
local page_next = page + 1
|
||||
if page_prev < 1 then
|
||||
@ -91,6 +92,7 @@ for page=1, total_pages do
|
||||
.."button[0,3.8;1,.5;skins_page$"..page_prev..";<<]"
|
||||
.."dropdown[1,3.68;6.5,.5;skins_selpg;"..page_list..";"..page.."]"
|
||||
.."button[7,3.8;1,.5;skins_page$"..page_next..";>>]")
|
||||
end
|
||||
unified_inventory.register_page("skins_page$"..(page), {
|
||||
get_formspec = function(player)
|
||||
return {formspec=formspec}
|
||||
|
Loading…
Reference in New Issue
Block a user