mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-05-01 10:09:20 +02:00
35 lines
626 B
Lua
35 lines
626 B
Lua
ui = nil
|
|
updateEvent = nil
|
|
|
|
function init()
|
|
ui = g_ui.loadUI('stats', modules.game_interface.getMapPanel())
|
|
|
|
if not modules.client_options.getOption("showFps") then
|
|
ui.fps:hide()
|
|
end
|
|
if not modules.client_options.getOption("showPing") then
|
|
ui.ping:hide()
|
|
end
|
|
|
|
updateEvent = scheduleEvent(update, 200)
|
|
end
|
|
|
|
function terminate()
|
|
removeEvent(updateEvent)
|
|
end
|
|
|
|
function update()
|
|
updateEvent = scheduleEvent(update, 500)
|
|
if ui:isHidden() then return end
|
|
|
|
text = 'FPS: ' .. g_app.getFps()
|
|
ui.fps:setText(text)
|
|
end
|
|
|
|
function show()
|
|
ui:setVisible(true)
|
|
end
|
|
|
|
function hide()
|
|
ui:setVisible(false)
|
|
end |