mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-26 02:11:06 +00:00
Opt: Improve log appearance in battle pass
This commit is contained in:
parent
a27c6015b8
commit
d9b8c0db08
@ -68,7 +68,6 @@ class BattlePassUI(UI):
|
|||||||
self.battle_pass_goto(KEYWORDS_DUNGEON_TAB.Missions)
|
self.battle_pass_goto(KEYWORDS_DUNGEON_TAB.Missions)
|
||||||
self.battle_pass_goto(KEYWORDS_DUNGEON_TAB.Rewards)
|
self.battle_pass_goto(KEYWORDS_DUNGEON_TAB.Rewards)
|
||||||
"""
|
"""
|
||||||
logger.hr('Battle pass tab goto', level=2)
|
|
||||||
self.ui_ensure(page_battle_pass)
|
self.ui_ensure(page_battle_pass)
|
||||||
if SWITCH_BATTLE_PASS_TAB.set(state, main=self):
|
if SWITCH_BATTLE_PASS_TAB.set(state, main=self):
|
||||||
logger.info(f'Tab goto {state}, wait until loaded')
|
logger.info(f'Tab goto {state}, wait until loaded')
|
||||||
@ -93,6 +92,7 @@ class BattlePassUI(UI):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def _claim_exp(self, skip_first_screenshot=True):
|
def _claim_exp(self, skip_first_screenshot=True):
|
||||||
|
logger.hr('Claim EXP', level=1)
|
||||||
self.battle_pass_goto(KEYWORD_BATTLE_PASS_TAB.Missions)
|
self.battle_pass_goto(KEYWORD_BATTLE_PASS_TAB.Missions)
|
||||||
claimed = False
|
claimed = False
|
||||||
while 1:
|
while 1:
|
||||||
@ -102,14 +102,18 @@ class BattlePassUI(UI):
|
|||||||
self.device.screenshot()
|
self.device.screenshot()
|
||||||
|
|
||||||
if not self.appear(EXP_CLAIM_ALL):
|
if not self.appear(EXP_CLAIM_ALL):
|
||||||
|
logger.info('No more EXP to claim')
|
||||||
break
|
break
|
||||||
if self.appear_then_click(EXP_CLAIM_ALL):
|
if self.appear_then_click(EXP_CLAIM_ALL):
|
||||||
claimed = True
|
claimed = True
|
||||||
logger.info("All EXP claimed")
|
logger.info("All EXP claimed")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
logger.attr('EXP claimed', claimed)
|
||||||
return claimed
|
return claimed
|
||||||
|
|
||||||
def _claim_rewards(self, skip_first_screenshot=True):
|
def _claim_rewards(self, skip_first_screenshot=True):
|
||||||
|
logger.hr('Claim rewards', level=1)
|
||||||
self.battle_pass_goto(KEYWORD_BATTLE_PASS_TAB.Rewards)
|
self.battle_pass_goto(KEYWORD_BATTLE_PASS_TAB.Rewards)
|
||||||
while 1:
|
while 1:
|
||||||
if skip_first_screenshot:
|
if skip_first_screenshot:
|
||||||
@ -117,7 +121,11 @@ class BattlePassUI(UI):
|
|||||||
else:
|
else:
|
||||||
self.device.screenshot()
|
self.device.screenshot()
|
||||||
|
|
||||||
if self.appear(GET_REWARD) or self.appear(CLOSE_CHOOSE_GIFT):
|
if self.appear(GET_REWARD):
|
||||||
|
logger.info('Get reward')
|
||||||
|
break
|
||||||
|
if self.appear(CLOSE_CHOOSE_GIFT):
|
||||||
|
logger.info('Got reward but have gift to choose')
|
||||||
break
|
break
|
||||||
if self.appear_then_click(REWARDS_CLAIM_ALL):
|
if self.appear_then_click(REWARDS_CLAIM_ALL):
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user