Skip to content

In-Game Menu Enhancements - #1139

Open
zack-the-coding-actuary wants to merge 5 commits into
C7-Game:Developmentfrom
zack-the-coding-actuary:game_menu
Open

zack-the-coding-actuary wants to merge 5 commits into
C7-Game:Developmentfrom
zack-the-coding-actuary:game_menu

Conversation

@zack-the-coding-actuary

Copy link
Copy Markdown
Contributor

Added a few minor QoL updates to how players interact with the in-game menu:

  • Added a "New Game" button to the menu and wired up the Ctrl-Shift-Q shortcut. This does what "Retire" did previously, which is just exit to the entry menu. Works distinctly from the Ctrl-Q shortcut for Retire.
  • Made a fix to the Ctrl-P shortcut. The shortcut would work as intended but would immediately close out the preferences window by reading Ctrl-P in the same frame. Now opening and closing the preferences menu works on each unique press of Ctrl-P, and cannot be opened while other modals are active (e.g. advisor screens, city zoom screen, etc.)
  • Added a "We are disgraced" blocking modal that pops up both when the player opts to Retire, or they are defeated by the normal existing in-game conditions.
    • Added a "Can be closed by Esc" button feature which might be useful for other informational / interactable pop-ups in the project later. Disallowed "We are disgraced" pop-ups to be closed via Esc, which allowed the player to bypass the pop-up and keep playing rather than exiting to the main menu.
    • Added an in-game seconds timer that tracks how long a player has been playing this save, which persists across saves and loads (added a unit test here too). This data shows up in the "We are disgraced" screen when the player opts to retire.

Follow Up TODOs after merging (or as a part of this PR):

  • Stubbed TODOs to consider showing the time played on this save to the standard defeat pop-up and the standard victory pop-up.
  • Wire up HistTurnRecord to create the usual histogram graphic that pops up on game end after exiting via Retire, Defeat, or Victory.
    • Specifically, Victory in the base game goes through the histogram, hall of fame, etc. THEN allows you to decide whether to continue playing or not.
    • Create and wire up a Hall of Fame that shows up at the end of the aforementioned game wrap-up sequence of screens (Issue Implement Hall of Fame #1131)

- Add "New Game (Ctrl-Shift-Q)" button below Load Game and above Preferences in the in-game main menu
- Add confirmation popup before leaving the current game, matching the Retire workflow
- Add Game.OnNewGame, which returns to the main entry screen after the player confirms
- Add new_game input action and C7Action.NewGame for the Ctrl-Shift-Q shortcut
- Enable the previously stubbed New Game button in GameMenu and add a NewGame signal on PopupOverlay
- Remove duplicate Ctrl-P handling from HandleKeyboardInput, which toggled Preferences open and then the open_preferences action handler toggled it closed again in the same frame
- Keep the open_preferences action handler as the single entry point, consistent with the Save, Load, and Retire shortcuts
- Only open Preferences when no other modal is visible, so it can no longer open on top of the city screen or advisors
- Add "We are disgraced!" popup after confirming Retire, showing time spent, before returning to the main menu
- Add GameData.timePlayedSeconds, accumulated by the UI each frame, so the engine state stays deterministic for headless tests
- Serialize time played in SaveGame as TimePlayedSeconds; older saves without the field default to 0
- Add SaveTest covering the time played save and load round trip
- Update Retire TODOs now that only the end-of-game score graphs remain
…sizing

- Ignore key-repeat Enter events in the interactable popup controller so a held Enter can't also confirm the next popup
- Add an optional onConfirm callback to InformationPopup so the "We are disgraced!" popup returns to the main menu directly instead of waiting on a UI message that is sent twice per confirmation
- Show the "We are disgraced!" popup from the Game Over popup's "Return to the main menu" option, not only from Retire
- Add a TODO on the victory popup for the victory screen and end-of-game score graphs
- Redraw the popup background when its content resizes so late text wrapping no longer leaves the confirm button hanging below the box
- Add a disallowEscape option for interactable popups and use it on the disgrace and Game Over popups so Esc can't skip their actions
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