@@ -108,7 +108,7 @@ class Menu(Base):
108
108
_auto_centering : bool
109
109
_background_function : Tuple [bool , Optional [Union [Callable [['Menu' ], Any ], CallableNoArgsType ]]]
110
110
_clock : 'pygame.time.Clock'
111
- _column_max_width : VectorType
111
+ _column_max_width : Union [ List [ None ], VectorType ]
112
112
_column_max_width_zero : List [bool ]
113
113
_column_min_width : VectorType
114
114
_column_pos_x : List [NumberType ]
@@ -339,6 +339,7 @@ def __init__(
339
339
# Check that every column max width is equal or greater than minimum width
340
340
for i in range (len (column_max_width )):
341
341
if column_max_width [i ] is not None :
342
+ # noinspection PyTypeChecker
342
343
assert column_max_width [i ] >= column_min_width [i ], \
343
344
f'item { i } of column_max_width ({ column_max_width [i ]} ) must be equal or greater ' \
344
345
f'than column_min_width ({ column_min_width [i ]} )'
@@ -724,6 +725,7 @@ def resize(
724
725
# Update column max width
725
726
for i in range (len (self ._column_max_width )):
726
727
if self ._column_max_width_zero [i ]:
728
+ # noinspection PyTypeChecker
727
729
self ._column_max_width [i ] = self ._width
728
730
729
731
# Force the rendering
@@ -2280,6 +2282,7 @@ def _exit(self) -> None:
2280
2282
# noinspection PyUnresolvedReferences,PyProtectedMember
2281
2283
os ._exit (1 )
2282
2284
# This should be unreachable
2285
+ # noinspection PyUnreachableCode
2283
2286
exit (0 )
2284
2287
2285
2288
def is_enabled (self ) -> bool :
@@ -2652,19 +2655,19 @@ def update(self, events: EventVectorType) -> bool:
2652
2655
2653
2656
elif self ._ctrl .joy_down (event , self ):
2654
2657
if self ._current ._up (apply_sound = True ):
2655
- self ._current ._last_update_mode = _events .MENU_LAST_MOVE_UP
2658
+ self ._current ._last_update_mode = [ _events .MENU_LAST_MOVE_UP ]
2656
2659
updated = True
2657
2660
break
2658
2661
2659
2662
elif self ._ctrl .joy_left (event , self ):
2660
2663
if self ._current ._left (apply_sound = True ):
2661
- self ._current ._last_update_mode = _events .MENU_LAST_MOVE_LEFT
2664
+ self ._current ._last_update_mode = [ _events .MENU_LAST_MOVE_LEFT ]
2662
2665
updated = True
2663
2666
break
2664
2667
2665
2668
elif self ._ctrl .joy_right (event , self ):
2666
2669
if self ._current ._right (apply_sound = True ):
2667
- self ._current ._last_update_mode = _events .MENU_LAST_MOVE_RIGHT
2670
+ self ._current ._last_update_mode = [ _events .MENU_LAST_MOVE_RIGHT ]
2668
2671
updated = True
2669
2672
break
2670
2673
0 commit comments