mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2024-12-26 23:05:30 +03:00
Support for overriding HUD animations via map-specific scripts
This commit is contained in:
parent
8985ad2fe4
commit
f1bd6fcf81
@ -31,6 +31,11 @@ using namespace vgui;
|
||||
|
||||
static CUtlSymbolTable g_ScriptSymbols(0, 128, true);
|
||||
|
||||
#ifdef MAPBASE
|
||||
// Allows animation sequences to be overridden by map-specific files
|
||||
extern bool g_bUsingCustomHudAnimations;
|
||||
#endif
|
||||
|
||||
// singleton accessor for animation controller for use by the vgui controls
|
||||
namespace vgui
|
||||
{
|
||||
@ -317,11 +322,35 @@ bool AnimationController::ParseScriptFile(char *pMem, int length)
|
||||
return false;
|
||||
}
|
||||
|
||||
int seqIndex;
|
||||
int seqIndex = -1;
|
||||
UtlSymId_t nameIndex = g_ScriptSymbols.AddString(token);
|
||||
|
||||
#ifdef MAPBASE
|
||||
if (g_bUsingCustomHudAnimations)
|
||||
{
|
||||
// look through for the sequence
|
||||
for (seqIndex = 0; seqIndex < m_Sequences.Count(); seqIndex++)
|
||||
{
|
||||
if (m_Sequences[seqIndex].name == nameIndex)
|
||||
break;
|
||||
}
|
||||
|
||||
if (seqIndex >= m_Sequences.Count())
|
||||
seqIndex = -1;
|
||||
else
|
||||
{
|
||||
// Clear some stuff
|
||||
m_Sequences[seqIndex].cmdList.RemoveAll();
|
||||
}
|
||||
}
|
||||
|
||||
if (seqIndex == -1)
|
||||
#endif
|
||||
{
|
||||
// Create a new sequence
|
||||
seqIndex = m_Sequences.AddToTail();
|
||||
}
|
||||
|
||||
AnimSequence_t &seq = m_Sequences[seqIndex];
|
||||
seq.name = nameIndex;
|
||||
seq.duration = 0.0f;
|
||||
|
Loading…
Reference in New Issue
Block a user