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

TripleA-2.6.929 show Zoom percentage request #10693 #12082

Conversation

FedaSkywalker
Copy link
Contributor

A zoom option was added onto a bottom bar. A new listener was added upon zooming as well.

@CLAassistant
Copy link

CLAassistant commented Nov 6, 2023

CLA assistant check
All committers have signed the CLA.

final Number value = (Number) model.getValue();
frame.getMapPanel().setScale(value.doubleValue() / 100);

frame.getGame().getData().notifyMapZoomChanged(value.intValue());
Copy link
Member

Choose a reason for hiding this comment

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

WDYT of setting the value directly on bottomBar?

EG, something like:

              frame.getBottomBar().setMapZoom(value);

I see this as advantageous for two reasons:

  • less 'plumbing'
  • no need to route a UI concern through GameData

@DanVanAtta
Copy link
Member

DanVanAtta commented Nov 7, 2023

@FedaSkywalker thank you for the PR!

Looks like you probably need to run ./gradlew spotlessApply to apply formatting, and perhaps install 'google-java-format' in your IDE s well.

Could you attach a screenshot of what this update looks like? Assuming that UX looks good, I reviewed the code diff and have a suggestion to simplify the submission.

@FedaSkywalker
Copy link
Contributor Author

Hello @DanVanAtta, thx for your review. I tried to do it using frame.getBottomBar().setMapZoom(value); but it didn't work quite perfectly. This zoom setter only worked in the ViewMenu map zoom setting. The map zoom value can be loaded from a saved game. You can also change the map zoom using the scroll wheel. So I think using it with the zoom listeners is better. I have moved the map zoom listener to TripleAFrame. Now the zoom label is updated in real time every time setScale() is called. For UI check screens
Screenshot 2023-11-15 at 08 47 31
Screenshot 2023-11-15 at 09 45 10

@DanVanAtta
Copy link
Member

Thanks for the updates @FedaSkywalker and for working on a PR to begin with!

TBH I'm not sure if the zoom percentage is so salient that someone needs to see it all the time. Are we cluttering the UI? For sure zoom percentage is interesting information & is useful to know when opening a map or changing it. Though, I wonder if someone has been playing for an hour or three, whether they would still want to see zoom %.

I wonder if there is maybe somewhere else on the UI that would be nicer? Perhaps the community on the forums could help give suggestions even.

@FedaSkywalker As a compromise, WDYT if we put this update behind a flag? Simply add a setting that can be turned on to show this - and let's ask the community for feedback? Adding a game option setting is mostly straight forward. This might be better as an option in the view menu, eg: "show zoom percentage"

@FedaSkywalker
Copy link
Contributor Author

Hello @DanVanAtta, you have got a good idea about setting map som visibity. So I've added "show map zoom" option to view menu as checkbox. Now user can enable or disable showing map zoom. Also I have improved the UI part of the zoom label.
better map zoom ui
map zoom disabled
map zoom enabled

Signed-off-by: Patrik Fedič <[email protected]>
@FedaSkywalker
Copy link
Contributor Author

I've update text from "Show Map Zoom" to "Show Zoom Percentage"
updated text

Copy link
Member

@DanVanAtta DanVanAtta left a comment

Choose a reason for hiding this comment

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

👍

@DanVanAtta DanVanAtta merged commit 8fe64cb into triplea-game:master Nov 23, 2023
1 check passed
@TheDog-GH
Copy link
Contributor

TheDog-GH commented Nov 24, 2023

@FedaSkywalker It works, thanks for doing this!

However on my PC it scrolls in 9s that is 99, 89 79, even when I reset it to 100%, I know so ungrateful 🙄
As an aside when I do View> Map Zoom> and Reset I get this none critical error

Screenshot 2023-11-24 153236

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.

4 participants