diff --git a/scripts/result.lua b/scripts/result.lua index 260be56..b3b0274 100644 --- a/scripts/result.lua +++ b/scripts/result.lua @@ -103,6 +103,8 @@ local objectTypeTimingStats = { vol = {criticals = 0, errors = 0} } +local irHeartbeatRequested = false; +local irText = '' game.LoadSkinSample("result") @@ -335,6 +337,10 @@ local drawBottomPanelContent = function (deltatime) -- Draw volforce VolforceWindow.render(0, bottomPanelX+310, bottomPanelY+355) + + -- Draw IR text + gfx.FontSize(22) + gfx.Text(irText, bottomPanelX+80, bottomPanelY+461); end local drawJacketPanel = function() @@ -357,6 +363,21 @@ local drawJacketPanelContent = function() gfx.Text(result.level, jacketPanelX+270, jacketPanelY+14.5); end +local IR_HeartbeatResponse = function(res) + if res.statusCode == IRData.States.Success then + irText = res.body.serverName .. ' ' .. res.body.irVersion; + else + game.Log("Can't connect to IR!", game.LOGGER_WARNING) + end +end + +local IR_Handle = function() + if not irHeartbeatRequested then + IR.Heartbeat(IR_HeartbeatResponse) + irHeartbeatRequested = true; + end +end + local tickTransitions = function(deltaTime) if transitionEnterScale < 1 then @@ -478,7 +499,8 @@ render = function(deltaTime, showStats) Footer.draw(); - handleSfx() + handleSfx(); + IR_Handle(); -- debug gfx.FontSize(18)