From ee2e31becef59743d84fea03ffd91019a0a249b6 Mon Sep 17 00:00:00 2001 From: alaswell Date: Mon, 16 Mar 2015 12:31:24 -0600 Subject: [PATCH 1/2] adds a timer on the HUD that reflects how long security is down for --- maps/includes/base_shutdown.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/maps/includes/base_shutdown.lua b/maps/includes/base_shutdown.lua index ff17040..0963c3a 100644 --- a/maps/includes/base_shutdown.lua +++ b/maps/includes/base_shutdown.lua @@ -53,6 +53,13 @@ function security_off( team ) clip:SetClipFlags({ClipFlags.kClipTeamBlue}) end end + + -- add a timer for the security on HUD + if team == "red" then + AddHudTimerToAll( "red_sec_timer", SECURITY_LENGTH + 1, -1, button_red.iconx, button_red.icony + 15, button_red.iconalign ) + else + AddHudTimerToAll( "blue_sec_timer", SECURITY_LENGTH + 1, -1, button_blue.iconx, button_blue.icony + 15, button_blue.iconalign ) + end end -- called when security gets turned on (team is a string prefix, like "red") @@ -75,6 +82,9 @@ function security_on( team ) clip:SetClipFlags(_G[clipname].clipflags) end end + + -- remove security timer + RemoveHudItemFromAll( team.."_sec_timer" ) end ----------------------------------------------------------------------------- From 18e497f053123d0eab15cab93b6d5e9e03b22e52 Mon Sep 17 00:00:00 2001 From: squeek Date: Sat, 21 Mar 2015 21:39:39 -0700 Subject: [PATCH 2/2] Use SECURITY_LENGTH instead of SECURITY_LENGTH+1 --- maps/includes/base_shutdown.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maps/includes/base_shutdown.lua b/maps/includes/base_shutdown.lua index 0963c3a..c92e76e 100644 --- a/maps/includes/base_shutdown.lua +++ b/maps/includes/base_shutdown.lua @@ -56,9 +56,9 @@ function security_off( team ) -- add a timer for the security on HUD if team == "red" then - AddHudTimerToAll( "red_sec_timer", SECURITY_LENGTH + 1, -1, button_red.iconx, button_red.icony + 15, button_red.iconalign ) + AddHudTimerToAll( "red_sec_timer", SECURITY_LENGTH, -1, button_red.iconx, button_red.icony + 15, button_red.iconalign ) else - AddHudTimerToAll( "blue_sec_timer", SECURITY_LENGTH + 1, -1, button_blue.iconx, button_blue.icony + 15, button_blue.iconalign ) + AddHudTimerToAll( "blue_sec_timer", SECURITY_LENGTH, -1, button_blue.iconx, button_blue.icony + 15, button_blue.iconalign ) end end