Skip to content
Browse files
Add sfinv.get_page()
  • Loading branch information
rubenwardy committed Nov 28, 2018
1 parent 068e0b1 commit 1fa8180e7fbc1f1470187b997ff9ecea188df0be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
@@ -569,6 +569,7 @@ sfinv API by its author:

* sfinv.set_page(player, pagename) - changes the page
* sfinv.get_page(player) - get the current page name. Will never return nil
* sfinv.get_homepage_name(player) - get the page name of the first page to show to a player
* sfinv.register_page(name, def) - register a page, see section below
* sfinv.override_page(name, def) - overrides fields of an page registered with register_page.
@@ -135,6 +135,11 @@ function sfinv.set_page(player, pagename)
sfinv.set_player_inventory_formspec(player, context)

function sfinv.get_page(player)
local context = sfinv.contexts[player:get_player_name()]
return context and or sfinv.get_homepage_name(player)

if sfinv.enabled then

0 comments on commit 1fa8180

Please sign in to comment.