Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gameloop: Split round and time #1710

Merged
merged 6 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Changed how Ammo is dropped; if drop should be from reserve ammo, now tries to drop a full ammo box instead of a full clip. (by @MrXonte)
- Updated `ttt_spec_prop_control` to be replicated across the server and client (by @NickCloudAT)
- With this, the KeyHelp feature also hides the PropSpec bind if PropSpec is disabled on the server
- Renamed `ttt_session_limits_enabled` to `ttt_session_limits_mode`, introducing a four-mode control (0-3) for managing how TTT2 ends a session. (by @NickCloudAT)
- Modes: 0 = No session limit, 1 = Default TTT, 2 = Only time limit, 3 = Only round limit

## [v0.14.0b](https://github.com/TTT-2/TTT2/tree/v0.14.0b) (2024-09-20)

Expand Down
9 changes: 7 additions & 2 deletions gamemodes/terrortown/gamemode/client/vgui/cl_sb_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,14 @@ function PANEL:Init()
if gameloop.HasLevelLimits() then
local r, t = gameloop.UntilMapChange()

sf:SetText(GetPTranslation("sb_mapchange", { num = r + 1, time = t }))
sf:SetText(
GetPTranslation(
"sb_mapchange_mode_" .. gameloop.GetLevelLimitsMode(),
{ num = r + 1, time = t }
)
)
else
sf:SetText(GetTranslation("sb_mapchange_disabled"))
sf:SetText(GetTranslation("sb_mapchange_mode_0"))
end

sf:SizeToContents()
Expand Down
4 changes: 2 additions & 2 deletions gamemodes/terrortown/gamemode/server/sv_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,9 @@ function GM:TTT2ModifyWinningAlives(alives) end
-- @hook
-- @realm server
function GM:TTT2LoadNextMap(nextmap, roundsLeft, timeLeft)
if roundsLeft <= 0 then
if roundsLeft == 0 then
LANG.Msg("limit_round", { mapname = nextmap })
elseif timeLeft <= 0 then
elseif timeLeft == 0 then
LANG.Msg("limit_time", { mapname = nextmap })
end

Expand Down
34 changes: 28 additions & 6 deletions lua/terrortown/lang/de.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ L.win_showreport = "Schauen wir uns den Rundenbericht die nächste(n) {num} Seku

L.limit_round = "Rundenlimit erreicht. Die nächste Map wird bald geladen."
L.limit_time = "Zeitlimit erreicht. Die nächste Map wird bald geladen."
L.limit_left = "{num} Runde(n) oder {time} Minute(n) verbleibend bis die Map gewechselt wird."
L.limit_left_session_mode_1 = "{num} Runde(n) oder {time} Minute(n) verbleibend bis die Map gewechselt wird."
L.limit_left_session_mode_2 = "{time} Minute(n) verbleibend bis die Map gewechselt wird."
L.limit_left_session_mode_3 = "{num} Runde(n) verbleibend bis die Map gewechselt wird."

-- Credit awards
L.credit_all = "Deinem Team wurde(n) {num} Ausrüstungspunkt(e) für eure Leistung gegeben."
Expand Down Expand Up @@ -167,8 +169,10 @@ L.quick_corpse_id = "{player}'s Leiche"

-- Scoreboard
L.sb_playing = "Du spielst auf..."
L.sb_mapchange = "Die Karte wechselt in {num} Runden oder in {time}"
L.sb_mapchange_disabled = "Das Sitzungslimit ist deaktiviert."
L.sb_mapchange_mode_0 = "Das Sitzungslimit ist deaktiviert."
L.sb_mapchange_mode_1 = "Die Karte wechselt in {num} Runden oder in {time}"
L.sb_mapchange_mode_2 = "Die Karte wechselt in {time}"
L.sb_mapchange_mode_3 = "Die Karte wechselt in {num} Runden"

L.sb_mia = "Vermisst"
L.sb_confirmed = "Definitiv tot"
Expand Down Expand Up @@ -1672,7 +1676,6 @@ L.label_round_limit = "Rundenlimit"
L.label_time_limit_minutes = "Spielzeitlimit"
L.label_nade_throw_during_prep = "Erlaube das Werfen von Granaten während der Vorbereitungszeit"
L.label_postround_dm = "Aktiviere Deathmatch nach Rundenende"
L.label_session_limits_enabled = "Aktiviere Sitzungs Limitierungen"
L.label_spectator_chat = "Aktiviere, dass Zuschauer mit jedem chatten können"
L.label_lastwords_chatprint = "Gib die letzten Worte im Chat aus, wenn der Spieler getötet wird, während er tippt"
L.label_identify_body_woconfirm = "Leichnam identifizieren, ohne die Schaltfläche 'Tod Bestätigen' drücken zu müssen"
Expand Down Expand Up @@ -2299,8 +2302,10 @@ L.label_voice_activation_mode_toggle_enabled = "Umschalten (Aktiviert zum Start)
--L.label_button_level_reset = "reset level"

--L.loadingscreen_round_restart_title = "Starting new round"
--L.loadingscreen_round_restart_subtitle = "you're playing on {map}"
--L.loadingscreen_round_restart_subtitle_limits = "you're playing on {map} for another {rounds} round(s) or {time}"
--L.loadingscreen_round_restart_subtitle_limits_mode_0 = "you're playing on {map}"
--L.loadingscreen_round_restart_subtitle_limits_mode_1 = "you're playing on {map} for another {rounds} round(s) or {time}"
--L.loadingscreen_round_restart_subtitle_limits_mode_2 = "you're playing on {map} for {time}"
--L.loadingscreen_round_restart_subtitle_limits_mode_3 = "you're playing on {map} for another {rounds} round(s)"

-- 2024-06-23
--L.header_roles_derandomize = "Role Derandomization"
Expand Down Expand Up @@ -2369,3 +2374,20 @@ L.label_voice_activation_mode_toggle_enabled = "Umschalten (Aktiviert zum Start)

-- 2024-11-27
--L.corpse_hint_without_confirm = "Press [{usekey}] to search."

-- 2025-01-05
--L.help_session_limits_mode = [[
--There are three different session limit modes you can choose from:
--
--mode 0: No session limits. TTT2 will not end the session and will not trigger a map change.
--
--mode 1: Default TTT2 mode. A map change will trigger if either the session time or session round count runs out.
--
--mode 2: Only time limit. A map change will only trigger if the session time runs out.
--
--mode 3: Only round limit. A map change will only trigger if the session round count runs out.]]
--L.label_session_limits_mode = "Set session limit mode"
--L.choice_session_limits_mode_0 = "mode 0: no session limits"
--L.choice_session_limits_mode_1 = "mode 1: time and round limit"
--L.choice_session_limits_mode_2 = "mode 2: only time limit"
--L.choice_session_limits_mode_3 = "mode 3: only round limit"
34 changes: 28 additions & 6 deletions lua/terrortown/lang/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ L.win_showreport = "Let's look at the round report for {num} seconds."

L.limit_round = "Round limit reached. The next map will load soon."
L.limit_time = "Time limit reached. The next map will load soon."
L.limit_left = "{num} round(s) or {time} minutes remaining before the map changes."
L.limit_left_session_mode_1 = "{num} round(s) or {time} minutes remaining before the map changes."
L.limit_left_session_mode_2 = "{time} minutes remaining before the map changes."
L.limit_left_session_mode_3 = "{num} round(s) remaining before the map changes."

-- Credit awards
L.credit_all = "Your team have been awarded {num} equipment credit(s) for your performance."
Expand Down Expand Up @@ -167,8 +169,10 @@ L.quick_corpse_id = "{player}'s corpse"

-- Scoreboard
L.sb_playing = "You are playing on..."
L.sb_mapchange = "Map changes in {num} rounds or in {time}"
L.sb_mapchange_disabled = "Session limits are disabled."
L.sb_mapchange_mode_0 = "Session limits are disabled."
L.sb_mapchange_mode_1 = "Map changes in {num} rounds or in {time}"
L.sb_mapchange_mode_2 = "Map changes in {time}"
L.sb_mapchange_mode_3 = "Map changes in {num} rounds"

L.sb_mia = "Missing In Action"
L.sb_confirmed = "Confirmed Dead"
Expand Down Expand Up @@ -1672,7 +1676,6 @@ L.label_round_limit = "Upper limit of rounds"
L.label_time_limit_minutes = "Upper limit of playtime in minutes"
L.label_nade_throw_during_prep = "Enable grenade throwing during preparing time"
L.label_postround_dm = "Enable deathmatch after round ended"
L.label_session_limits_enabled = "Enable session limits"
L.label_spectator_chat = "Enable spectators chatting with everybody"
L.label_lastwords_chatprint = "Print last words to chat if killed while typing"
L.label_identify_body_woconfirm = "Identify corpse without pressing the 'confirm' button"
Expand Down Expand Up @@ -2299,8 +2302,10 @@ Restarting a round only restarts the current round so you can start over. Resett
L.label_button_level_reset = "reset level"

L.loadingscreen_round_restart_title = "Starting new round"
L.loadingscreen_round_restart_subtitle = "you're playing on {map}"
L.loadingscreen_round_restart_subtitle_limits = "you're playing on {map} for another {rounds} round(s) or {time}"
L.loadingscreen_round_restart_subtitle_limits_mode_0 = "you're playing on {map}"
L.loadingscreen_round_restart_subtitle_limits_mode_1 = "you're playing on {map} for another {rounds} round(s) or {time}"
L.loadingscreen_round_restart_subtitle_limits_mode_2 = "you're playing on {map} for {time}"
L.loadingscreen_round_restart_subtitle_limits_mode_3 = "you're playing on {map} for another {rounds} round(s)"

-- 2024-06-23
L.header_roles_derandomize = "Role Derandomization"
Expand Down Expand Up @@ -2369,3 +2374,20 @@ L.vehicle_enter = "Press [{usekey}] to enter vehicle"

-- 2024-11-27
L.corpse_hint_without_confirm = "Press [{usekey}] to search."

-- 2025-01-05
L.help_session_limits_mode = [[
There are three different session limit modes you can choose from:

mode 0: No session limits. TTT2 will not end the session and will not trigger a map change.

mode 1: Default TTT2 mode. A map change will trigger if either the session time or session round count runs out.

mode 2: Only time limit. A map change will only trigger if the session time runs out.

mode 3: Only round limit. A map change will only trigger if the session round count runs out.]]
L.label_session_limits_mode = "Set session limit mode"
L.choice_session_limits_mode_0 = "mode 0: no session limits"
L.choice_session_limits_mode_1 = "mode 1: time and round limit"
L.choice_session_limits_mode_2 = "mode 2: only time limit"
L.choice_session_limits_mode_3 = "mode 3: only round limit"
28 changes: 24 additions & 4 deletions lua/terrortown/lang/es.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ L.win_showreport = "Veamos el reporte de la ronda por {num} segundos."

L.limit_round = "Límite de rondas alcanzado. El siguiente mapa se cargará pronto."
L.limit_time = "Tiempo límite alcanzado. El siguiente mapa cargará pronto."
L.limit_left = "{num} rondas o {time} minutos restantes para que el mapa cambie."
L.limit_left_session_mode_1 = "{num} rondas o {time} minutos restantes para que el mapa cambie."
--L.limit_left_session_mode_2 = "{time} minutes remaining before the map changes."
--L.limit_left_session_mode_3 = "{num} round(s) remaining before the map changes."

-- Credit awards
L.credit_all = "Tu equipo fue recompensado con {num} créditos por su desempeño."
Expand Down Expand Up @@ -167,8 +169,10 @@ L.quick_corpse_id = "el cadáver de {player}"

-- Scoreboard
L.sb_playing = "Estás jugando en..."
L.sb_mapchange = "El mapa cambia en {num} rondas o en {time}"
--L.sb_mapchange_disabled = "Session limits are disabled."
--L.sb_mapchange_mode_0 = "Session limits are disabled."
L.sb_mapchange_mode_1 = "El mapa cambia en {num} rondas o en {time}"
--L.sb_mapchange_mode_2 = "Map changes in {time}"
--L.sb_mapchange_mode_3 = "Map changes in {num} rounds"

