Skip to content

Commit

Permalink
Merge pull request #672 from LmeSzinc/master
Browse files Browse the repository at this point in the history
[pull] master from LmeSzinc:master
  • Loading branch information
pull[bot] authored Sep 16, 2024
2 parents 02ced95 + b88e0df commit 3741f6e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
Binary file added assets/en/combat_ui/QUIT_Iridescent_Fantasy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/en/combat_ui/QUIT_New.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions module/combat/combat.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ def is_combat_loading(self):
def is_combat_executing(self):
"""
Returns:
bool:
Button: PAUSE button that appears
"""
self.device.stuck_record_add(PAUSE)
if self.config.SERVER in ['cn', 'en']:
if PAUSE.match_luma(self.device.image, offset=(20, 20)):
return True
return PAUSE
else:
color = get_color(self.device.image, PAUSE.area)
if color_similar(color, PAUSE.color) or color_similar(color, (238, 244, 248)):
if np.max(self.image_crop(PAUSE_DOUBLE_CHECK, copy=False)) < 153:
return True
return PAUSE
if PAUSE_New.match_luma(self.device.image, offset=(20, 20)):
return True
return PAUSE_New
if PAUSE_Iridescent_Fantasy.match_luma(self.device.image, offset=(20, 20)):
return True
return PAUSE_Iridescent_Fantasy
return False

