Fix: Limit button of side tabs to avoid clicking on the cloud game float

This commit is contained in:
LmeSzinc 2024-06-15 02:06:24 +08:00
parent e75a9a90a8
commit 55ddf7fb4d
4 changed files with 23 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -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:

View File

@ -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(

View File

@ -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):