Support for map-specific HUD animations and HUD layout scripts

This commit is contained in:
Blixibon
2021-09-24 00:11:18 -05:00
parent e39e1e0cca
commit 8985ad2fe4
3 changed files with 94 additions and 1 deletions

View File

@@ -146,6 +146,32 @@ bool CBaseViewport::LoadHudAnimations( void )
return true;
}
#ifdef MAPBASE
//-----------------------------------------------------------------------------
// Purpose: Reloads HUD animations after loading a map-specific HUD animations file.
//-----------------------------------------------------------------------------
void CBaseViewport::ReloadHudAnimations( void )
{
// Force a reload
if ( LoadHudAnimations() == false )
{
// Fall back to just the main
if ( m_pAnimController->SetScriptFile( GetVPanel(), "scripts/HudAnimations.txt", true ) == false )
{
Assert(0);
}
}
}
//-----------------------------------------------------------------------------
// Purpose: Loads a map-specific HUD animations file.
//-----------------------------------------------------------------------------
bool CBaseViewport::LoadCustomHudAnimations( const char *pszFile )
{
return m_pAnimController->SetScriptFile( GetVPanel(), pszFile, true );
}
#endif
//================================================================
CBaseViewport::CBaseViewport() : vgui::EditablePanel( NULL, "CBaseViewport")
{

View File

@@ -73,6 +73,10 @@ public:
public: // IGameEventListener:
virtual void FireGameEvent( IGameEvent * event);
#ifdef MAPBASE
bool LoadCustomHudAnimations( const char *pszFile );
void ReloadHudAnimations( void );
#endif
protected: