mirror of
https://github.com/celisej567/source-sdk-2013.git
synced 2026-09-23 20:09:45 +03:00
Added new "mute" keyvalue and StopMovie input to logic_playmovie
This commit is contained in:
@@ -24,12 +24,18 @@ public:
|
||||
private:
|
||||
|
||||
void InputPlayMovie( inputdata_t &data );
|
||||
#ifdef MAPBASE
|
||||
void InputStopMovie( inputdata_t &data );
|
||||
#endif
|
||||
void InputMovieFinished( inputdata_t &data );
|
||||
|
||||
string_t m_strMovieFilename;
|
||||
bool m_bAllowUserSkip;
|
||||
#ifdef MAPBASE
|
||||
bool m_bLooping;
|
||||
bool m_bMuted;
|
||||
|
||||
bool m_bPlayingVideo;
|
||||
#endif
|
||||
|
||||
COutputEvent m_OnPlaybackFinished;
|
||||
@@ -43,9 +49,15 @@ BEGIN_DATADESC( CLogicPlayMovie )
|
||||
DEFINE_KEYFIELD( m_bAllowUserSkip, FIELD_BOOLEAN, "allowskip" ),
|
||||
#ifdef MAPBASE
|
||||
DEFINE_KEYFIELD( m_bLooping, FIELD_BOOLEAN, "loopvideo" ),
|
||||
DEFINE_KEYFIELD( m_bMuted, FIELD_BOOLEAN, "mute" ),
|
||||
|
||||
DEFINE_FIELD( m_bPlayingVideo, FIELD_BOOLEAN ),
|
||||
#endif
|
||||
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "PlayMovie", InputPlayMovie ),
|
||||
#ifdef MAPBASE
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "StopMovie", InputStopMovie ),
|
||||
#endif
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "__MovieFinished", InputMovieFinished ),
|
||||
|
||||
DEFINE_OUTPUT( m_OnPlaybackFinished, "OnPlaybackFinished" ),
|
||||
@@ -75,21 +87,41 @@ void CLogicPlayMovie::InputPlayMovie( inputdata_t &data )
|
||||
|
||||
char szClientCmd[256];
|
||||
Q_snprintf( szClientCmd, sizeof(szClientCmd),
|
||||
"playvideo_complex %s \"ent_fire %s __MovieFinished\" %d %d\n",
|
||||
"playvideo_complex %s \"ent_fire %s __MovieFinished\" %d %d %d\n",
|
||||
STRING(m_strMovieFilename),
|
||||
GetEntityNameAsCStr(),
|
||||
m_bAllowUserSkip,
|
||||
#ifdef MAPBASE
|
||||
m_bLooping
|
||||
m_bLooping,
|
||||
m_bMuted
|
||||
#else
|
||||
0,
|
||||
0
|
||||
#endif
|
||||
);
|
||||
|
||||
// Send it on
|
||||
engine->ServerCommand( szClientCmd );
|
||||
|
||||
#ifdef MAPBASE
|
||||
m_bPlayingVideo = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef MAPBASE
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CLogicPlayMovie::InputStopMovie( inputdata_t &data )
|
||||
{
|
||||
if (m_bPlayingVideo)
|
||||
{
|
||||
// Send it on
|
||||
engine->ServerCommand( "stopvideos\n" );
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -97,4 +129,8 @@ void CLogicPlayMovie::InputMovieFinished( inputdata_t &data )
|
||||
{
|
||||
// Simply fire our output
|
||||
m_OnPlaybackFinished.FireOutput( this, this );
|
||||
|
||||
#ifdef MAPBASE
|
||||
m_bPlayingVideo = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user