Skip to content

Popups wait while a screen of its own is up (a new tech's splash) - #111

Open
MortenLyhr wants to merge 1 commit into
bssth:masterfrom
MortenLyhr:fix/popups-wait-for-screens
Open

MortenLyhr wants to merge 1 commit into
bssth:masterfrom
MortenLyhr:fix/popups-wait-for-screens

Conversation

@MortenLyhr

@MortenLyhr MortenLyhr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

The problem

When the tech being researched is discovered, OpenCiv4 shows the tech's splash screen and, at the same time, the civic question ("Your society can now implement…") and then "What would you like to research next?". Esc closes the popup underneath, not the splash on top.

What the original does (Wine, BUG + BULL)

The tech discovered with CyTeam.setHasTech(…, bAnnounce=True) (testgames/shots/round2/tech-new-popup.py):

  • Only the splash shows (wine-round2/44-0-both.png); no popup is up under it.
  • Esc closes the splash; the civic popup comes next (44-1-esc.png), then the research question once that is answered (44-4-after-civic.png).

The game core queues both questions while the splash is up (CvTeam::setHasTech runs the Python onTechAcquired, which shows the splash, before chooseTech); the engine shows them only once the screen is gone, as it already did in OpenCiv4 for wonder movies (BUTTONPOPUP_PYTHON_SCREEN).

What it changes

Interface::updatePopups: the game's queued popups (the player's queue, a save's too) wait while a screen of its own is up (oc4screens.modalUp: an advisor, a splash, a movie; not the main interface, the city screen or a talk). What is opened at once (addPopup immediate: the game's menu) and a script's own popup (CyPopup) still show over a screen.

Pictures (Wine | OpenCiv4)

before

after

Esc

Checks

  • ctest 15/15.
  • Sync checksums equal to master's on all 100 turns (D7D43800): interface only.
  • OpenCiv4, the test map, research one turn from done (round2/tech-next-turn.py), --keys ">": the splash alone; ">....~": Esc closes it and the civic question is up.

🤖 Generated with Claude Code

@MortenLyhr

Copy link
Copy Markdown
Contributor Author

One more commit: ceb72b4 — keys and clicks go to the screen up, not the map under it.

Playing with this PR, Enter on a new tech's splash did not close it: it went past the splash to the map's hotkeys (Cycle Units; with every unit moved, the end of the turn), and Space skipped the selected unit. The popups waited as they should, but the keys went through.

What the original does (Wine, BUG + BULL), with a new tech's splash up:

  • Enter closes it, as its Continue button does; the civic question comes next. Enter on that question picks its first answer, then the research question; Enter there picks its first entry.
  • Space does nothing, and a click on the map beside the splash does nothing.
  • The same on an advisor (the Tech Advisor): Space nothing, Enter closes it, and F1 still opens the Domestic Advisor over it.

What it changes: a screen shown without bPassInput (showScreen(state, False): the splash, the advisors, the Civilopedia; not the main interface, the city screen, a talk or the dot-map overlay) holds the map's input while it is up:

  • Enter closes it, as Esc does (the screen on top that closes on Esc).
  • The units' orders and the selection, cycling and end-of-turn controls (CONTROL_* up to CONTROL_AUTOMOVES) and the numpad moves do nothing; the screens' own controls (advisors, Civilopedia, options, saving) still work.
  • A click on the map beside it is dropped.

Before / after (OpenCiv4, research one turn from done, --keys ">......%e"): before, Enter ran Cycle Units and the splash stayed; after, Enter closes the splash and the civic question is up, as in Wine.

Wine: Enter closed the splash OpenCiv4 before: Enter cycled the units OpenCiv4 after

ctest 13/13; sync checksums equal master's on all 100 turns (D7D43800).

🤖 Generated with Claude Code

@bssth

bssth commented Nov 23, 2026

Copy link
Copy Markdown
Owner

The description covers only the popup wait. Commit ceb72b4 also changes input: holdsInput/passInput, Enter closes the top screen, unit orders, cycling and end turn are blocked under such a screen, and all map clicks are dropped (main.cpp:1118). Please describe these and how they were checked, or move them into their own PR.

The two new 5-line comments (Interface.cpp:1000, main.cpp:755) can be one line each.

When the tech being researched is discovered, the original shows only
its splash screen: the civic and "what to research next" questions come
after it is closed, so Esc closes the splash first (Wine, BUG + BULL).
OpenCiv4 showed the popups at once under the splash, and Esc closed the
popup underneath. The game's queued popups now wait while a screen of
its own (an advisor, a splash, a wonder's movie) is up, as wonder movies
already did; what is opened at once (the game's menu, a script's popup)
still shows over it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MortenLyhr

Copy link
Copy Markdown
Contributor Author

Thanks. I moved the input change (ceb72b4) into its own PR, #167, with a description of each part and how it was checked. This PR is back to the popup wait alone: rebased on master (after #156 and #158), and the comment in Interface.cpp is one line now.

ctest 15/15; sync checksums equal on all 100 turns (D7D43800).

🤖 Generated with Claude Code

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants