From 7f96e98e5082d839275571d76004e7f0f1b7709a Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:33:10 +0800 Subject: [PATCH] Fix: Override click_button of BattlePassTab --- tasks/battle_pass/battle_pass.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tasks/battle_pass/battle_pass.py b/tasks/battle_pass/battle_pass.py index 000c3ce3f..03b1758a8 100644 --- a/tasks/battle_pass/battle_pass.py +++ b/tasks/battle_pass/battle_pass.py @@ -23,6 +23,14 @@ from tasks.item.assets.assets_item_ui import SWITCH_CLICK class BattlePassTab(Switch): + def add_state(self, state, check_button, click_button=None): + if click_button is not None: + # Limit click_button.button + left = SWITCH_CLICK.area[0] + for button in click_button.buttons: + button._button = (left, button._button[1], button._button[2], button._button[3]) + return super().add_state(state, check_button, click_button) + def handle_additional(self, main: UI): if main.handle_reward(): return True @@ -43,14 +51,6 @@ SWITCH_BATTLE_PASS_TAB.add_state( class BattlePassMissionTab(Switch): - def add_state(self, state, check_button, click_button=None): - if click_button is not None: - # Limit click_button.button - left = SWITCH_CLICK.area[0] - for button in click_button.buttons: - button._button = (left, button._button[1], button._button[2], button._button[3]) - return super().add_state(state, check_button, click_button) - def get(self, main): """ Args: