Eagle_rainbow wrote:
I will have a look on the "list_pos" thingy soon and revert back to this thread with updates.
Here we go with my update.
In the previous patches 'list_pos' is not handled properly. This leads to a very strange (not to say erratic

) behaviour when using the cursor keys for example. Also sorting could happen to become quite strange. Having had a second thought, I started to dislike my initial approach pushing down the filtering concept to the _network_game_list. This linked list is more or less a technical thing whilst sorting, filtering and list_pos stuff tend to be "lightweight" GUI-related things. This gets even more apparent, if you are looking at 'GUIGameServerList' which also has a capability of filtering.
I now reimplemented the entire patch to make use of FilterFunctions in the server list. This had the side-effect that BuildNetworkGameList became a bit more powerful, as it now has to handle sorting as well (which IMHO isn't a bad idea either, because it makes life easier keeping the list consistent). As there is a clear difference between _network_game_list and the servers vector now, I also changed the name of BuildNetworkGameList to BuildGUINetworkGameList to stress that difference (previously, the two lists where kept in sync, especially with regard to sorting which isn't worthwhile anymore due to filtering). This resolved a lot of issues which otherwise I would have had to "code around" and would have been evil to understand later on (for example: changing sort order when list is filtered).
Please find attached the newest version of this patch:
However, during testing this version, I found one thing that still looks inconsistent to me: Though the cursor keys are working properly now, the effect of pressing Home or End now depends on the current focus: If the focus is with one of the edit boxes, you'll change the cursor position within the edit box. If the focus is with the matrix, you'll navigate through the server's list. What makes it really a mess, is the fact, that the PageUp/Down keys are working regardless of the current focus (and will change the list_pos)

. My first thought on this was to disable the Home and End keys for the server list entirely - but that is most likely due to the fact that I don't use them at all (and before having had read the coding, didn't even know that this feature existed

). However, ignorance isn't a good reasoning after all. The other alternative is to disable PageUp/Down, if the focus is with the edit boxes. Yet, I don't have a preference on how to resolve that.
Do you have another good idea?
PS: We might need to have another round of reviews on it later, as several things have changed again. Yet, I didn't have a full passthrough on the diff myself, so there still could be some quirks in there (hopefully coding style only).