Skip to content

Commit 02cb634

Browse files
committed
feat(movie): Implement ESC button mapping to skip Campaign, Challenge and Score videos (#1926)
1 parent 03f1f63 commit 02cb634

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/ScoreScreen.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
#include "GameClient/GameWindowManager.h"
8383
#include "GameClient/Gadget.h"
8484
#include "GameClient/GameText.h"
85+
#include "GameClient/Keyboard.h"
8586
#include "GameClient/MapUtil.h"
8687
#include "GameClient/Shell.h"
8788
#include "GameClient/KeyDefs.h"
@@ -731,6 +732,18 @@ void PlayMovieAndBlock(AsciiString movieTitle)
731732
TheWritableGlobalData->m_loadScreenRender = TRUE;
732733
while (videoStream->frameIndex() < videoStream->frameCount() - 1)
733734
{
735+
// TheSuperHackers @feature User can now skip video by pressing ESC
736+
if (TheKeyboard)
737+
{
738+
TheKeyboard->UPDATE();
739+
KeyboardIO *io = TheKeyboard->findKey(KEY_ESC, KeyboardIO::STATUS_UNUSED);
740+
if (io && BitIsSet(io->state, KEY_STATE_DOWN))
741+
{
742+
io->setUsed();
743+
break;
744+
}
745+
}
746+
734747
TheGameEngine->serviceWindowsOS();
735748

736749
if(!videoStream->isFrameReady())

GeneralsMD/Code/GameEngine/Source/GameClient/GUI/LoadScreen.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
#include "GameClient/GameText.h"
7272
#include "GameClient/GameWindowManager.h"
7373
#include "GameClient/GameWindowTransitions.h"
74+
#include "GameClient/Keyboard.h"
7475
#include "GameClient/LoadScreen.h"
7576
#include "GameClient/MapUtil.h"
7677
#include "GameClient/Mouse.h"
@@ -533,6 +534,18 @@ void SinglePlayerLoadScreen::init( GameInfo *game )
533534
Int shiftedPercent = -FRAME_FUDGE_ADD + 1;
534535
while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 )
535536
{
537+
// TheSuperHackers @feature User can now skip video by pressing ESC
538+
if (TheKeyboard)
539+
{
540+
TheKeyboard->UPDATE();
541+
KeyboardIO *io = TheKeyboard->findKey(KEY_ESC, KeyboardIO::STATUS_UNUSED);
542+
if (io && BitIsSet(io->state, KEY_STATE_DOWN))
543+
{
544+
io->setUsed();
545+
break;
546+
}
547+
}
548+
536549
TheGameEngine->serviceWindowsOS();
537550

538551
if(!m_videoStream->isFrameReady())
@@ -1053,6 +1066,18 @@ void ChallengeLoadScreen::init( GameInfo *game )
10531066
Int shiftedPercent = -FRAME_FUDGE_ADD + 1;
10541067
while (m_videoStream->frameIndex() < m_videoStream->frameCount() - 1 )
10551068
{
1069+
// TheSuperHackers @feature User can now skip video by pressing ESC
1070+
if (TheKeyboard)
1071+
{
1072+
TheKeyboard->UPDATE();
1073+
KeyboardIO *io = TheKeyboard->findKey(KEY_ESC, KeyboardIO::STATUS_UNUSED);
1074+
if (io && BitIsSet(io->state, KEY_STATE_DOWN))
1075+
{
1076+
io->setUsed();
1077+
break;
1078+
}
1079+
}
1080+
10561081
TheGameEngine->serviceWindowsOS();
10571082

10581083
if(!m_videoStream->isFrameReady())

0 commit comments

Comments
 (0)