Fix in-course timer (how did this not get committed)

This commit is contained in:
LostTrackpad 2024-08-07 19:55:39 +07:00
parent fd07e344d8
commit 2d9eef6d8a

View file

@ -241,14 +241,6 @@ function CourseHUD()
local incourse = Course_Name ~= ""
local totaltime = CheckpointNumber ~= -1 and math.max(0, CurTime() - Course_StartTime) or Course_EndTime
if incourse then
local text = string.FormattedTime(totaltime, "%02i:%02i:%02i")
local w, _ = surface.GetTextSize(text)
surface.SetFont("BeatrunHUD")
surface.SetTextPos(ScrW() * 0.85 - w * 0.5 + vpx, ScrH() * 0.075 + vpz)
surface.DrawText(text)
end
if GetConVar("Beatrun_ShowSpeedometer"):GetBool() then
local speed = math.Round(ply:GetVelocity():Length2D() * 0.06858125)
@ -308,12 +300,20 @@ function CourseHUD()
end
end
if incourse then
local text = string.FormattedTime(totaltime, "%02i:%02i:%02i")
local w, _ = surface.GetTextSize(text)
surface.SetFont("BeatrunHUD")
surface.SetTextPos(ScrW() * 0.87 - w + vpx, ScrH() * 0.075 + vpz)
surface.DrawText(text)
end
if incourse and pbtimes then
local text = string.FormattedTime(pbtotal, "%02i:%02i:%02i")
local w, h = surface.GetTextSize(text)
surface.SetFont("BeatrunHUD")
surface.SetTextPos(ScrW() * 0.85 - w * 0.5 + vpx, ScrH() * 0.075 + h + vpz)
surface.SetTextPos(ScrW() * 0.87 - w + vpx, ScrH() * 0.075 + h + vpz)
surface.SetTextColor(255, 255, 255, 125)
surface.DrawText(text)
end