PlayerInventory & PlayerInventoryUI: Fixed inventory state saving
This commit is contained in:
@@ -99,6 +99,7 @@ PlayerInventoryUI:registerOnFormFieldAction('close_left_pane', function(player,
|
||||
local playerName = player:get_player_name()
|
||||
|
||||
PlayerInventoryUI:setContex(playerName, 'left_pane_name', 'select_pane_menu')
|
||||
player:set_inventory_formspec(PlayerInventoryUI:getFormSpecString(playerName))
|
||||
PlayerInventoryUI:showForm(playerName)
|
||||
end)
|
||||
|
||||
@@ -109,16 +110,16 @@ PlayerInventoryUI:registerOnFormFieldActionMatch('select_left_%S+', function(pla
|
||||
local playerName = player:get_player_name()
|
||||
|
||||
PlayerInventoryUI:setContex(playerName, 'left_pane_name', paneName)
|
||||
PlayerInventoryUI:showForm(playerName)
|
||||
player:set_inventory_formspec(PlayerInventoryUI:getFormSpecString(playerName))
|
||||
PlayerInventoryUI:showForm(playerName)
|
||||
end)
|
||||
|
||||
PlayerInventoryUI:registerOnFormFieldAction('close_right_pane', function(player, fieldName, fieldValue)
|
||||
local playerName = player:get_player_name()
|
||||
|
||||
PlayerInventoryUI:setContex(playerName, 'right_pane_name', 'select_pane_menu')
|
||||
PlayerInventoryUI:showForm(playerName)
|
||||
player:set_inventory_formspec(PlayerInventoryUI:getFormSpecString(playerName))
|
||||
PlayerInventoryUI:showForm(playerName)
|
||||
end)
|
||||
|
||||
PlayerInventoryUI:registerOnFormFieldActionMatch('select_right_%S+', function(player, fieldName, fieldValue)
|
||||
@@ -128,8 +129,8 @@ PlayerInventoryUI:registerOnFormFieldActionMatch('select_right_%S+', function(pl
|
||||
local playerName = player:get_player_name()
|
||||
|
||||
PlayerInventoryUI:setContex(playerName, 'right_pane_name', paneName)
|
||||
PlayerInventoryUI:showForm(playerName)
|
||||
player:set_inventory_formspec(PlayerInventoryUI:getFormSpecString(playerName))
|
||||
PlayerInventoryUI:showForm(playerName)
|
||||
end)
|
||||
|
||||
PlayerInventoryUI:registerOnFormFieldActionMatch('%S+::page_back', function(player, fieldName, fieldValue)
|
||||
@@ -145,8 +146,8 @@ PlayerInventoryUI:registerOnFormFieldActionMatch('%S+::page_back', function(play
|
||||
end
|
||||
|
||||
PlayerInventoryUI:setContex(playerName, paneType..'_pane_craft_page_number', pageNumber)
|
||||
PlayerInventoryUI:showForm(playerName)
|
||||
player:set_inventory_formspec(PlayerInventoryUI:getFormSpecString(playerName))
|
||||
PlayerInventoryUI:showForm(playerName)
|
||||
end)
|
||||
|
||||
PlayerInventoryUI:registerOnFormFieldActionMatch('%S+::page_forward', function(player, fieldName, fieldValue)
|
||||
@@ -162,8 +163,8 @@ PlayerInventoryUI:registerOnFormFieldActionMatch('%S+::page_forward', function(p
|
||||
end
|
||||
|
||||
PlayerInventoryUI:setContex(playerName, paneType..'_pane_craft_page_number', pageNumber)
|
||||
PlayerInventoryUI:showForm(playerName)
|
||||
player:set_inventory_formspec(PlayerInventoryUI:getFormSpecString(playerName))
|
||||
PlayerInventoryUI:showForm(playerName)
|
||||
end)
|
||||
|
||||
return PlayerInventoryUI
|
||||
|
||||
Reference in New Issue
Block a user