1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-28 04:40:22 +02:00

Add sfinv.get_page()

This commit is contained in:
rubenwardy
2018-11-28 14:14:33 +00:00
committed by GitHub
parent 068e0b167f
commit 1fa8180e7f
2 changed files with 6 additions and 0 deletions

View File

@ -135,6 +135,11 @@ function sfinv.set_page(player, pagename)
sfinv.set_player_inventory_formspec(player, context)
end
function sfinv.get_page(player)
local context = sfinv.contexts[player:get_player_name()]
return context and context.page or sfinv.get_homepage_name(player)
end
minetest.register_on_joinplayer(function(player)
if sfinv.enabled then
sfinv.set_player_inventory_formspec(player)