#3278 closed enhancement (duplicate)
Lobby - sortable lists
Reported by: | elexis | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | |
Component: | Multiplayer lobby | Keywords: | |
Cc: | Patch: |
Description
(1) Enhancement: The list of players and games in the lobby should be sortable.
An arrow icon would be nice to indicate that function. If you click it it should change between ascending and descending order.
It could use the ModernDropDownArrow
sprite (defined in binaries/data/mods/mod/gui/common/modern/sprites.xml). This sprite uses global/modern/dropdown-arrow.png. This icon could be mirrored to indicate the other order.
The lists should be sortable by each attribute.
(2) Bugfix: When the playerlist is refreshed, it is replaced with a alphabetically sorted list. But if another player joins, he/she is appended to the end of the list, instead of the correct place.
Attachments (1)
Change History (13)
by , 9 years ago
Attachment: | sorted_list.png added |
---|
follow-up: 2 comment:1 by , 9 years ago
follow-up: 3 comment:2 by , 9 years ago
Replying to vladislavbelov:
It should look like this?
Yes, that is what I had in mind. I'm not sure if its better if the icon is displayed at the left or at the right side of the column (might look like the arrow is on the left side when it is actually on the right on that screenshot).
And how highlight the attribute, which was selected?
This ticket is somewhat related to that question: #3244, in particular attachment:t3244_keep_gamelist_selection_r16665.patch:ticket:3244. You just have to set the gamesBox.selected
variable to the index you want to select.
If that patch is committed, then you know the previously selected server by the g_selectedGameIP variable (I used the IP address as a unique identifier for the selected server).
Thanks for taking a look at this.
follow-up: 4 comment:3 by , 9 years ago
Replying to elexis:
This ticket is somewhat related to that question: #3244, in particular attachment:t3244_keep_gamelist_selection_r16665.patch:ticket:3244. You just have to set the
gamesBox.selected
variable to the index you want to select. If that patch is committed, then you know the previously selected server by the g_selectedGameIP variable (I used the IP address as a unique identifier for the selected server).
I mean not a row, but a column selection with attribute, which was selected for sorting.
follow-up: 5 comment:4 by , 9 years ago
Replying to vladislavbelov:
I mean not a row, but a column selection with attribute, which was selected for sorting.
If you click that icon, then you know the row, you can save it to a variable. If a gamelist update arrives, then you know by that variable which column was selected.
You are also welcome to https://webchat.quakenet.org/?channels=0ad-dev if you want to ask more questions.
comment:5 by , 9 years ago
Replying to elexis:
Maybe create style like ModernButtonOrder
, instead of using sprite in lobby.xml
?
follow-up: 8 comment:7 by , 9 years ago
The "sortable list" feature could be implemented for all lists, so that you have to do it only once and not for each list object.
In the xml files the list is defined by the type="olist"
attribute. You could add an sortable="true"
attribute to the lobby.xml lists.
The behavior of the olist is defined in source/gui/COList.cpp
.
In the c++ part, you can find out if it is sortable with: GUI<bool>::GetSetting(this, "sortable", sortable);
You can add some calls to debug_printf to find out which part is called when (I don't know anything about that code part either for now).
comment:8 by , 9 years ago
Replying to elexis:
The "sortable list" feature could be implemented for all lists, so that you have to do it only once and not for each list object.
In the xml files the list is defined by the
type="olist"
attribute. You could add ansortable="true"
attribute to the lobby.xml lists.The behavior of the olist is defined in
source/gui/COList.cpp
.In the c++ part, you can find out if it is sortable with: GUI<bool>::GetSetting(this, "sortable", sortable);
You can add some calls to debug_printf to find out which part is called when (I don't know anything about that code part either for now).
Yep, I know about behavior of the olist, and I'm already thinking about adding this feature to olist. But need show an order near the title of attribute. It's can be the arrow text or image (e.g. "Name (Asc.)").
comment:10 by , 9 years ago
follow-up: 12 comment:11 by , 9 years ago
Milestone: | Backlog |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Dupe of #2405.
Icons should just be defined in the style properties of the list. Icons used might just be placeholders which we can fix later on. If we go with an arrow that should be to the right of the column heading (as it is for every other gui I've encountered).
comment:12 by , 9 years ago
Replying to leper:
Dupe of #2405.
Icons should just be defined in the style properties of the list. Icons used might just be placeholders which we can fix later on. If we go with an arrow that should be to the right of the column heading (as it is for every other gui I've encountered).
Yep, it's duplicate, but more common ticket. The question about COList I have moved to #2405.
It should look like this? And how highlight the attribute, which was selected?