def handle_combat_quit(self, offset=(20, 20), interval=3):
Expand Down
4 changes: 2 additions & 2 deletions module/combat_ui/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
PAUSE_Iridescent_Fantasy = Button(area={'cn': (1232, 33, 1252, 57), 'en': (1232, 33, 1252, 57), 'jp': (1232, 33, 1252, 57), 'tw': (1232, 33, 1252, 57)}, color={'cn': (124, 139, 190), 'en': (124, 139, 190), 'jp': (124, 139, 190), 'tw': (124, 139, 190)}, button={'cn': (1232, 33, 1252, 57), 'en': (1232, 33, 1252, 57), 'jp': (1232, 33, 1252, 57), 'tw': (1232, 33, 1252, 57)}, file={'cn': './assets/cn/combat_ui/PAUSE_Iridescent_Fantasy.png', 'en': './assets/en/combat_ui/PAUSE_Iridescent_Fantasy.png', 'jp': './assets/jp/combat_ui/PAUSE_Iridescent_Fantasy.png', 'tw': './assets/tw/combat_ui/PAUSE_Iridescent_Fantasy.png'})
PAUSE_New = Button(area={'cn': (1231, 29, 1253, 56), 'en': (1231, 29, 1253, 56), 'jp': (1231, 29, 1253, 56), 'tw': (1231, 29, 1253, 56)}, color={'cn': (156, 158, 166), 'en': (156, 158, 166), 'jp': (156, 158, 166), 'tw': (156, 158, 166)}, button={'cn': (1231, 29, 1253, 56), 'en': (1231, 29, 1253, 56), 'jp': (1231, 29, 1253, 56), 'tw': (1231, 29, 1253, 56)}, file={'cn': './assets/cn/combat_ui/PAUSE_New.png', 'en': './assets/en/combat_ui/PAUSE_New.png', 'jp': './assets/jp/combat_ui/PAUSE_New.png', 'tw': './assets/tw/combat_ui/PAUSE_New.png'})
QUIT = Button(area={'cn': (420, 490, 593, 548), 'en': (459, 508, 582, 532), 'jp': (433, 490, 606, 547), 'tw': (433, 490, 606, 547)}, color={'cn': (199, 122, 114), 'en': (221, 177, 174), 'jp': (196, 120, 113), 'tw': (200, 126, 118)}, button={'cn': (420, 490, 593, 548), 'en': (459, 508, 582, 532), 'jp': (433, 490, 606, 547), 'tw': (433, 490, 606, 547)}, file={'cn': './assets/cn/combat_ui/QUIT.png', 'en': './assets/en/combat_ui/QUIT.png', 'jp': './assets/jp/combat_ui/QUIT.png', 'tw': './assets/tw/combat_ui/QUIT.png'})
QUIT_Iridescent_Fantasy = Button(area={'cn': (391, 522, 464, 540), 'en': (391, 522, 464, 540), 'jp': (391, 522, 464, 540), 'tw': (391, 522, 464, 540)}, color={'cn': (121, 73, 79), 'en': (121, 73, 79), 'jp': (121, 73, 79), 'tw': (121, 73, 79)}, button={'cn': (391, 522, 464, 540), 'en': (391, 522, 464, 540), 'jp': (391, 522, 464, 540), 'tw': (391, 522, 464, 540)}, file={'cn': './assets/cn/combat_ui/QUIT_Iridescent_Fantasy.png', 'en': './assets/cn/combat_ui/QUIT_Iridescent_Fantasy.png', 'jp': './assets/cn/combat_ui/QUIT_Iridescent_Fantasy.png', 'tw': './assets/cn/combat_ui/QUIT_Iridescent_Fantasy.png'})
QUIT_New = Button(area={'cn': (394, 506, 467, 524), 'en': (394, 506, 467, 524), 'jp': (394, 506, 467, 524), 'tw': (394, 506, 467, 524)}, color={'cn': (255, 180, 171), 'en': (255, 180, 171), 'jp': (255, 180, 171), 'tw': (255, 180, 171)}, button={'cn': (394, 506, 467, 524), 'en': (394, 506, 467, 524), 'jp': (394, 506, 467, 524), 'tw': (394, 506, 467, 524)}, file={'cn': './assets/cn/combat_ui/QUIT_New.png', 'en': './assets/cn/combat_ui/QUIT_New.png', 'jp': './assets/cn/combat_ui/QUIT_New.png', 'tw': './assets/cn/combat_ui/QUIT_New.png'})
QUIT_Iridescent_Fantasy = Button(area={'cn': (391, 522, 464, 540), 'en': (392, 524, 466, 538), 'jp': (391, 522, 464, 540), 'tw': (391, 522, 464, 540)}, color={'cn': (121, 73, 79), 'en': (143, 74, 76), 'jp': (121, 73, 79), 'tw': (121, 73, 79)}, button={'cn': (391, 522, 464, 540), 'en': (392, 524, 466, 538), 'jp': (391, 522, 464, 540), 'tw': (391, 522, 464, 540)}, file={'cn': './assets/cn/combat_ui/QUIT_Iridescent_Fantasy.png', 'en': './assets/en/combat_ui/QUIT_Iridescent_Fantasy.png', 'jp': './assets/cn/combat_ui/QUIT_Iridescent_Fantasy.png', 'tw': './assets/cn/combat_ui/QUIT_Iridescent_Fantasy.png'})
QUIT_New = Button(area={'cn': (394, 506, 467, 524), 'en': (395, 507, 470, 522), 'jp': (394, 506, 467, 524), 'tw': (394, 506, 467, 524)}, color={'cn': (255, 180, 171), 'en': (255, 211, 206), 'jp': (255, 180, 171), 'tw': (255, 180, 171)}, button={'cn': (394, 506, 467, 524), 'en': (395, 507, 470, 522), 'jp': (394, 506, 467, 524), 'tw': (394, 506, 467, 524)}, file={'cn': './assets/cn/combat_ui/QUIT_New.png', 'en': './assets/en/combat_ui/QUIT_New.png', 'jp': './assets/cn/combat_ui/QUIT_New.png', 'tw': './assets/cn/combat_ui/QUIT_New.png'})
10 changes: 6 additions & 4 deletions module/exercise/combat.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ def _combat_execute(self):
if not end:
if self._at_low_hp(image=self.device.image):
logger.info('Exercise quit')
if pause_interval.reached() and self.is_combat_executing():
self.device.click(PAUSE)
pause_interval.reset()
continue
if pause_interval.reached():
pause = self.is_combat_executing()
if pause:
self.device.click(pause)
pause_interval.reset()
continue
else:
if show_hp_timer.reached():
show_hp_timer.reset()
Expand Down
12 changes: 7 additions & 5 deletions module/os/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,13 @@ def interrupt_auto_search(self, skip_first_screenshot=True):

if self.appear_then_click(AUTO_SEARCH_REWARD, offset=(50, 50), interval=3):
continue
if pause_interval.reached() and self.is_combat_executing():
self.device.click(PAUSE)
self.interval_reset(MAINTENANCE_ANNOUNCE)
pause_interval.reset()
continue
if pause_interval.reached():
pause = self.is_combat_executing()
if pause:
self.device.click(pause)
self.interval_reset(MAINTENANCE_ANNOUNCE)
pause_interval.reset()
continue
if self.handle_combat_quit():
self.interval_reset(MAINTENANCE_ANNOUNCE)
pause_interval.reset()
Expand Down

0 comments on commit 3741f6e

Please sign in to comment.