L.sb_mia = "Perdido en Acción"
L.sb_confirmed = "Muerto confirmado"
Expand Down Expand Up @@ -1672,7 +1676,6 @@ L.desc_event_kill_other_using = "{victim} ({vrole} / {vteam}) fue asesinado por
--L.label_time_limit_minutes = "Upper limit of playtime in minutes"
--L.label_nade_throw_during_prep = "Enable grenade throwing during preparing time"
--L.label_postround_dm = "Enable deathmatch after round ended"
--L.label_session_limits_enabled = "Enable session limits"
--L.label_spectator_chat = "Enable spectators chatting with everybody"
--L.label_lastwords_chatprint = "Print last words to chat if killed while typing"
--L.label_identify_body_woconfirm = "Identify corpse without pressing the 'confirm' button"
Expand Down Expand Up @@ -2369,3 +2372,20 @@ L.decoy_help_primary = "Colocar el señuelo"

-- 2024-11-27
--L.corpse_hint_without_confirm = "Press [{usekey}] to search."

-- 2025-01-05
--L.help_session_limits_mode = [[
--There are three different session limit modes you can choose from:
--
--mode 0: No session limits. TTT2 will not end the session and will not trigger a map change.
--
--mode 1: Default TTT2 mode. A map change will trigger if either the session time or session round count runs out.
--
--mode 2: Only time limit. A map change will only trigger if the session time runs out.
--
--mode 3: Only round limit. A map change will only trigger if the session round count runs out.]]
--L.label_session_limits_mode = "Set session limit mode"
--L.choice_session_limits_mode_0 = "mode 0: no session limits"
--L.choice_session_limits_mode_1 = "mode 1: time and round limit"
--L.choice_session_limits_mode_2 = "mode 2: only time limit"
--L.choice_session_limits_mode_3 = "mode 3: only round limit"
28 changes: 24 additions & 4 deletions lua/terrortown/lang/fr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ L.win_showreport = "Regardons le rapport de la partie {num} secondes."

L.limit_round = "Limite de partie atteinte. La prochaine carte va bientôt chargée."
L.limit_time = "Limite de temps atteinte. La prochaine carte va bientôt chargée."
L.limit_left = "Il reste {num} partie(s) ou {time} minutes avant que la carte change."
L.limit_left_session_mode_1 = "Il reste {num} partie(s) ou {time} minutes avant que la carte change."
--L.limit_left_session_mode_2 = "{time} minutes remaining before the map changes."
--L.limit_left_session_mode_3 = "{num} round(s) remaining before the map changes."

-- Credit awards
L.credit_all = "Vous êtes récompensés de {num} crédit(s) pour vos performances."
Expand Down Expand Up @@ -167,8 +169,10 @@ L.quick_corpse_id = "le corps de {player}"

-- Scoreboard
L.sb_playing = "Vous jouez sur..."
L.sb_mapchange = "Changement de carte dans {num} partie(s) ou dans {time}"
L.sb_mapchange_disabled = "Les limites de partie sont désactivées."
L.sb_mapchange_mode_0 = "Les limites de partie sont désactivées."
L.sb_mapchange_mode_1 = "Changement de carte dans {num} partie(s) ou dans {time}"
--L.sb_mapchange_mode_2 = "Map changes in {time}"
--L.sb_mapchange_mode_3 = "Map changes in {num} rounds"

L.sb_mia = "Portés disparus"
L.sb_confirmed = "Morts Confirmés"
Expand Down Expand Up @@ -1672,7 +1676,6 @@ L.label_round_limit = "Nombre de parties maximum sur cette carte"
L.label_time_limit_minutes = "Temps de jeu maximum en minutes sur cette carte"
L.label_nade_throw_during_prep = "Activer le lancer de grenade pendant la phase de préparation"
L.label_postround_dm = "Activer le match à mort a la fin de la partie"
L.label_session_limits_enabled = "Activer la limite de partie"
L.label_spectator_chat = "Activer le chat entre les spectateurs et les vivants"
L.label_lastwords_chatprint = "Affiche les derniers mots dans le chat si la personne est tuée pendant qu'elle écrit."
L.label_identify_body_woconfirm = "Identifier les corps sans appuyer sur le bouton 'confirmer'"
Expand Down Expand Up @@ -2369,3 +2372,20 @@ L.vehicle_enter = "Appuyez sur [{usekey}] pour entrer dans le véhicule"

