Fix: Retry if no characters detected

This commit is contained in:
LmeSzinc 2023-12-11 11:04:58 +08:00
parent 5c5181f1d2
commit 59ea801b21

View File

@ -60,6 +60,8 @@ class CharacterSwitch(UI):
self.character_current = self._convert_selected_to_character(self._update_current_character()) self.character_current = self._convert_selected_to_character(self._update_current_character())
# Must contain first character # Must contain first character
if not buttons:
continue
expected_peaks = np.array([201, 279, 357, 435]) expected_peaks = np.array([201, 279, 357, 435])
if buttons[0].area[3] < expected_peaks[0]: if buttons[0].area[3] < expected_peaks[0]:
break break