From d5df9f6f0f778caa785417206804b9ad38d74ff7 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Tue, 7 Mar 2023 14:07:52 +0100 Subject: [PATCH] Store window info for future work --- src/common.lua | 1 + src/fields.lua | 1 - src/hud.lua | 4 +++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common.lua b/src/common.lua index 16f1fec..a53de09 100644 --- a/src/common.lua +++ b/src/common.lua @@ -739,6 +739,7 @@ local _ = { check_privs = core.check_player_privs, get_player_by_name = core.get_player_by_name, get_connected_players = core.get_connected_players, + get_window_info = core.get_player_window_information, -- Inventory get_stack = get_stack, diff --git a/src/fields.lua b/src/fields.lua index a00f484..86d81dd 100644 --- a/src/fields.lua +++ b/src/fields.lua @@ -462,7 +462,6 @@ core.register_on_player_receive_fields(function(player, formname, fields) rcp_fields(player, data, fields) local tab = i3.tabs[data.tab] - if tab then if tab.slots then inv_fields(player, data, fields) diff --git a/src/hud.lua b/src/hud.lua index 5bb0951..6f6841c 100644 --- a/src/hud.lua +++ b/src/hud.lua @@ -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 name = player:get_player_name() @@ -118,6 +118,8 @@ core.register_globalstep(function(dt) local data = i3.data[name] if not data then return end + data.window = get_window_info and get_window_info(name) or nil + if data.show_hud ~= nil then show_hud(player, data) end