From be6277c2c8553aa0f22a52cc7ef080a0ad8f3d20 Mon Sep 17 00:00:00 2001 From: Blixibon Date: Sun, 2 Oct 2022 19:11:24 -0500 Subject: [PATCH 1/3] Fixed commentary node HUD alignment issues --- sp/src/game/client/c_point_commentary_node.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sp/src/game/client/c_point_commentary_node.cpp b/sp/src/game/client/c_point_commentary_node.cpp index 7ff47f24..d8d9ad4c 100644 --- a/sp/src/game/client/c_point_commentary_node.cpp +++ b/sp/src/game/client/c_point_commentary_node.cpp @@ -120,6 +120,7 @@ private: // HACKHACK: Needed as a failsafe to prevent desync int m_iCCDefaultY; + float m_flCCAnimTime; bool m_bShouldRepositionSubtitles; #endif @@ -910,6 +911,7 @@ CHudCommentary::CHudCommentary( const char *name ) : vgui::Panel( NULL, "HudComm m_pFootnoteLabel = new vgui::Label( this, "HudCommentaryFootnoteLabel", L"Commentary footnote" ); m_iCCDefaultY = 0; + m_flCCAnimTime = 0.0f; #endif } @@ -1415,6 +1417,9 @@ void CHudCommentary::StartCommentary( C_PointCommentaryNode *pNode, char *pszSpe { m_bShouldPaint = true; m_bShouldRepositionSubtitles = true; + + // Ensure we perform layout later + InvalidateLayout(); } else m_bShouldRepositionSubtitles = false; @@ -1634,6 +1639,9 @@ void CHudCommentary::StartSceneCommentary( C_PointCommentaryNode *pNode, char *p { m_bShouldPaint = true; m_bShouldRepositionSubtitles = true; + + // Ensure we perform layout later + InvalidateLayout(); } else m_bShouldRepositionSubtitles = false; @@ -1781,9 +1789,17 @@ void CHudCommentary::RepositionAndFollowCloseCaption( int yOffset ) // Run this animation command instead of setting the position directly g_pClientMode->GetViewportAnimationController()->RunAnimationCommand( pHudCloseCaption, "YPos", ccY - yOffset, 0.0f, 0.2f, vgui::AnimationController::INTERPOLATOR_DEACCEL ); //pHudCloseCaption->SetPos( ccX, ccY ); + m_flCCAnimTime = gpGlobals->curtime + 0.2f; pHudCloseCaption->SetUsingCommentaryDimensions( true ); } + else if (gpGlobals->curtime > m_flCCAnimTime && ccY != m_iCCDefaultY - m_iTypeAudioT - yOffset) + { + DevMsg( "CHudCommentary had to correct misaligned CC element offset (%i != %i)\n", m_iCCDefaultY - ccY, yOffset ); + + g_pClientMode->GetViewportAnimationController()->RunAnimationCommand( pHudCloseCaption, "YPos", m_iCCDefaultY - m_iTypeAudioT - yOffset, 0.0f, 0.2f, vgui::AnimationController::INTERPOLATOR_DEACCEL ); + m_flCCAnimTime = gpGlobals->curtime + 0.2f; + } SetPos( ccX, ccY + pHudCloseCaption->GetTall() + commentary_audio_element_below_cc_margin.GetInt() ); From c31e48591f7ffd7289b7e30019825ee4fead3055 Mon Sep 17 00:00:00 2001 From: Blixibon Date: Sun, 2 Oct 2022 19:12:42 -0500 Subject: [PATCH 2/3] Fixed crash from TestEntity on filters --- sp/src/game/server/filters.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sp/src/game/server/filters.cpp b/sp/src/game/server/filters.cpp index 704cf054..c15f8eee 100644 --- a/sp/src/game/server/filters.cpp +++ b/sp/src/game/server/filters.cpp @@ -134,6 +134,12 @@ void CBaseFilter::InputTestActivator( inputdata_t &inputdata ) //----------------------------------------------------------------------------- void CBaseFilter::InputTestEntity( inputdata_t &inputdata ) { + if ( !inputdata.value.Entity() ) + { + // HACKHACK: Not firing OnFail in this case is intentional for the time being (activator shouldn't be null) + return; + } + if ( PassesFilter( inputdata.pCaller, inputdata.value.Entity() ) ) { m_OnPass.FireOutput( inputdata.value.Entity(), m_bPassCallerWhenTested ? inputdata.pCaller : this ); From f5633dcc756d960b7fd6456dd9936def655030b1 Mon Sep 17 00:00:00 2001 From: Blixibon Date: Sun, 2 Oct 2022 19:23:22 -0500 Subject: [PATCH 3/3] Updated README --- README | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README b/README index efa04881..d5ca32ee 100644 --- a/README +++ b/README @@ -101,8 +101,8 @@ interchangeable arms; this may change in the future) Direct contributions: +- https://github.com/mapbase-source/source-sdk-2013/pull/3 ("playvideo" command playback fix from Avanate) - https://github.com/mapbase-source/source-sdk-2013/pull/5 (Custom VScript implementation by ReDucTor; was placed into feature branch before being merged in a subsequent PR) -- https://github.com/mapbase-source/source-sdk-2013/pull/3 ("playvideo" command playback fix from Avantate) - https://github.com/mapbase-source/source-sdk-2013/pull/60 (Adjustment by RoyaleNoir to one of Saul's VDC changes) - https://github.com/mapbase-source/source-sdk-2013/pull/84 (CS:S viewmodel chirality from 1upD) - https://github.com/mapbase-source/source-sdk-2013/pull/116 (vgui_movie_display mute keyvalue from Alivebyte/rzkid) @@ -180,6 +180,10 @@ Other relevant articles: * https://github.com/mapbase-source/source-sdk-2013/wiki/Mapbase-Disclaimers * https://github.com/mapbase-source/source-sdk-2013/wiki/Frequently-Asked-Questions-(FAQ) +//--------------------------------------------------------------------------------------------------------------------------------------------------- + +In memory of Holly Liberatore (moofemp) + //=================================================================================================================================================== Please see the Source SDK 2013 license below: