@@ -189,15 +189,15 @@ def pop(self, key, default=None):
189
189
# =============================================================================
190
190
# >> FUNCTIONS
191
191
# =============================================================================
192
- def _validate_selection (player_info , command , valid_choices ):
192
+ def _validate_selection (command , index , valid_choices ):
193
193
"""Validate a selection command.
194
194
195
- @param <player_infor>:
196
- A PlayerInfo instance.
197
-
198
195
@param <command>:
199
196
A Command instance.
200
197
198
+ @param <index>:
199
+ The player index that issued the command.
200
+
201
201
@param <valid_choices>:
202
202
A list of integers that defines all valid choices
203
203
"""
@@ -208,7 +208,7 @@ def _validate_selection(player_info, command, valid_choices):
208
208
return (None , None )
209
209
210
210
if choice in valid_choices :
211
- return (index_from_playerinfo ( player_info ) , choice )
211
+ return (index , choice )
212
212
213
213
return (None , None )
214
214
@@ -242,21 +242,21 @@ def _esc_refresh():
242
242
# >> CLIENT COMMANDS
243
243
# =============================================================================
244
244
@ClientCommand ('menuselect' )
245
- def _menuselect_callback (player_info , command ):
245
+ def _menuselect_callback (command , index ):
246
246
"""Forward the selection to the proper user queue."""
247
247
from menus .radio import VALID_CHOICES
248
248
249
- index , choice = _validate_selection (player_info , command , VALID_CHOICES )
249
+ index , choice = _validate_selection (command , index , VALID_CHOICES )
250
250
if index is not None :
251
251
_radio_queues [index ]._select (choice )
252
252
253
253
254
254
@ClientCommand (ESC_SELECTION_CMD )
255
- def _escselect_callback (player_info , command ):
255
+ def _escselect_callback (command , index ):
256
256
"""Forward the selection to the proper user queue."""
257
257
from menus .esc import VALID_CHOICES
258
258
259
- index , choice = _validate_selection (player_info , command , VALID_CHOICES )
259
+ index , choice = _validate_selection (command , index , VALID_CHOICES )
260
260
if index is not None :
261
261
_esc_queues [index ]._select (choice )
262
262
0 commit comments