Skip to content

End turn button as the original's: art, colours and beat - #72

Closed
MortenLyhr wants to merge 1 commit into
bssth:masterfrom
MortenLyhr:fix/end-turn-button
Closed

MortenLyhr wants to merge 1 commit into
bssth:masterfrom
MortenLyhr:fix/end-turn-button

Conversation

@MortenLyhr

@MortenLyhr MortenLyhr commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What it changes

The end turn button ("evil eye") now looks and behaves as the original's, going by its theme files and measured in the original under Wine.

  • Art. The original draws the button's style, Button_HUDEndTurn_Style (HUD_EndTurn_btn.tga, a brass ring), as it is. Over it the engine draws the theme's own skin SF_CtrlTheme_Civ4_Control_Button_EndTurn_Skin: HUD_EndTurn.tga, a 22×22 grey glass dot at its size in the middle (GFC_BITMAPSKIN_CENTER_FIXED), with the state's colour added less half (FactorCombine = GColorCombine(AddSigned, Modulate)). OpenCiv4 tinted the whole ring instead.
  • States: they were the wrong way round. END_TURN_GO ("Green" in CvMainInterface.py) is the original's state while the player still plays. That gives a steady EndTurnDot_Green dot, even with a unit waiting for orders. Once the turn is over and "Press to end turn..." shows, the state is END_TURN_OVER_HIGHLIGHT/_DARK ("Red"), and the dot beats between EndTurnDot_Red and EndTurnDot_DarkRed. ui_end_turn_state now gives OVER with the end of turn message, and GO otherwise.
  • Hidden while the others move. shouldDisplayEndTurnButton follows whether the active player's turn is active, so the script hides the button during the AI turn, as the original does ("Waiting for other Civilizations..." shows instead).
  • The beat, measured from a 120 frames a second video of the original: every 1.5 s the red rises linearly over 0.5 s, holds 0.5 s and sinks over 0.5 s. The end of turn message blinks with the same beat: it fades in as the red rises, stays lit through the hold, and is gone around the darkest red. Before, it was a sine: the green pulsed and the text went between 60 % and 100 %.
  • Theme::colour(name, fallback) reads a colour the theme defines (here SF_CtrlTheme_Civ4_Control_Color_EndTurnDot_* from Civ4Theme_Common.thm).

The original's dot centre measures exactly grey 171 plus the theme colour less 128: green (43,235,43), red from (235,43,43) to (143,43,43). OpenCiv4's green is now (39,231,39).

Compared with the original

Test scenario, the original (Beyond the Sword under Wine) on the left, OpenCiv4 on the right.

Original left, OpenCiv4 right
Units can still move: green, steady (this PR)
Turn over, "Press ENTER": red, beating (this PR)
Units can still move: before
Master at the same start, red as well (the original here at its darkest red)
The original's beat: brightest left, darkest right

How it was checked

  • ctest passes: 13/13 (macOS, Release).
  • Game results unchanged: --turns 100 --map Fractal --size STANDARD --seed 7 gives the same checksum as master on every turn, ending at D7D43800.
  • Original saves still load: not affected (interface only), not tested.
  • Played on macOS (with BUG Mod): green while units can move, red beating at "Press ", hidden while the other civilizations move.
  • Compared with the original under Wine: pictures in bursts for each state, and 8 s videos for the beat. Not caught offscreen in OpenCiv4: the hidden button during the AI turn (the test map's AI turn is too short), but it was seen in play.

Both before pictures were taken on master, where the scenario's free starting units are awake (#63), so the turn is never over at the start and master shows red with units still to move. The after pictures have #63 applied, so the turn can be over at the start, as in the original.

🤖 Generated with Claude Code

…urs and beat

The original draws the button's style (HUD_EndTurn_btn.tga, a brass ring) as it is, and over
it the theme's glass dot (SF_CtrlTheme_Civ4_Control_Button_EndTurn_Skin: HUD_EndTurn.tga at
its size in the middle) with the state's colour added less half (AddSigned). OpenCiv4 tinted
the whole ring instead.

The states were the wrong way round: END_TURN_GO, a steady green dot (EndTurnDot_Green), is
the original's while units can still move; once the turn is over and the end of turn message
is up, the dot is red, sinking from EndTurnDot_Red to EndTurnDot_DarkRed and back. While the
other civilizations move the button is hidden (shouldDisplayEndTurnButton).

The beat, measured in Wine at 120 frames a second: every 1.5 s the red rises over 0.5 s, holds
0.5 s and sinks over 0.5 s; the end of turn message ("Press <ENTER> to end turn...",
"Waiting for other Civilizations...") blinks with it, gone around the darkest red.

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

MortenLyhr commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Included in bundle 5/6, #149, merged there with its own commits and with its conflicts with the other open PRs resolved (the bundle PR lists them). Closing in favour of #149.

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.

1 participant