Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sp/src/game/server/ai_speech_new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,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();
Expand Down
19 changes: 15 additions & 4 deletions sp/src/game/server/baseflex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -2106,11 +2106,17 @@ float CBaseFlex::PlayAutoGeneratedSoundScene( const char *soundname )
//-----------------------------------------------------------------------------
// Purpose: Parameters for scene event AI_GameText
//-----------------------------------------------------------------------------
bool CBaseFlex::GetGameTextSpeechParams( hudtextparms_t &params )
bool CBaseFlex::DispatchGetGameTextSpeechParams( hudtextparms_t &params )
{
// 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)
Expand Down Expand Up @@ -2147,13 +2153,18 @@ bool CBaseFlex::GetGameTextSpeechParams( hudtextparms_t &params )
{
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

Expand Down
3 changes: 2 additions & 1 deletion sp/src/game/server/baseflex.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ class CBaseFlex : public CBaseAnimatingOverlay
virtual int GetSpecialDSP( void ) { return 0; }

#ifdef MAPBASE
virtual bool GetGameTextSpeechParams( hudtextparms_t &params );
bool DispatchGetGameTextSpeechParams( hudtextparms_t &params );
virtual bool GetGameTextSpeechParams( hudtextparms_t &params ) { return true; }
#endif

protected:
Expand Down