Fix: Assigment tab was using dungeon's search area (fixed #534)

This commit is contained in:
LmeSzinc 2024-06-20 03:03:07 +08:00
parent 50f7846435
commit 7e14bde267
3 changed files with 10 additions and 17 deletions

View File

@ -1,13 +0,0 @@
from tasks.assignment.assets.assets_assignment_ui import (
ALL_ABOUT_BOOTHILL_CHECK, ALL_ABOUT_BOOTHILL_CLICK,
CHARACTER_MATERIALS_CHECK, CHARACTER_MATERIALS_CLICK,
EXP_MATERIALS_CREDITS_CHECK, EXP_MATERIALS_CREDITS_CLICK, GROUP_SEARCH,
SYNTHESIS_MATERIALS_CHECK, SYNTHESIS_MATERIALS_CLICK)
for group_button_wrapper in (
ALL_ABOUT_BOOTHILL_CHECK, ALL_ABOUT_BOOTHILL_CLICK,
CHARACTER_MATERIALS_CHECK, CHARACTER_MATERIALS_CLICK,
EXP_MATERIALS_CREDITS_CHECK, EXP_MATERIALS_CREDITS_CLICK,
SYNTHESIS_MATERIALS_CHECK, SYNTHESIS_MATERIALS_CLICK,
):
group_button_wrapper.load_search(GROUP_SEARCH.button)

View File

@ -15,7 +15,7 @@ from tasks.assignment.assets.assets_assignment_ui import *
from tasks.assignment.keywords import *
from tasks.base.assets.assets_base_page import ASSIGNMENT_CHECK
from tasks.base.ui import UI
from tasks.dungeon.ui import DungeonTabSwitch as Switch
from tasks.dungeon.ui import DungeonTabSwitch
class AssignmentStatus(Enum):
@ -102,7 +102,11 @@ class AssignmentOcr(Ocr):
return matched
ASSIGNMENT_GROUP_SWITCH = Switch(
class AssignmentGroupSwitch(DungeonTabSwitch):
SEARCH_BUTTON = GROUP_SEARCH
ASSIGNMENT_GROUP_SWITCH = AssignmentGroupSwitch(
'AssignmentGroupSwitch',
is_selector=True
)

View File

@ -33,12 +33,14 @@ from tasks.map.keywords import KEYWORDS_MAP_WORLD, MapPlane
class DungeonTabSwitch(Switch):
SEARCH_BUTTON = TAB_SEARCH
def add_state(self, state, check_button, click_button=None):
# Load search
if check_button is not None:
check_button.load_search(TAB_SEARCH.area)
check_button.load_search(self.__class__.SEARCH_BUTTON.area)
if click_button is not None:
click_button.load_search(TAB_SEARCH.area)
click_button.load_search(self.__class__.SEARCH_BUTTON.area)
return super().add_state(state, check_button, click_button)
def click(self, state, main):