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