mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-29 21:33:02 +05:00
Fix in-course timer (how did this not get committed)
This commit is contained in:
parent
fd07e344d8
commit
2d9eef6d8a
1 changed files with 23 additions and 23 deletions
|
@ -241,14 +241,6 @@ function CourseHUD()
|
||||||
local incourse = Course_Name ~= ""
|
local incourse = Course_Name ~= ""
|
||||||
local totaltime = CheckpointNumber ~= -1 and math.max(0, CurTime() - Course_StartTime) or Course_EndTime
|
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
|
if GetConVar("Beatrun_ShowSpeedometer"):GetBool() then
|
||||||
local speed = math.Round(ply:GetVelocity():Length2D() * 0.06858125)
|
local speed = math.Round(ply:GetVelocity():Length2D() * 0.06858125)
|
||||||
|
|
||||||
|
@ -308,12 +300,20 @@ function CourseHUD()
|
||||||
end
|
end
|
||||||
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
|
if incourse and pbtimes then
|
||||||
local text = string.FormattedTime(pbtotal, "%02i:%02i:%02i")
|
local text = string.FormattedTime(pbtotal, "%02i:%02i:%02i")
|
||||||
local w, h = surface.GetTextSize(text)
|
local w, h = surface.GetTextSize(text)
|
||||||
|
|
||||||
surface.SetFont("BeatrunHUD")
|
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.SetTextColor(255, 255, 255, 125)
|
||||||
surface.DrawText(text)
|
surface.DrawText(text)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue