From 62a6481d0df9a7ff906b95953bce475962d48e4f Mon Sep 17 00:00:00 2001 From: Blixibon Date: Fri, 23 Apr 2021 00:17:08 -0500 Subject: [PATCH] Added default game_text speech color for every major HL2 character --- sp/src/game/server/ai_speech_new.cpp | 9 +++++++++ sp/src/game/server/baseflex.cpp | 18 +++++++++--------- sp/src/game/server/episodic/npc_magnusson.cpp | 5 +++++ sp/src/game/server/hl2/npc_alyx.h | 3 +++ sp/src/game/server/hl2/npc_alyx_episodic.h | 3 +++ sp/src/game/server/hl2/npc_barney.cpp | 5 +++++ sp/src/game/server/hl2/npc_breen.cpp | 5 +++++ sp/src/game/server/hl2/npc_eli.cpp | 5 +++++ sp/src/game/server/hl2/npc_kleiner.cpp | 5 +++++ sp/src/game/server/hl2/npc_mossman.cpp | 5 +++++ .../game/server/hl2/npc_vortigaunt_episodic.h | 5 +++++ 11 files changed, 59 insertions(+), 9 deletions(-) diff --git a/sp/src/game/server/ai_speech_new.cpp b/sp/src/game/server/ai_speech_new.cpp index 76735a9d..e886ab8f 100644 --- a/sp/src/game/server/ai_speech_new.cpp +++ b/sp/src/game/server/ai_speech_new.cpp @@ -905,6 +905,15 @@ bool CAI_Expresser::SpeakDispatchResponse( AIConcept_t &concept, AI_Response *re textParams.fadeinTime = 0.5f; textParams.fadeoutTime = 0.5f; + textParams.channel = 3; + textParams.x = -1; + textParams.y = 0.6; + textParams.effect = 0; + + textParams.r1 = 255; + textParams.g1 = 255; + textParams.b1 = 255; + if (ai_speech_print_mode.GetBool() && GetOuter()->GetGameTextSpeechParams( textParams )) { CRecipientFilter filter; diff --git a/sp/src/game/server/baseflex.cpp b/sp/src/game/server/baseflex.cpp index d908b15c..8da332cd 100644 --- a/sp/src/game/server/baseflex.cpp +++ b/sp/src/game/server/baseflex.cpp @@ -799,6 +799,15 @@ bool CBaseFlex::StartSceneEvent( CSceneEventInfo *info, CChoreoScene *scene, CCh textParams.fadeinTime = 0.5f; textParams.fadeoutTime = 0.5f; + textParams.channel = 3; + textParams.x = -1; + textParams.y = 0.6; + textParams.effect = 0; + + textParams.r1 = 255; + textParams.g1 = 255; + textParams.b1 = 255; + if ( GetGameTextSpeechParams( textParams ) ) { CRecipientFilter filter; @@ -2091,15 +2100,6 @@ float CBaseFlex::PlayAutoGeneratedSoundScene( const char *soundname ) //----------------------------------------------------------------------------- bool CBaseFlex::GetGameTextSpeechParams( hudtextparms_t ¶ms ) { - params.channel = 3; - params.x = -1; - params.y = 0.6; - params.effect = 0; - - params.r1 = 255; - params.g1 = 255; - params.b1 = 255; - ScriptVariant_t varTable; if (g_pScriptVM->GetValue(m_ScriptScope, "m_GameTextSpeechParams", &varTable) && varTable.m_type == FIELD_HSCRIPT) { diff --git a/sp/src/game/server/episodic/npc_magnusson.cpp b/sp/src/game/server/episodic/npc_magnusson.cpp index 31008353..30e1f697 100644 --- a/sp/src/game/server/episodic/npc_magnusson.cpp +++ b/sp/src/game/server/episodic/npc_magnusson.cpp @@ -37,6 +37,11 @@ public: Class_T Classify ( void ); void HandleAnimEvent( animevent_t *pEvent ); int GetSoundInterests ( void ); + +#ifdef MAPBASE + // Use Magnusson's default subtitle color (209,178,178) + bool GetGameTextSpeechParams( hudtextparms_t ¶ms ) { params.r1 = 209; params.g1 = 178; params.b1 = 178; return BaseClass::GetGameTextSpeechParams( params ); } +#endif }; LINK_ENTITY_TO_CLASS( npc_magnusson, CNPC_Magnusson ); diff --git a/sp/src/game/server/hl2/npc_alyx.h b/sp/src/game/server/hl2/npc_alyx.h index 551460b2..266dca6d 100644 --- a/sp/src/game/server/hl2/npc_alyx.h +++ b/sp/src/game/server/hl2/npc_alyx.h @@ -36,6 +36,9 @@ public: // Now that all allies can holster/unholster, this is a precaution in case it breaks anything. // Try OnFoundEnemy > UnholsterWeapon if you want Alyx to automatically unholster in non-episodic HL2 maps. bool CanUnholsterWeapon() { return false; } + + // Use Alyx's default subtitle color (255,212,255) + bool GetGameTextSpeechParams( hudtextparms_t ¶ms ) { params.r1 = 255; params.g1 = 212; params.b1 = 255; return BaseClass::GetGameTextSpeechParams( params ); } #endif EHANDLE m_hEmpTool; diff --git a/sp/src/game/server/hl2/npc_alyx_episodic.h b/sp/src/game/server/hl2/npc_alyx_episodic.h index 9e72fd8d..6d4eb67b 100644 --- a/sp/src/game/server/hl2/npc_alyx_episodic.h +++ b/sp/src/game/server/hl2/npc_alyx_episodic.h @@ -57,6 +57,9 @@ public: #ifdef MAPBASE // This skips CAI_PlayerAlly's CanFlinch() function since Episodic Alyx can flinch to begin with. virtual bool CanFlinch( void ) { return CAI_BaseActor::CanFlinch(); } + + // Use Alyx's default subtitle color (255,212,255) + bool GetGameTextSpeechParams( hudtextparms_t ¶ms ) { params.r1 = 255; params.g1 = 212; params.b1 = 255; return BaseClass::GetGameTextSpeechParams( params ); } #endif virtual float GetJumpGravity() const { return 1.8f; } diff --git a/sp/src/game/server/hl2/npc_barney.cpp b/sp/src/game/server/hl2/npc_barney.cpp index 02afce18..93ca92f0 100644 --- a/sp/src/game/server/hl2/npc_barney.cpp +++ b/sp/src/game/server/hl2/npc_barney.cpp @@ -81,6 +81,11 @@ public: void GatherConditions(); void UseFunc( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); +#ifdef MAPBASE + // Use Barney's default subtitle color (215,255,255) + bool GetGameTextSpeechParams( hudtextparms_t ¶ms ) { params.r1 = 215; params.g1 = 255; params.b1 = 255; return BaseClass::GetGameTextSpeechParams( params ); } +#endif + CAI_FuncTankBehavior m_FuncTankBehavior; COutputEvent m_OnPlayerUse; diff --git a/sp/src/game/server/hl2/npc_breen.cpp b/sp/src/game/server/hl2/npc_breen.cpp index e12bab0c..e1409c80 100644 --- a/sp/src/game/server/hl2/npc_breen.cpp +++ b/sp/src/game/server/hl2/npc_breen.cpp @@ -34,6 +34,11 @@ public: void HandleAnimEvent( animevent_t *pEvent ); int GetSoundInterests ( void ); bool UseSemaphore( void ); + +#ifdef MAPBASE + // Use Breen's default subtitle color (188,188,188) + bool GetGameTextSpeechParams( hudtextparms_t ¶ms ) { params.r1 = 188; params.g1 = 188; params.b1 = 188; return BaseClass::GetGameTextSpeechParams( params ); } +#endif }; LINK_ENTITY_TO_CLASS( npc_breen, CNPC_Breen ); diff --git a/sp/src/game/server/hl2/npc_eli.cpp b/sp/src/game/server/hl2/npc_eli.cpp index 4b42c6c0..c66e9273 100644 --- a/sp/src/game/server/hl2/npc_eli.cpp +++ b/sp/src/game/server/hl2/npc_eli.cpp @@ -37,6 +37,11 @@ public: int GetSoundInterests( void ); void SetupWithoutParent( void ); void PrescheduleThink( void ); + +#ifdef MAPBASE + // Use Eli's default subtitle color (255,208,172) + bool GetGameTextSpeechParams( hudtextparms_t ¶ms ) { params.r1 = 255; params.g1 = 208; params.b1 = 172; return BaseClass::GetGameTextSpeechParams( params ); } +#endif }; LINK_ENTITY_TO_CLASS( npc_eli, CNPC_Eli ); diff --git a/sp/src/game/server/hl2/npc_kleiner.cpp b/sp/src/game/server/hl2/npc_kleiner.cpp index e8081762..4e5e5cf8 100644 --- a/sp/src/game/server/hl2/npc_kleiner.cpp +++ b/sp/src/game/server/hl2/npc_kleiner.cpp @@ -35,6 +35,11 @@ public: Class_T Classify ( void ); void HandleAnimEvent( animevent_t *pEvent ); int GetSoundInterests ( void ); + +#ifdef MAPBASE + // Use Kleiner's default subtitle color (255,255,200) + bool GetGameTextSpeechParams( hudtextparms_t ¶ms ) { params.r1 = 255; params.g1 = 255; params.b1 = 200; return BaseClass::GetGameTextSpeechParams( params ); } +#endif }; LINK_ENTITY_TO_CLASS( npc_kleiner, CNPC_Kleiner ); diff --git a/sp/src/game/server/hl2/npc_mossman.cpp b/sp/src/game/server/hl2/npc_mossman.cpp index ff924cd2..f92a8f51 100644 --- a/sp/src/game/server/hl2/npc_mossman.cpp +++ b/sp/src/game/server/hl2/npc_mossman.cpp @@ -41,6 +41,11 @@ public: bool CreateBehaviors( void ); int SelectSchedule( void ); +#ifdef MAPBASE + // Use Mossman's default subtitle color (220,255,198) + bool GetGameTextSpeechParams( hudtextparms_t ¶ms ) { params.r1 = 220; params.g1 = 255; params.b1 = 198; return BaseClass::GetGameTextSpeechParams( params ); } +#endif + private: CAI_FollowBehavior m_FollowBehavior; }; diff --git a/sp/src/game/server/hl2/npc_vortigaunt_episodic.h b/sp/src/game/server/hl2/npc_vortigaunt_episodic.h index e0da23d3..5c281d59 100644 --- a/sp/src/game/server/hl2/npc_vortigaunt_episodic.h +++ b/sp/src/game/server/hl2/npc_vortigaunt_episodic.h @@ -138,6 +138,11 @@ public: // used so a grub can notify me that I stepped on it. Says a line. void OnSquishedGrub( const CBaseEntity *pGrub ); +#ifdef MAPBASE + // Use the vortigaunts' default subtitle color (188,241,174) + bool GetGameTextSpeechParams( hudtextparms_t ¶ms ) { params.r1 = 188; params.g1 = 241; params.b1 = 174; return BaseClass::GetGameTextSpeechParams( params ); } +#endif + private: int NumAntlionsInRadius( float flRadius );