+ crew and ir hb support to challenge result

This commit is contained in:
FajsiEx 2021-08-18 20:22:57 +02:00
parent a921a962b8
commit 8aac86be15
1 changed files with 28 additions and 1 deletions

View File

@ -21,8 +21,10 @@ local headerTitleImage = gfx.CreateSkinImage("challenge_result/header/title.png"
local username = game.GetSkinSetting('username'); local username = game.GetSkinSetting('username');
local appealCardImage = gfx.CreateSkinImage("appeal_card.png", 0); local appealCardImage = gfx.CreateSkinImage("appeal_card.png", 0);
local danBadgeImage = gfx.CreateSkinImage("dan/inf.png", 0); local danBadgeImage = gfx.CreateSkinImage("dan/inf.png", 0);
local crewImage = gfx.CreateSkinImage("crew in game/near noah vw.png", 0);
local irHeartbeatRequested = false;
local IRserverName = '';
function resetLayoutInformation() function resetLayoutInformation()
resx, resy = game.GetResolution() resx, resy = game.GetResolution()
@ -47,6 +49,10 @@ function drawHeader()
end end
function drawPlayerInfo() function drawPlayerInfo()
-- Draw crew
gfx.BeginPath()
gfx.ImageRect(460, 215, 522, 362, crewImage, 1, 0);
-- Draw the info bg -- Draw the info bg
gfx.BeginPath() gfx.BeginPath()
gfx.ImageRect(300, 352, 374*0.85, 222*0.85, playerInfoOverlayBgImage, 1, 0); gfx.ImageRect(300, 352, 374*0.85, 222*0.85, playerInfoOverlayBgImage, 1, 0);
@ -65,16 +71,37 @@ function drawPlayerInfo()
gfx.FontSize(40) gfx.FontSize(40)
gfx.Text(username, 310, 413); gfx.Text(username, 310, 413);
-- Draw IR server name
gfx.FontSize(28)
gfx.Text(IRserverName, 310, 453);
-- Draw dan badge -- Draw dan badge
gfx.BeginPath(); gfx.BeginPath();
gfx.ImageRect(311, 490, 107*1.25, 29*1.25, danBadgeImage, 1, 0); gfx.ImageRect(311, 490, 107*1.25, 29*1.25, danBadgeImage, 1, 0);
end end
local IR_HeartbeatResponse = function(res)
if res.statusCode == IRData.States.Success then
IRserverName = 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
function render(deltaTime) function render(deltaTime)
gfx.ResetTransform(); gfx.ResetTransform();
resetLayoutInformation(); resetLayoutInformation();
gfx.Scale(scale,scale); gfx.Scale(scale,scale);
IR_Handle()
drawBackground() drawBackground()
drawPlayerInfo() drawPlayerInfo()