Skip to content

Rework New Game, Load Game and Editor menus #9856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 14, 2025
Merged

Conversation

zenseii
Copy link
Collaborator

@zenseii zenseii commented May 29, 2025

Close #7100
Part of #9552 and #1893

This PR moves these dialogs over to StandardWindow to allow for Evil interface, variable size buttons for translations, and improved shadows. A lot of tidying has been done too.

The rationale for merging all the dialog states into one StandardWindow was to remove repeated code and unnecessary render and draw calls. All these separate dialogs were basically doing the same thing, just with different buttons.

This should also make it easier when implementing the original animating background of the lamps in the main menu (they should animate even with dialogs opened).

Battle only is now opened without having to press Hot Seat first, because I didn't see how that is relevant when battle only defaults to player vs ai and there is no distinct plan for network play for battle only.

Notes on some changes/decisions:

  • Buttons are generated in one go like BUTTONS_NEW_GAME_MENU_GOOD because they need to have the same dimensions.
  • Symmetric button rendering was extracted from the constructor to a separate method because it was necessary to have an empty dialog restorer.
  • The network-related stuff for the main menu was removed because it would've been more work to change it, and considering that, as far as I know, nothing's been planned regarding the menu design (e.g. should it be divided into Host menu and Guest menu). Either way, adding new buttons later on when network is being worked on will be easy.

image image

@zenseii zenseii added this to the 1.1.9 milestone May 29, 2025
@zenseii zenseii added improvement New feature, request or improvement ui UI/GUI related stuff translation Things related to languages and translations labels May 29, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

@zenseii zenseii marked this pull request as ready for review May 29, 2025 02:55
@zenseii zenseii requested review from ihhub and Districh-ru May 29, 2025 02:55
@zenseii
Copy link
Collaborator Author

zenseii commented May 29, 2025

@ihhub and @Districh-ru. This PR ended up becoming huge due to the changes necessary and so much dialog stuff being interconnected.

I'd appreciate it if you could have a look, especially at the changes concerning game modes and whether this should be changed or reverted. Thanks!

@zenseii zenseii changed the title Rework New Game menu and Editor Main Menu Rework New Game, Load Game and Editor menus May 29, 2025
@Districh-ru
Copy link
Collaborator

Hi @zenseii, you did a great work!
I'll check the code a little later (probably tomorrow).
I did a quick test and fund that in File Options dialog the translated buttons are not "evil" when Evil interface is selected:
изображение

@Districh-ru
Copy link
Collaborator

As I can see, this PR will close #7100

Copy link
Collaborator

@Districh-ru Districh-ru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @zenseii, all menus works as expected.
I like how you combined the main and editor menu.
I left two comments, could you please take a look in your spare time?

Also what do you think of making the behavior for Campaign and Multi-player menus act like in Editor: to have BACK button instead of CANCEL?
It will be different from the original game but IMHO more convenient: You open the New Game or Load Game menu and CANCEL actually returns you back the Main Menu. So I suggest to do the same action for the other menus - just return back one step.
And, yes, we can do this in a new PR after we discuss the need of such change.

@zenseii
Copy link
Collaborator Author

zenseii commented May 30, 2025

Thanks for the review, @Districh-ru !

Also what do you think of making the behavior for Campaign and Multi-player menus act like in Editor:

I actually considered this too, and I'm not against looking at it in a separate PR/discussion. I didn't do it in this PR because I felt it was safer to change the editor menu because player's aren't so familiar with that originally as they are with the game.

One thought I've been having with the use of the StandardWindow for these dialogs is that we can expand the height of the dialog according to the resolution, like we do for the save dialog. This would allow us to have more buttons like both a BACK and a CANCEL, or other things.

@zenseii zenseii requested a review from Districh-ru May 30, 2025 22:30
Copy link
Collaborator

@Districh-ru Districh-ru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @zenseii, I rechecked the code and found one more place where we could slightly optimize the code. Could you please take a look when you have time?

@zenseii zenseii requested a review from Districh-ru May 31, 2025 09:17
Copy link
Collaborator

@Districh-ru Districh-ru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ihhub
Copy link
Owner

ihhub commented Jun 7, 2025

I am moving this pull request to the next release.

@ihhub ihhub modified the milestones: 1.1.9, 1.1.10 Jun 7, 2025
@ihhub
Copy link
Owner

ihhub commented Jun 8, 2025

Hi @zenseii , since we made Interface independent windows in the Main Menu should we add back an option to change Interface Type? Of course it can be done in a separate pull request.

@zenseii
Copy link
Collaborator Author

zenseii commented Jun 8, 2025

Hi @zenseii , since we made Interface independent windows in the Main Menu should we add back an option to change Interface Type? Of course it can be done in a separate pull request.

@ihhub, I would definitely like to have the interface option in the main menu settings. I suppose we would need to add an option together with it to match the column and rows? Another PR for it makes sense.

@ihhub
Copy link
Owner

ihhub commented Jun 8, 2025

Hi @zenseii , yes we would need to add one more option to expand the window to have 3x3 option grid.

@ihhub ihhub merged commit 17fd186 into ihhub:master Jun 14, 2025
23 checks passed
@ihhub
Copy link
Owner

ihhub commented Jun 14, 2025

@zenseii , thank you so much for these changes!

@zenseii zenseii deleted the new-main-menus branch June 14, 2025 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement New feature, request or improvement translation Things related to languages and translations ui UI/GUI related stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename CONFIG button into SETTINGS
3 participants