Skip to content

Commit

Permalink
fixed disabling; display correct rounds left
Browse files Browse the repository at this point in the history
  • Loading branch information
TimGoll committed Sep 28, 2024
1 parent 8bee53a commit be920de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gamemodes/terrortown/gamemode/client/vgui/cl_sb_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function PANEL:Init()
if gameloop.HasLevelLimits() then
local r, t = gameloop.UntilMapChange()

sf:SetText(GetPTranslation("sb_mapchange", { num = r, time = t }))
sf:SetText(GetPTranslation("sb_mapchange", { num = r + 1, time = t }))
else
sf:SetText(GetTranslation("sb_mapchange_disabled"))
end
Expand Down
12 changes: 9 additions & 3 deletions lua/ttt2/libraries/loadingscreen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ function loadingscreen.End()
end

if SERVER then
local duration = loadingscreen.timeBegin - SysTime() + loadingscreen.GetDuration()
local duration = (loadingscreen.timeBegin or SysTime())
- SysTime()
+ loadingscreen.GetDuration()

-- this timer makes sure the loading screen is displayed for at least the
-- time that is set as the minimum time
Expand Down Expand Up @@ -103,7 +105,11 @@ if SERVER then
-- @return number The minimum time
-- @realm server
function loadingscreen.GetDuration()
return cvLoadingScreenMinDuration:GetFloat()
if cvLoadingScreenEnabled:GetBool() then
return cvLoadingScreenMinDuration:GetFloat()
else
return 0
end
end
end

Expand Down Expand Up @@ -229,7 +235,7 @@ if CLIENT then

text = LANG.GetParamTranslation(
"loadingscreen_round_restart_subtitle_limits",
{ map = game.GetMap(), rounds = roundsLeft, time = timeLeft }
{ map = game.GetMap(), rounds = roundsLeft + 1, time = timeLeft }
)
else
text = LANG.TryTranslation("loadingscreen_round_restart_subtitle")
Expand Down
2 changes: 1 addition & 1 deletion lua/ttt2/libraries/tips.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function tips.Initialize()
tips.Register("tip31")
tips.Register("tip32")
tips.Register("tip33")
tips.Register("tip34", { helpkey = Key("+gm_showhelp", "F1") })
tips.Register("tip34")
tips.Register("tip35")
tips.Register("tip36")
tips.Register("tip37")
Expand Down

0 comments on commit be920de

Please sign in to comment.