-- 2024-11-27
--L.corpse_hint_without_confirm = "Press [{usekey}] to search."

-- 2025-01-05
--L.help_session_limits_mode = [[
--There are three different session limit modes you can choose from:
--
--mode 0: No session limits. TTT2 will not end the session and will not trigger a map change.
--
--mode 1: Default TTT2 mode. A map change will trigger if either the session time or session round count runs out.
--
--mode 2: Only time limit. A map change will only trigger if the session time runs out.
--
--mode 3: Only round limit. A map change will only trigger if the session round count runs out.]]
--L.label_session_limits_mode = "Set session limit mode"
--L.choice_session_limits_mode_0 = "mode 0: no session limits"
--L.choice_session_limits_mode_1 = "mode 1: time and round limit"
--L.choice_session_limits_mode_2 = "mode 2: only time limit"
--L.choice_session_limits_mode_3 = "mode 3: only round limit"
28 changes: 24 additions & 4 deletions lua/terrortown/lang/it.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ L.win_showreport = "Guardiamo il report per {num} secondi."

L.limit_round = "Raggiunto il limite del tempo del round. la prossima mappa caricherà presto."
L.limit_time = "Il tempo è finito. la prossima mappa caricherà presto."
L.limit_left = "{num} round o {time} minuti rimanenti prima che la mappa cambi."
L.limit_left_session_mode_1 = "{num} round o {time} minuti rimanenti prima che la mappa cambi."
--L.limit_left_session_mode_2 = "{time} minutes remaining before the map changes."
--L.limit_left_session_mode_3 = "{num} round(s) remaining before the map changes."

-- Credit awards
L.credit_all = "Al tuo team sono stati dati {num} crediti per la vostra performance."
Expand Down Expand Up @@ -167,8 +169,10 @@ L.quick_corpse_id = " il corpo di {player}"

-- Scoreboard
L.sb_playing = "Stai giocando su..."
L.sb_mapchange = "La mappa cambierà tra {num} round o tra {time}"
--L.sb_mapchange_disabled = "Session limits are disabled."
--L.sb_mapchange_mode_0 = "Session limits are disabled."
L.sb_mapchange_mode_1 = "La mappa cambierà tra {num} round o tra {time}"
--L.sb_mapchange_mode_2 = "Map changes in {time}"
--L.sb_mapchange_mode_3 = "Map changes in {num} rounds"

L.sb_mia = "Disperso"
L.sb_confirmed = "Morti confermati"
Expand Down Expand Up @@ -1672,7 +1676,6 @@ L.desc_event_kill_other_using = "{victim} ({vrole} / {vteam}) è stata ucciso da
--L.label_time_limit_minutes = "Upper limit of playtime in minutes"
--L.label_nade_throw_during_prep = "Enable grenade throwing during preparing time"
--L.label_postround_dm = "Enable deathmatch after round ended"
--L.label_session_limits_enabled = "Enable session limits"
--L.label_spectator_chat = "Enable spectators chatting with everybody"
--L.label_lastwords_chatprint = "Print last words to chat if killed while typing"
--L.label_identify_body_woconfirm = "Identify corpse without pressing the 'confirm' button"
Expand Down Expand Up @@ -2369,3 +2372,20 @@ L.decoy_help_primary = "Piazza un esca"

-- 2024-11-27
--L.corpse_hint_without_confirm = "Press [{usekey}] to search."

-- 2025-01-05
--L.help_session_limits_mode = [[
--There are three different session limit modes you can choose from:
--
--mode 0: No session limits. TTT2 will not end the session and will not trigger a map change.
--
--mode 1: Default TTT2 mode. A map change will trigger if either the session time or session round count runs out.
--
--mode 2: Only time limit. A map change will only trigger if the session time runs out.
--
--mode 3: Only round limit. A map change will only trigger if the session round count runs out.]]
--L.label_session_limits_mode = "Set session limit mode"
--L.choice_session_limits_mode_0 = "mode 0: no session limits"
--L.choice_session_limits_mode_1 = "mode 1: time and round limit"
--L.choice_session_limits_mode_2 = "mode 2: only time limit"
--L.choice_session_limits_mode_3 = "mode 3: only round limit"
Loading
Loading