diff --git a/assets/share/item/ui/SWITCH_CLICK.png b/assets/share/item/ui/SWITCH_CLICK.png new file mode 100644 index 000000000..15422a752 Binary files /dev/null and b/assets/share/item/ui/SWITCH_CLICK.png differ diff --git a/tasks/battle_pass/battle_pass.py b/tasks/battle_pass/battle_pass.py index 4386dd136..3ad213e10 100644 --- a/tasks/battle_pass/battle_pass.py +++ b/tasks/battle_pass/battle_pass.py @@ -19,6 +19,7 @@ from tasks.base.page import page_battle_pass, page_main from tasks.base.ui import UI from tasks.battle_pass.assets.assets_battle_pass import * from tasks.battle_pass.keywords import * +from tasks.item.assets.assets_item_ui import SWITCH_CLICK class BattlePassTab(Switch): @@ -42,6 +43,14 @@ 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: diff --git a/tasks/item/assets/assets_item_ui.py b/tasks/item/assets/assets_item_ui.py index 63bf672f9..7a4631211 100644 --- a/tasks/item/assets/assets_item_ui.py +++ b/tasks/item/assets/assets_item_ui.py @@ -103,6 +103,16 @@ RELICS_CLICK = ButtonWrapper( button=(36, 298, 78, 319), ), ) +SWITCH_CLICK = ButtonWrapper( + name='SWITCH_CLICK', + share=Button( + file='./assets/share/item/ui/SWITCH_CLICK.png', + area=(59, 60, 94, 672), + search=(39, 40, 114, 692), + color=(75, 79, 87), + button=(59, 60, 94, 672), + ), +) SWITCH_SEARCH = ButtonWrapper( name='SWITCH_SEARCH', share=Button( diff --git a/tasks/item/ui.py b/tasks/item/ui.py index 0fcc342e5..6e2c503a2 100644 --- a/tasks/item/ui.py +++ b/tasks/item/ui.py @@ -13,6 +13,10 @@ class SwitchItemTab(Switch): check_button.load_search(SWITCH_SEARCH.area) if click_button is not None: click_button.load_search(SWITCH_SEARCH.area) + # 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 click(self, state, main):