Skip to content

tweak(intro): Implement intro skipping with ESC button#2879

Open
xezon wants to merge 1 commit into
TheSuperHackers:mainfrom
xezon:xezon/intro-esc-skip
Open

tweak(intro): Implement intro skipping with ESC button#2879
xezon wants to merge 1 commit into
TheSuperHackers:mainfrom
xezon:xezon/intro-esc-skip

Conversation

@xezon

@xezon xezon commented Jul 16, 2026

Copy link
Copy Markdown

This change implements intro skipping with ESC button. Press ESC 3 times to skip the whole intro.

TODO

  • Replicate in Generals

@xezon xezon added Enhancement Is new feature or request Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Input labels Jul 16, 2026
@greptile-apps

greptile-apps Bot commented Jul 16, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds ESC-based intro skipping for Zero Hour. The main changes are:

  • Add intro state skipping through GameClient.
  • Route ESC key-up events through the new skip path.
  • Remove the old movie-exit flag from Zero Hour global data.
  • Align movie abort polling with key-up events.

Confidence Score: 4/5

The shared ESC handler calls a method missing from the Generals game client.

  • The Generals target cannot compile the updated shared translator.
  • Rapid ESC input can consume a press during an intro transition instead of skipping the visible stage.

Core/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp; Generals/Code/GameEngine/Include/GameClient/GameClient.h; Core/GameEngine/Source/GameClient/Intro.cpp

Important Files Changed

Filename Overview
Core/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp Routes ESC input to a GameClient method that is not available in the Generals variant.
Core/GameEngine/Source/GameClient/Intro.cpp Adds intro-stage transitions and movie stopping for ESC-driven skips.
GeneralsMD/Code/GameEngine/Source/GameClient/GameClient.cpp Adds Zero Hour forwarding for intro skips and changes movie abort polling to key-up.
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
Core/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp:324
**Variant-specific method call**

`WindowXlat.cpp` is shared by both game variants, but only the Zero Hour `GameClient` declares and defines `skipCurrentIntroStage()`. The Generals build resolves this include to its own `GameClient.h`, which has no such member, so compiling the shared translator for Generals fails. Add the matching Generals API or keep this call behind the Zero Hour build path.

### Issue 2 of 2
Core/GameEngine/Source/GameClient/Intro.cpp:106-120
**Wait state consumes a skip**

When ESC is pressed again before `update()` has entered the next wait state, this branch only resets `m_waitUntilMs` and leaves the state unchanged. The next update then enters the logo screen or sizzle movie instead of skipping it, so rapid ESC presses can consume extra presses and require more than the documented three presses to finish the intro.

Reviews (1): Last reviewed commit: "tweak(intro): Implement intro skipping w..." | Re-trigger Greptile

Comment thread Core/GameEngine/Source/GameClient/MessageStream/WindowXlat.cpp
Comment thread Core/GameEngine/Source/GameClient/Intro.cpp
@githubawn

Copy link
Copy Markdown

Can we have left mouse click as well, smartphones don't have esc buttons and console ports (or SDL3 with controllers) have this mapped to the start button.

@xezon

xezon commented Jul 16, 2026

Copy link
Copy Markdown
Author

Can we have left mouse click as well, smartphones don't have esc buttons and console ports (or SDL3 with controllers) have this mapped to the start button.

Outside the scope of this change imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request Gen Relates to Generals Input Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants