Store window info for future work
This commit is contained in:
parent
7246249c52
commit
d5df9f6f0f
|
@ -739,6 +739,7 @@ local _ = {
|
||||||
check_privs = core.check_player_privs,
|
check_privs = core.check_player_privs,
|
||||||
get_player_by_name = core.get_player_by_name,
|
get_player_by_name = core.get_player_by_name,
|
||||||
get_connected_players = core.get_connected_players,
|
get_connected_players = core.get_connected_players,
|
||||||
|
get_window_info = core.get_player_window_information,
|
||||||
|
|
||||||
-- Inventory
|
-- Inventory
|
||||||
get_stack = get_stack,
|
get_stack = get_stack,
|
||||||
|
|
|
@ -462,7 +462,6 @@ core.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
rcp_fields(player, data, fields)
|
rcp_fields(player, data, fields)
|
||||||
|
|
||||||
local tab = i3.tabs[data.tab]
|
local tab = i3.tabs[data.tab]
|
||||||
|
|
||||||
if tab then
|
if tab then
|
||||||
if tab.slots then
|
if tab.slots then
|
||||||
inv_fields(player, data, fields)
|
inv_fields(player, data, fields)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
IMPORT("ceil", "get_connected_players", "str_to_pos", "add_hud_waypoint")
|
IMPORT("ceil", "get_connected_players", "str_to_pos", "add_hud_waypoint", "get_window_info")
|
||||||
|
|
||||||
local function init_hud(player)
|
local function init_hud(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
|
@ -118,6 +118,8 @@ core.register_globalstep(function(dt)
|
||||||
local data = i3.data[name]
|
local data = i3.data[name]
|
||||||
if not data then return end
|
if not data then return end
|
||||||
|
|
||||||
|
data.window = get_window_info and get_window_info(name) or nil
|
||||||
|
|
||||||
if data.show_hud ~= nil then
|
if data.show_hud ~= nil then
|
||||||
show_hud(player, data)
|
show_hud(player, data)
|
||||||
end
|
end
|
||||||
|
|
Ŝarĝante…
Reference in New Issue