Added commentary footnotes, misc. commentary fixes

This commit is contained in:
Blixibon
2022-04-26 07:55:35 -05:00
parent f8a8d49be7
commit b04fb3c43f
2 changed files with 279 additions and 72 deletions

View File

@@ -24,6 +24,8 @@
#include "Sprite.h"
#ifdef MAPBASE
#include "mapbase/SystemConvarMod.h"
#include <vgui_controls/Controls.h>
#include <vgui/ILocalize.h>
#endif
// memdbgon must be the last include file in a .cpp file!!!
@@ -130,6 +132,8 @@ public:
void SetSpeakers( const char *pszSpeakers ) { m_iszSpeakers.Set( AllocPooledString( pszSpeakers ) ); }
const char *GetPrintName() { return STRING( m_iszPrintName.Get() ); }
void SetPrintName( const char *pszPrintName ) { m_iszPrintName.Set( AllocPooledString( pszPrintName ) ); }
const char *GetFootnote() { return STRING( m_iszFootnote.Get() ); }
void SetFootnote( const char *pszFootnote ) { m_iszFootnote.Set( AllocPooledString( pszFootnote ) ); }
#endif
// Inputs
@@ -165,6 +169,7 @@ private:
float m_flViewPositionSpeedScale;
float m_flReturnSpeedScale;
CNetworkVar( string_t, m_iszPrintName );
CNetworkVar( string_t, m_iszFootnote );
float m_flViewPositionChangedTime; // View position now blends relative to this value. Mainly needed for when SetViewPosition is used
#endif
bool m_bPreventMovement;
@@ -226,6 +231,7 @@ BEGIN_DATADESC( CPointCommentaryNode )
DEFINE_KEYFIELD( m_flViewPositionSpeedScale, FIELD_FLOAT, "viewposition_speed" ),
DEFINE_KEYFIELD( m_flReturnSpeedScale, FIELD_FLOAT, "return_speed" ),
DEFINE_KEYFIELD( m_iszPrintName, FIELD_STRING, "printname" ),
DEFINE_KEYFIELD( m_iszFootnote, FIELD_STRING, "footnote" ),
DEFINE_FIELD( m_flViewPositionChangedTime, FIELD_TIME ),
DEFINE_KEYFIELD( m_iCommentaryType, FIELD_INTEGER, "type" ),
DEFINE_KEYFIELD( m_flPanelScale, FIELD_FLOAT, "panelscale" ),
@@ -271,6 +277,8 @@ BEGIN_ENT_SCRIPTDESC( CPointCommentaryNode, CBaseAnimating, "Commentary nodes wh
DEFINE_SCRIPTFUNC( SetSpeakers, "" )
DEFINE_SCRIPTFUNC( GetPrintName, "" )
DEFINE_SCRIPTFUNC( SetPrintName, "" )
DEFINE_SCRIPTFUNC( GetFootnote, "" )
DEFINE_SCRIPTFUNC( SetFootnote, "" )
DEFINE_SCRIPTFUNC( GetCommentaryType, "" )
DEFINE_SCRIPTFUNC( SetCommentaryType, "" )
@@ -296,6 +304,7 @@ IMPLEMENT_SERVERCLASS_ST( CPointCommentaryNode, DT_PointCommentaryNode )
SendPropEHandle( SENDINFO(m_hViewPosition) ),
#ifdef MAPBASE
SendPropStringT( SENDINFO( m_iszPrintName ) ),
SendPropStringT( SENDINFO( m_iszFootnote ) ),
SendPropInt( SENDINFO( m_iCommentaryType ), 2, SPROP_UNSIGNED ),
SendPropFloat( SENDINFO( m_flPanelScale ) ),
SendPropFloat( SENDINFO( m_flPanelX ) ),
@@ -782,6 +791,11 @@ public:
#endif
engine->LockNetworkStringTables( oldLock );
#ifdef MAPBASE
// Special commentary localization file (useful for things like text nodes or print names)
g_pVGuiLocalize->AddFile( "resource/commentary_%language%.txt", "MOD" );
#endif
}
void ShutDownCommentary( void )