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

Improve the units widget when clicking on allied/team cities #1838

Open
jwrober opened this issue Feb 23, 2023 · 1 comment
Open

Improve the units widget when clicking on allied/team cities #1838

jwrober opened this issue Feb 23, 2023 · 1 comment
Labels
enhancement New feature or request gui This issue requires changes to the user interface

Comments

@jwrober
Copy link
Collaborator

jwrober commented Feb 23, 2023

Is your feature request related to a problem? Please describe.
In team games or with allies in FFA games, you can click on a allied/team city to see what units are inside. The current widget that pops up makes it really hard to differentiate different types of units and impossible to determine which units are loaded on a particular transport ship. It seems random as to how the units are placed in the widget (I'm sure it's not random, but feels that way).

Also the widget acts like a "menu" and prevents easy screen shots.

Describe the solution you'd like
For one, get rid of the menu thing so its easy to get a screen shot for sharing in a team or with an ally.

I would next like to see the widget turned into a QTreeWidget or something so we can organize the units in there better.

  1. Organize by Nation and Unit type, maybe alpha order or at least consistent with how units are organized in the city dialog
  2. Organize by transporter and then add some indicator or arrangement that makes it super easy to determine which unit has been loaded on the ship. Could also follow from Improve the UI for transport ships with loaded units in city view #1836
  3. If the units is "mine" and I want to move it to a different ship (also mine or one of my ally/team mates), I should be able to do it from this widget. Maybe via a drag and drop or a right-click menu option.

Describe alternatives you've considered
The usual of "leave it alone" comes to mind, but I think we can do better.

Additional context
Team games are FUN!

@jwrober jwrober added enhancement New feature or request Untriaged This issue or PR needs triaging gui This issue requires changes to the user interface and removed Untriaged This issue or PR needs triaging labels Feb 23, 2023
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue May 21, 2024
This patch makes the user interface look more consistent by sorting
units in two contexts:

* In the city dialog
* In the unit picker

The sorting logic is an improved version of code formerly used to sort
units in the city dialog (but that had been lost for some reasion). It
tries to produce a sort order that looks natural and is stable in time.
To do so:

* Loaded units are always sorted right after their transport, so one can
  tell in which transport they are loaded;
* The best defensive units go to the beginning of the list. These tend
  to stay in cities and not move around too much;
* Tie breaker by unit type and nationality ensure similar units are
  grouped together;
* Finally, the unit id is used as a last resort.

I tested this logic in a few contexts and it seems to achieve its goal.
With respect to the previous sorting function, I removed an order based
on unit activities (fortified, fortifying, sentried) because it felt
wrong to have a unit move in the list just because I changed its
activity.

Closes longturn#1836.
See longturn#1838.
@lmoureaux
Copy link
Contributor

For one, get rid of the menu thing so its easy to get a screen shot for sharing in a team or with an ally.

Wayland solves this, not supporting dying tech like X11 if it takes code.

  1. Organize by Nation and Unit type, maybe alpha order or at least consistent with how units are organized in the city dialog

This is done in #2288.

I don't like the idea of a tree widget as the main UI, because the grid we have is much easier to use when transports are not involved. I could imagine an "expand" button somewhere that would open a more complex dialog for such use cases.

The 3rd item (drag and drop for unit loading) would indeed be cool.

lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue May 21, 2024
This patch makes the user interface look more consistent by sorting
units in two contexts:

* In the city dialog
* In the unit picker

The sorting logic is an improved version of code formerly used to sort
units in the city dialog (but that had been lost for some reasion). It
tries to produce a sort order that looks natural and is stable in time.
To do so:

* Loaded units are always sorted right after their transport, so one can
  tell in which transport they are loaded;
* The best defensive units go to the beginning of the list. These tend
  to stay in cities and not move around too much;
* Tie breaker by unit type and nationality ensure similar units are
  grouped together;
* Finally, the unit id is used as a last resort.

I tested this logic in a few contexts and it seems to achieve its goal.
With respect to the previous sorting function, I removed an order based
on unit activities (fortified, fortifying, sentried) because it felt
wrong to have a unit move in the list just because I changed its
activity.

Closes longturn#1836.
See longturn#1838.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue May 21, 2024
This patch makes the user interface look more consistent by sorting
units in two contexts:

* In the city dialog
* In the unit picker

The sorting logic is an improved version of code formerly used to sort
units in the city dialog (but that had been lost for some reasion). It
tries to produce a sort order that looks natural and is stable in time.
To do so:

* Loaded units are always sorted right after their transport, so one can
  tell in which transport they are loaded;
* The best defensive units go to the beginning of the list. These tend
  to stay in cities and not move around too much;
* Tie breaker by unit type and nationality ensure similar units are
  grouped together;
* Finally, the unit id is used as a last resort.

I tested this logic in a few contexts and it seems to achieve its goal.
With respect to the previous sorting function, I removed an order based
on unit activities (fortified, fortifying, sentried) because it felt
wrong to have a unit move in the list just because I changed its
activity.

Closes longturn#1836.
See longturn#1838.
lmoureaux added a commit that referenced this issue Jun 13, 2024
This patch makes the user interface look more consistent by sorting
units in two contexts:

* In the city dialog
* In the unit picker

The sorting logic is an improved version of code formerly used to sort
units in the city dialog (but that had been lost for some reasion). It
tries to produce a sort order that looks natural and is stable in time.
To do so:

* Loaded units are always sorted right after their transport, so one can
  tell in which transport they are loaded;
* The best defensive units go to the beginning of the list. These tend
  to stay in cities and not move around too much;
* Tie breaker by unit type and nationality ensure similar units are
  grouped together;
* Finally, the unit id is used as a last resort.

I tested this logic in a few contexts and it seems to achieve its goal.
With respect to the previous sorting function, I removed an order based
on unit activities (fortified, fortifying, sentried) because it felt
wrong to have a unit move in the list just because I changed its
activity.

Closes #1836.
See #1838.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gui This issue requires changes to the user interface
Projects
None yet
Development

No branches or pull requests

2 participants