Skip to content
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

Modified Button Layout to be similar to OG #9385

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

felix642
Copy link
Contributor

Relates to: #1355

The button layout has been changed for the button groups (YES/NO, OKAY/CANCEL)
The buttons are now closer to the center and some padding was added on each side.

Screenshot from 2024-12-25 17-50-37
Screenshot from 2024-12-25 17-54-00
Screenshot from 2024-12-25 17-54-14
Screenshot from 2024-12-25 17-56-47
Screenshot from 2024-12-25 17-59-52
Screenshot from 2024-12-25 18-00-24
Screenshot from 2024-12-25 17-57-33

Some layouts were not changed since they are already similar to the original game:

Screenshot from 2024-12-25 17-56-02
Screenshot from 2024-12-25 17-50-25

This one I'm not sure if we should update the position or not. It is already similar to the recruitment dialog so we might want to keep it as it.
Screenshot from 2024-12-25 18-00-08

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)

src/fheroes2/castle/castle_town.cpp Outdated Show resolved Hide resolved
src/fheroes2/gui/ui_button.cpp Outdated Show resolved Hide resolved
src/fheroes2/gui/ui_button.cpp Outdated Show resolved Hide resolved
src/fheroes2/gui/ui_button.cpp Outdated Show resolved Hide resolved
src/fheroes2/gui/ui_button.cpp Outdated Show resolved Hide resolved
src/fheroes2/castle/buildinginfo.cpp Outdated Show resolved Hide resolved
@felix642 felix642 force-pushed the I1355-button-layout branch from d0c068e to 9c8b94b Compare December 26, 2024 00:21
@Districh-ru Districh-ru added improvement New feature, request or improvement ui UI/GUI related stuff pixel-precision Fine-tuning of UI elements and assets labels Dec 26, 2024
@Districh-ru Districh-ru added this to the 1.1.5 milestone Dec 26, 2024
@Districh-ru Districh-ru self-requested a review December 26, 2024 08:07
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, @felix642, I left two code style related comments.
Could you please take a look when you have time.

src/fheroes2/gui/ui_button.cpp Outdated Show resolved Hide resolved
src/fheroes2/gui/ui_button.cpp Outdated Show resolved Hide resolved
@zenseii
Copy link
Collaborator

zenseii commented Dec 26, 2024

@felix642. Thanks for improving the UI. I'm wondering, have you checked these changes with other languages, especially Spanish and German?

@felix642
Copy link
Contributor Author

@felix642. Thanks for improving the UI. I'm wondering, have you checked these changes with other languages, especially Spanish and German?

No, I did not realize the size of the buttons would change depending on the selected language. I just had a quick look and everything looks good IMO.

image
image
image
image

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.

👍

@Districh-ru Districh-ru requested review from zenseii and ihhub December 26, 2024 17:05
@ihhub ihhub modified the milestones: 1.1.5, 1.1.6 Dec 27, 2024
@ihhub
Copy link
Owner

ihhub commented Dec 27, 2024

This pull request will not be merged till 1.1.5 release as it touches many in-game dialogs which we need to test.

Copy link
Owner

@ihhub ihhub left a comment

Choose a reason for hiding this comment

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

Hi @felix642 , I left several comments here. Could you please take a look at them?

case Dialog::YES | Dialog::NO:
offset.x = area.x;
case Dialog::YES | Dialog::NO: {
const int32_t horizontalFreeSpace = area.width - AGG::GetICN( buttonYesIcnID, 0 ).width() - AGG::GetICN( buttonNoIcnID, 0 ).width();
Copy link
Owner

Choose a reason for hiding this comment

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

Please cache AGG::GetICN( buttonYesIcnID, 0 ) and AGG::GetICN( buttonNoIcnID, 0 ) calls as we have the same calls in the code below.

case Dialog::YES | Dialog::NO:
offset.x = area.x;
case Dialog::YES | Dialog::NO: {
const int32_t horizontalFreeSpace = area.width - AGG::GetICN( buttonYesIcnID, 0 ).width() - AGG::GetICN( buttonNoIcnID, 0 ).width();
Copy link
Owner

Choose a reason for hiding this comment

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

Should we add an assertion that horizontalFreeSpace must be always be more than 0?

Comment on lines +443 to +444
const int32_t horizontalFreeSpace = area.width - AGG::GetICN( buttonOkayIcnID, 0 ).width() - AGG::GetICN( buttonCancelIcnID, 0 ).width();
const int32_t padding = horizontalFreeSpace / 4;
Copy link
Owner

Choose a reason for hiding this comment

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

The same comments as for line 429.

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 pixel-precision Fine-tuning of UI elements and assets ui UI/GUI related stuff
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants