From da5734393d21150e160b64ed19c76e449bbcf8fd Mon Sep 17 00:00:00 2001 From: Carl Kittelberger Date: Fri, 8 Apr 2016 18:12:22 +0200 Subject: [PATCH] Use "lower message" for the prerelease timer for hiders. --- english/localizedstrings/hns.str | 3 --- german/localizedstrings/hns.str | 3 --- maps/mp/gametypes/hns.gsc | 37 +++++++++++++++++--------------- spanish/localizedstrings/hns.str | 3 --- 4 files changed, 20 insertions(+), 26 deletions(-) diff --git a/english/localizedstrings/hns.str b/english/localizedstrings/hns.str index d47f903..e71ba82 100644 --- a/english/localizedstrings/hns.str +++ b/english/localizedstrings/hns.str @@ -17,9 +17,6 @@ REFERENCE OBJECTIVES_HIDEANDSEEK_DEFENDER LANG_ENGLISH "Disguise yourself and survive." REFERENCE HIDEANDSEEK_TIMER_SEEKER_RELEASE -LANG_ENGLISH "Seekers released in &&1" - -REFERENCE HIDEANDSEEK_TIMER_SEEKER_RELEASE_TITLE LANG_ENGLISH "Seekers will be released in:" REFERENCE HIDEANDSEEK_SEEKERS_RELEASED diff --git a/german/localizedstrings/hns.str b/german/localizedstrings/hns.str index 0430db9..cd9b3fe 100644 --- a/german/localizedstrings/hns.str +++ b/german/localizedstrings/hns.str @@ -17,9 +17,6 @@ REFERENCE OBJECTIVES_HIDEANDSEEK_DEFENDER LANG_GERMAN "Tarne dich and überlebe." REFERENCE HIDEANDSEEK_TIMER_SEEKER_RELEASE -LANG_GERMAN "Seeker kommen in &&1" - -REFERENCE HIDEANDSEEK_TIMER_SEEKER_RELEASE_TITLE LANG_GERMAN "Seeker werden freigelassen in:" REFERENCE HIDEANDSEEK_SEEKERS_RELEASED diff --git a/maps/mp/gametypes/hns.gsc b/maps/mp/gametypes/hns.gsc index d258838..3e8c0df 100644 --- a/maps/mp/gametypes/hns.gsc +++ b/maps/mp/gametypes/hns.gsc @@ -177,7 +177,6 @@ onPrecacheGametype() game["fx_boom"] = LoadFX("props/electricbox4_explode"); PreCacheString(&"HIDEANDSEEK_TIMER_SEEKER_RELEASE"); - PreCacheString(&"HIDEANDSEEK_TIMER_SEEKER_RELEASE_TITLE"); PreCacheString(&"HIDEANDSEEK_SEEKERS_RELEASED"); PreCacheString(&"OBJECTIVES_HIDEANDSEEK_DEFENDER"); @@ -475,9 +474,14 @@ levelReleaseTimer() { logString("levelReleaseTimer called"); + gameFlagClear("seekers_prerelease_setup"); gameFlagClear("seekers_released"); gameFlagWait("prematch_done"); + level.preReleaseStart = getTime(); + + gameFlagSet("seekers_prerelease_setup"); + if (!level.preReleaseTime) { gameFlagSet("seekers_released"); @@ -488,24 +492,16 @@ levelReleaseTimer() timerDisplays = []; - // Display a pre-release timer on the top right corner for the hiders - timerDisplay = createServerTimer("objective", 1.4, game["hiders"]); - timerDisplay setPoint("TOPRIGHT", "TOPRIGHT", -8, 8); - timerDisplay.archived = false; - timerDisplay.hideWhenInMenu = false; - timerDisplay.label = &"HIDEANDSEEK_TIMER_SEEKER_RELEASE"; - timerDisplay.alpha = 1; - timerDisplay setTimer(level.preReleaseTime); - timerDisplays[0] = timerDisplay; + // Pre-release timer for hiders now handled in handleHider function! // Display a pre-release timer in the center for the seekers timerDisplayText = createServerFontString("objective", 1.5, game["seekers"]); timerDisplayText setPoint("CENTER", "CENTER", 0, -40); timerDisplayText.sort = 1001; - timerDisplayText setText(&"HIDEANDSEEK_TIMER_SEEKER_RELEASE_TITLE"); + timerDisplayText setText(&"HIDEANDSEEK_TIMER_SEEKER_RELEASE"); timerDisplayText.foreground = false; timerDisplayText.hideWhenInMenu = true; - timerDisplays[1] = timerDisplayText; + timerDisplays[timerDisplays.size] = timerDisplayText; timerDisplay = createServerTimer("hudbig", 1, game["seekers"]); timerDisplay setPoint("CENTER", "CENTER", 0, 0); timerDisplay.sort = 1001; @@ -514,16 +510,16 @@ levelReleaseTimer() timerDisplay.hideWhenInMenu = true; timerDisplay maps\mp\gametypes\_hud::fontPulseInit(); //timerDisplay setTimer(level.preReleaseTime); - timerDisplays[2] = timerDisplay; + timerDisplays[timerDisplays.size] = timerDisplay; waittillframeend; // wait till cleanup of previous start timer if multiple happen at once timerSeconds = level.preReleaseTime; for (timerSeconds = level.preReleaseTime; timerSeconds > 0 && !level.gameEnded; timerSeconds--) { - timerDisplays[2] thread maps\mp\gametypes\_hud::fontPulse(level); - wait (timerDisplays[2].inFrames * 0.05); - timerDisplays[2] SetValue(timerSeconds); - wait (1 - (timerDisplays[2].inFrames * 0.05)); + timerDisplays[timerDisplays.size - 1] thread maps\mp\gametypes\_hud::fontPulse(level); + wait (timerDisplays[timerDisplays.size - 1].inFrames * 0.05); + timerDisplays[timerDisplays.size - 1] SetValue(timerSeconds); + wait (1 - (timerDisplays[timerDisplays.size - 1].inFrames * 0.05)); } if (!level.gameEnded) @@ -663,8 +659,15 @@ handleHider() { if (!gameFlag("seekers_released")) { + gameFlagWait("seekers_prerelease_setup"); + + rest = level.preReleaseTime - ((getTime() - level.preReleaseStart)/1000); + player setLowerMessage("seekerreleasemsg", &"HIDEANDSEEK_TIMER_SEEKER_RELEASE", rest, 90); + gameFlagWait("seekers_released"); + player clearLowerMessage("seekerreleasemsg"); + /* player giveWeapon("deserteagle_tactical_mp", 0, false); player switchtoWeapon("deserteagle_tactical_mp"); diff --git a/spanish/localizedstrings/hns.str b/spanish/localizedstrings/hns.str index b6afd61..c3c5058 100644 --- a/spanish/localizedstrings/hns.str +++ b/spanish/localizedstrings/hns.str @@ -17,9 +17,6 @@ REFERENCE OBJECTIVES_HIDEANDSEEK_DEFENDER LANG_ENGLISH "Disguise yourself and survive." REFERENCE HIDEANDSEEK_TIMER_SEEKER_RELEASE -LANG_ENGLISH "Seekers released in &&1" - -REFERENCE HIDEANDSEEK_TIMER_SEEKER_RELEASE_TITLE LANG_ENGLISH "Seekers will be released in:" REFERENCE HIDEANDSEEK_SEEKERS_RELEASED