Skip to content

Commit

Permalink
Merge pull request #2454 from LmeSzinc/dev
Browse files Browse the repository at this point in the history
Bug fix
  • Loading branch information
LmeSzinc authored Apr 4, 2023
2 parents ac41f1c + 63633ae commit bea3be4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 13 deletions.
9 changes: 5 additions & 4 deletions module/equipment/equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ def equip_enter(self, click_button, check_button=EQUIPMENT_OPEN, long_click=True
break

# Long click accidentally became normal click, exit from dock
if self.appear(DOCK_CHECK, offset=(20, 20), interval=3):
logger.info(f'equip_enter {DOCK_CHECK} -> {BACK_ARROW}')
self.device.click(BACK_ARROW)
continue
if long_click:
if self.appear(DOCK_CHECK, offset=(20, 20), interval=3):
logger.info(f'equip_enter {DOCK_CHECK} -> {BACK_ARROW}')
self.device.click(BACK_ARROW)
continue
if enter_timer.reached():
if long_click:
self.device.long_click(click_button, duration=(1.5, 1.7))
Expand Down
11 changes: 6 additions & 5 deletions module/os/globe_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def globe_update(self):

self.device.screenshot()

# End
if self.is_in_globe():
break

# A copy of os_map_goto_globe()
# May accidentally enter map
if self.appear_then_click(MAP_GOTO_GLOBE, offset=(200, 5), interval=3):
Expand Down Expand Up @@ -63,11 +67,8 @@ def globe_update(self):
timeout.reset()
continue

if self.is_in_globe():
break
else:
logger.warning('Trying to do globe_update(), but not in os globe map')
continue
logger.warning('Trying to do globe_update(), but not in os globe map')
continue

self._globe_init()
self.globe.load(self.device.image)
Expand Down
8 changes: 4 additions & 4 deletions module/os/globe_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ def os_map_goto_globe(self, unpin=True, skip_first_screenshot=True):
else:
self.device.screenshot()

# End
if self.is_in_globe():
break

if self.appear_then_click(MAP_GOTO_GLOBE, offset=(200, 5), interval=5):
# Just to initialize interval timer of MAP_GOTO_GLOBE_FOG
self.appear(MAP_GOTO_GLOBE_FOG, interval=5)
Expand Down Expand Up @@ -324,10 +328,6 @@ def os_map_goto_globe(self, unpin=True, skip_first_screenshot=True):
if self.handle_popup_confirm('GOTO_GLOBE'):
continue

# End
if self.is_in_globe():
break

skip_first_screenshot = True
confirm_timer = Timer(1, count=2).start()
unpinned = 0
Expand Down
18 changes: 18 additions & 0 deletions module/os/globe_zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,24 @@ def parse_name(n):
return zone
if name == parse_name(zone.tw):
return zone
# Normal arbiter, Hard arbiter, BOSS after hard arbiter cleared
# 普通难度:仲裁者·XXX, 困难难度:仲裁者·XXX, 困难模拟战:仲裁机关
for keyword in ['普通', '困难', '仲裁']:
if keyword in name:
return self.name_to_zone(154)
# Normal - Arbiter: XXX, Hard - Arbiter: XXX, Hard - Arbiter (Practice)
for keyword in ['normal', 'hard', 'arbiter']:
if keyword in name:
return self.name_to_zone(154)
# ノーマル:アビータ・XXX, ハード:アビータ・XXX, ハード模擬戦:アビータ
for keyword in ['ノーマル', 'ハード', 'アビータ',
'ノ一マル', 'ハ一ド', 'アビ一タ']:
if keyword in name:
return self.name_to_zone(154)
# 普通難度:仲裁者·XXX, 困難難度:仲裁者·XXX, 困難模擬戰:仲裁機關
for keyword in ['普通', '困難', '仲裁']:
if keyword in name:
return self.name_to_zone(154)
raise ScriptError(f'Unable to find OS globe zone: {name}')

def zone_nearest_azur_port(self, zone):
Expand Down

0 comments on commit bea3be4

Please sign in to comment.