mirror of
https://github.com/minetest-mods/i3.git
synced 2024-12-25 02:10:39 +01:00
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,
|
||||
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,
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user