Get window info once per second
This commit is contained in:
parent
d5df9f6f0f
commit
b7308b4739
|
@ -468,7 +468,8 @@ core.register_on_player_receive_fields(function(player, formname, fields)
|
|||
end
|
||||
|
||||
if tab.fields then
|
||||
tab.fields(player, data, fields)
|
||||
local ret = tab.fields(player, data, fields)
|
||||
if ret == false then return end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -118,7 +118,12 @@ core.register_globalstep(function(dt)
|
|||
local data = i3.data[name]
|
||||
if not data then return end
|
||||
|
||||
data.window_timer = (data.window_timer or 0) + dt
|
||||
|
||||
if data.window_timer > 1 then
|
||||
data.window_timer = 0
|
||||
data.window = get_window_info and get_window_info(name) or nil
|
||||
end
|
||||
|
||||
if data.show_hud ~= nil then
|
||||
show_hud(player, data)
|
||||
|
|
Ŝarĝante…
Reference in New Issue