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

UnitTable: show a summary when no unit is selected #12832

Merged
merged 3 commits into from
Jan 26, 2025

Conversation

sulai
Copy link
Contributor

@sulai sulai commented Jan 19, 2025

Changes

  • When nothing is selected, show idle and waiting units, together with the cycle buttons
  • allows to start cycling anytime with the arrow buttons and the shortcuts ,.
  • Refactor UnitTable to have separate Presenters for units, cities, spies and no selection.
  • at the cost of making private tables internal in order to populate them from the Presenters

grafik

…s any time. Refactor UnitTable to have separate Presenters for units, cities, spies and no selection.
@sulai
Copy link
Contributor Author

sulai commented Jan 19, 2025

UnitTable mixes logic, UI and data, which is not ideal, but it also handled all different entities in one class. I separated out the Presenters for units, cities, spies and non-selection, so it is easier to extend and work with now. It's not perfect though, because it still mixes logic, UI and data, but I didn't want to rewrite everything at the risk of breaking things.

@yairm210
Copy link
Owner

Separating "presenters" -> Fantastic 👍🏿
I don't like the with{} and let{} but as a temporary measure for separation I'm fine with it

@sulai

This comment was marked as resolved.

@sulai sulai marked this pull request as ready for review January 19, 2025 23:03
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@yairm210
Copy link
Owner

Self conflicts

# Conflicts:
#	core/src/com/unciv/ui/screens/worldscreen/unit/UnitTable.kt
Copy link

Conflicts have been resolved.

@yairm210
Copy link
Owner

Wait, what is the X for? Does it close it?

@sulai
Copy link
Contributor Author

sulai commented Jan 23, 2025

That's an old screenshot and got fixed, that window never shows an (x).

Also the unit panel in general has a lot of potential. I wish I had more time for unciv 🙂

@yairm210 yairm210 merged commit 477c6c5 into yairm210:master Jan 26, 2025
4 checks passed
@sulai sulai deleted the unit-table-overview branch January 26, 2025 13:07
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.

3 participants