aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/client/game_controls/baseviewport.cpp
diff options
context:
space:
mode:
authorJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
committerJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
commit0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch)
treec831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/game/client/game_controls/baseviewport.cpp
parentUpdated the SDK with the latest code from the TF and HL2 branches. (diff)
downloadsource-sdk-2013-master.tar.xz
source-sdk-2013-master.zip
Updated the SDK with the latest code from the TF and HL2 branches.HEADmaster
Diffstat (limited to 'mp/src/game/client/game_controls/baseviewport.cpp')
-rw-r--r--mp/src/game/client/game_controls/baseviewport.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/mp/src/game/client/game_controls/baseviewport.cpp b/mp/src/game/client/game_controls/baseviewport.cpp
index f239cde8..31d8dca2 100644
--- a/mp/src/game/client/game_controls/baseviewport.cpp
+++ b/mp/src/game/client/game_controls/baseviewport.cpp
@@ -65,7 +65,17 @@ vgui::Panel *g_lastPanel = NULL; // used for mouseover buttons, keeps track of t
vgui::Button *g_lastButton = NULL; // used for mouseover buttons, keeps track of the last active button
using namespace vgui;
-ConVar hud_autoreloadscript("hud_autoreloadscript", "0", FCVAR_NONE, "Automatically reloads the animation script each time one is ran");
+void hud_autoreloadscript_callback( IConVar *var, const char *pOldValue, float flOldValue );
+
+ConVar hud_autoreloadscript("hud_autoreloadscript", "0", FCVAR_NONE, "Automatically reloads the animation script each time one is ran", hud_autoreloadscript_callback);
+
+void hud_autoreloadscript_callback( IConVar *var, const char *pOldValue, float flOldValue )
+{
+ if ( g_pClientMode && g_pClientMode->GetViewportAnimationController() )
+ {
+ g_pClientMode->GetViewportAnimationController()->SetAutoReloadScript( hud_autoreloadscript.GetBool() );
+ }
+}
static ConVar cl_leveloverviewmarker( "cl_leveloverviewmarker", "0", FCVAR_CHEAT );
@@ -573,11 +583,12 @@ void CBaseViewport::OnThink()
else
m_pActivePanel = NULL;
}
-
- m_pAnimController->UpdateAnimations( gpGlobals->curtime );
- // check the auto-reload cvar
- m_pAnimController->SetAutoReloadScript(hud_autoreloadscript.GetBool());
+ // TF does this in OnTick in TFViewport. This remains to preserve old
+ // behavior in other games
+#if !defined( TF_CLIENT_DLL )
+ m_pAnimController->UpdateAnimations( gpGlobals->curtime );
+#endif
int count = m_Panels.Count();