Skip to content

Commit f23d4fb

Browse files
committed
Fix: Handle map event in port_enter()
1 parent 912c74b commit f23d4fb

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

module/os_handler/port.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,20 @@
1111

1212

1313
class PortHandler(OSShop):
14-
def port_enter(self, skip_first_screenshot=True):
14+
def port_enter(self):
1515
"""
1616
Pages:
1717
in: IN_MAP
1818
out: PORT_CHECK
1919
"""
20-
self.ui_click(PORT_ENTER, check_button=PORT_CHECK, skip_first_screenshot=skip_first_screenshot)
20+
logger.info('Port enter')
21+
for _ in self.loop():
22+
if self.appear(PORT_CHECK, offset=(20, 20)):
23+
break
24+
if self.appear_then_click(PORT_ENTER, offset=(20, 20), interval=5):
25+
continue
26+
if self.handle_map_event():
27+
continue
2128
# Buttons at the bottom has an animation to show
2229
pass # Already ensured in ui_click
2330

@@ -27,6 +34,7 @@ def port_quit(self, skip_first_screenshot=True):
2734
in: PORT_CHECK
2835
out: IN_MAP
2936
"""
37+
logger.info('Port quit')
3038
self.ui_back(appear_button=PORT_CHECK, check_button=self.is_in_map,
3139
skip_first_screenshot=skip_first_screenshot)
3240
# Buttons at the bottom has an animation to show

0 commit comments

Comments
 (0)