Skip to content

Commit e483f33

Browse files
committed
Fix: check NO_NAV_EVENT_CHECK before deciding no event shop
1 parent 16485ab commit e483f33

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed
7.84 KB
Loading

module/shop_event/assets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Don't modify it manually.
66

77
EVENT_SHOP_SCROLL_AREA = Button(area={'cn': (1064, 201, 1065, 623), 'en': (1064, 201, 1065, 623), 'jp': (1064, 201, 1065, 623), 'tw': (1064, 201, 1065, 623)}, color={'cn': (130, 130, 141), 'en': (130, 130, 141), 'jp': (130, 130, 141), 'tw': (130, 130, 141)}, button={'cn': (1064, 201, 1065, 623), 'en': (1064, 201, 1065, 623), 'jp': (1064, 201, 1065, 623), 'tw': (1064, 201, 1065, 623)}, file={'cn': './assets/cn/shop_event/EVENT_SHOP_SCROLL_AREA.png', 'en': './assets/cn/shop_event/EVENT_SHOP_SCROLL_AREA.png', 'jp': './assets/cn/shop_event/EVENT_SHOP_SCROLL_AREA.png', 'tw': './assets/cn/shop_event/EVENT_SHOP_SCROLL_AREA.png'})
8+
NO_NAV_EVENT_CHECK = Button(area={'cn': (20, 545, 46, 571), 'en': (20, 545, 46, 571), 'jp': (20, 545, 46, 571), 'tw': (20, 545, 46, 571)}, color={'cn': (148, 184, 201), 'en': (148, 184, 201), 'jp': (148, 184, 201), 'tw': (148, 184, 201)}, button={'cn': (20, 545, 46, 571), 'en': (20, 545, 46, 571), 'jp': (20, 545, 46, 571), 'tw': (20, 545, 46, 571)}, file={'cn': './assets/cn/shop_event/NO_NAV_EVENT_CHECK.png', 'en': './assets/cn/shop_event/NO_NAV_EVENT_CHECK.png', 'jp': './assets/cn/shop_event/NO_NAV_EVENT_CHECK.png', 'tw': './assets/cn/shop_event/NO_NAV_EVENT_CHECK.png'})
89
SHOP_EVENT_DEADLINE = Button(area={'cn': (217, 161, 751, 186), 'en': (217, 161, 751, 186), 'jp': (217, 161, 751, 186), 'tw': (217, 161, 751, 186)}, color={'cn': (255, 255, 255), 'en': (255, 255, 255), 'jp': (255, 255, 255), 'tw': (255, 255, 255)}, button={'cn': (217, 161, 751, 186), 'en': (217, 161, 751, 186), 'jp': (217, 161, 751, 186), 'tw': (217, 161, 751, 186)}, file={'cn': './assets/cn/shop_event/SHOP_EVENT_DEADLINE.png', 'en': './assets/cn/shop_event/SHOP_EVENT_DEADLINE.png', 'jp': './assets/cn/shop_event/SHOP_EVENT_DEADLINE.png', 'tw': './assets/cn/shop_event/SHOP_EVENT_DEADLINE.png'})
910
SHOP_OCR_BALANCE_SECOND = Button(area={'cn': (845, 164, 927, 189), 'en': (845, 164, 927, 189), 'jp': (845, 164, 927, 189), 'tw': (845, 164, 927, 189)}, color={'cn': (255, 255, 255), 'en': (255, 255, 255), 'jp': (255, 255, 255), 'tw': (255, 255, 255)}, button={'cn': (845, 164, 927, 189), 'en': (845, 164, 927, 189), 'jp': (845, 164, 927, 189), 'tw': (845, 164, 927, 189)}, file={'cn': './assets/cn/shop_event/SHOP_OCR_BALANCE_SECOND.png', 'en': './assets/cn/shop_event/SHOP_OCR_BALANCE_SECOND.png', 'jp': './assets/cn/shop_event/SHOP_OCR_BALANCE_SECOND.png', 'tw': './assets/cn/shop_event/SHOP_OCR_BALANCE_SECOND.png'})
1011
TEMPLATE_COST_PRICE_BACKGROUND = Template(file={'cn': './assets/cn/shop_event/TEMPLATE_COST_PRICE_BACKGROUND.png', 'en': './assets/cn/shop_event/TEMPLATE_COST_PRICE_BACKGROUND.png', 'jp': './assets/cn/shop_event/TEMPLATE_COST_PRICE_BACKGROUND.png', 'tw': './assets/cn/shop_event/TEMPLATE_COST_PRICE_BACKGROUND.png'})

module/shop_event/shop_event.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,12 @@ def run(self):
256256
timeout.reset()
257257

258258
if self.appear(NAV_GENERAL, offset=(5, 5)):
259-
logger.info("There is no event shop currently. End the task.")
260-
self.config.task_delay(server_update=True)
261-
return False
259+
if self.appear(NO_NAV_EVENT_CHECK, offset=(5, 5)):
260+
logger.info("There is no event shop currently. End the task.")
261+
self.config.task_delay(server_update=True)
262+
return False
263+
else:
264+
self.ui_click(NAV_EVENT, check_button=NAV_EVENT, appear_button=NAV_GENERAL)
262265

263266
count, navbar = self.event_shop_tab_count_and_navbar
264267
logger.info(f"Detected {count} event shop(s). Start processing.")

0 commit comments

Comments
 (0)