From 0f695ee6647029ef4bfa7a535745212c76913911 Mon Sep 17 00:00:00 2001 From: Avanate <33595129+Avanate@users.noreply.github.com> Date: Mon, 7 Oct 2019 17:33:49 +0300 Subject: [PATCH 1/2] Fix a video playback issue related to 'playvideo' There is currently a bug that prohibits 'playvideo' from successfully playing media in-game, as the player must firstly go to the main menu for it to play, this issue makes sure that the command can work without having the player go to the menu. --- sp/src/game/client/vgui_video.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sp/src/game/client/vgui_video.cpp b/sp/src/game/client/vgui_video.cpp index 3badea3fa02..55fad39ed62 100644 --- a/sp/src/game/client/vgui_video.cpp +++ b/sp/src/game/client/vgui_video.cpp @@ -24,7 +24,7 @@ VideoPanel::VideoPanel( unsigned int nXPos, unsigned int nYPos, unsigned int nHe m_nPlaybackHeight( 0 ), m_bAllowAlternateMedia( allowAlternateMedia ) { - vgui::VPANEL pParent = enginevgui->GetPanel( PANEL_GAMEUIDLL ); + vgui::VPANEL pParent = enginevgui->GetPanel( PANEL_ROOT ); SetParent( pParent ); SetVisible( false ); @@ -420,4 +420,4 @@ CON_COMMAND( playvideo_exitcommand, "Plays a video and fires and exit command wh Warning( "Unable to play video: %s\n", strFullpath ); engine->ClientCmd( pExitCommand ); } -} \ No newline at end of file +} From 4f7fc0382af0de8d155ce9398aeecc71725cb94b Mon Sep 17 00:00:00 2001 From: Avanate <33595129+Avanate@users.noreply.github.com> Date: Sat, 2 Nov 2019 18:59:28 +0200 Subject: [PATCH 2/2] Add #ifdef MAPBASE preprocessor --- sp/src/game/client/vgui_video.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sp/src/game/client/vgui_video.cpp b/sp/src/game/client/vgui_video.cpp index 55fad39ed62..6df78893b2a 100644 --- a/sp/src/game/client/vgui_video.cpp +++ b/sp/src/game/client/vgui_video.cpp @@ -24,7 +24,12 @@ VideoPanel::VideoPanel( unsigned int nXPos, unsigned int nYPos, unsigned int nHe m_nPlaybackHeight( 0 ), m_bAllowAlternateMedia( allowAlternateMedia ) { + +#ifdef MAPBASE vgui::VPANEL pParent = enginevgui->GetPanel( PANEL_ROOT ); +#else + vgui::VPANEL pParent = enginevgui->GetPanel( PANEL_GAMEUIDLL ); +#endif SetParent( pParent ); SetVisible( false );