mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-03-03 17:25:27 +03:00
Allow pre-existing choreo game_text params to be overridden by VScript
This commit is contained in:
parent
496cbe7a06
commit
fde0d4db6c
@ -922,7 +922,7 @@ bool CAI_Expresser::SpeakDispatchResponse( AIConcept_t concept, AI_Response *res
|
||||
textParams.g1 = 255;
|
||||
textParams.b1 = 255;
|
||||
|
||||
if (ai_speech_print_mode.GetBool() && GetOuter()->GetGameTextSpeechParams( textParams ))
|
||||
if (ai_speech_print_mode.GetBool() && GetOuter()->DispatchGetGameTextSpeechParams( textParams ))
|
||||
{
|
||||
CRecipientFilter filter;
|
||||
filter.AddAllPlayers();
|
||||
|
@ -816,7 +816,7 @@ bool CBaseFlex::StartSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CCh
|
||||
textParams.g1 = 255;
|
||||
textParams.b1 = 255;
|
||||
|
||||
if ( GetGameTextSpeechParams( textParams ) )
|
||||
if ( DispatchGetGameTextSpeechParams( textParams ) )
|
||||
{
|
||||
CRecipientFilter filter;
|
||||
filter.AddAllPlayers();
|
||||
@ -2120,11 +2120,17 @@ float CBaseFlex::PlayAutoGeneratedSoundScene( const char *soundname )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Parameters for scene event AI_GameText
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CBaseFlex::GetGameTextSpeechParams( hudtextparms_t ¶ms )
|
||||
bool CBaseFlex::DispatchGetGameTextSpeechParams( hudtextparms_t ¶ms )
|
||||
{
|
||||
// First, get any default values overridden by this class
|
||||
bool bReturn = GetGameTextSpeechParams( params );
|
||||
|
||||
// Allow VScript to override after
|
||||
ScriptVariant_t varTable;
|
||||
if (g_pScriptVM->GetValue(m_ScriptScope, "m_GameTextSpeechParams", &varTable) && varTable.m_type == FIELD_HSCRIPT)
|
||||
if (g_pScriptVM->GetValue( m_ScriptScope, "m_GameTextSpeechParams", &varTable ) && varTable.m_type == FIELD_HSCRIPT)
|
||||
{
|
||||
bReturn = true;
|
||||
|
||||
int nIterator = -1;
|
||||
ScriptVariant_t varKey, varValue;
|
||||
while ((nIterator = g_pScriptVM->GetKeyValue( varTable.m_hScript, nIterator, &varKey, &varValue )) != -1)
|
||||
@ -2161,13 +2167,18 @@ bool CBaseFlex::GetGameTextSpeechParams( hudtextparms_t ¶ms )
|
||||
{
|
||||
params.fxTime = varValue.m_float;
|
||||
}
|
||||
else if (FStrEq( varKey.m_pszString, "disabled" ))
|
||||
{
|
||||
// Allow the params to disable game_text choreo if needed
|
||||
bReturn = !(varValue.m_int > 0);
|
||||
}
|
||||
|
||||
g_pScriptVM->ReleaseValue( varKey );
|
||||
g_pScriptVM->ReleaseValue( varValue );
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return bReturn;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -142,7 +142,8 @@ public:
|
||||
virtual int GetSpecialDSP( void ) { return 0; }
|
||||
|
||||
#ifdef MAPBASE
|
||||
virtual bool GetGameTextSpeechParams( hudtextparms_t ¶ms );
|
||||
bool DispatchGetGameTextSpeechParams( hudtextparms_t ¶ms );
|
||||
virtual bool GetGameTextSpeechParams( hudtextparms_t ¶ms ) { return true; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
Loading…
x
Reference in New Issue
Block a user