Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MP Lobby: refactored game entry code
This fixes #2121. This code was an absolute mess. It relied entirely on finding games by-index, despite there also being a simple function in lobby_data to get a game by id. I had even written code to take an id, find a game_info ptr, then search the games vector for a match, get an index, and then use that index to access the games vector later :| *facepalm* Binding indices with callbacks meant certain callbacks such as the list double click handler needed to be constantly re-added. We also had no bounds checking in said callback. And for some reason, the inline join/observe buttons were handled by the same code as their global counterparts (#2121). Just... a mess. Now we can directly handle joining by either index or game id directly. The former is now only used for the global join/observe buttons' callback, but it could potentially be used with the plugin context code, if applicable. It depends on whether the plugin data has an index key.
- Loading branch information
1 parent
f08ca94
commit ce89e25
Showing
2 changed files
with
136 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters