Merge branch 'master' into dev

This commit is contained in:
LmeSzinc 2024-05-21 02:34:31 +08:00
commit 8ed52d74bc
4 changed files with 21 additions and 14 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -43,17 +43,17 @@ ASSIGNMENT_STARTED_CHECK = ButtonWrapper(
share=[
Button(
file='./assets/share/assignment/dispatch/ASSIGNMENT_STARTED_CHECK.png',
area=(542, 412, 1156, 422),
search=(522, 392, 1176, 442),
color=(232, 230, 226),
button=(542, 412, 1156, 422),
area=(509, 317, 525, 383),
search=(489, 297, 545, 403),
color=(231, 231, 225),
button=(509, 317, 525, 383),
),
Button(
file='./assets/share/assignment/dispatch/ASSIGNMENT_STARTED_CHECK.2.png',
area=(542, 412, 1156, 422),
search=(522, 392, 1176, 442),
color=(254, 244, 221),
button=(542, 412, 1156, 422),
area=(508, 316, 526, 384),
search=(488, 296, 546, 404),
color=(225, 217, 196),
button=(508, 316, 526, 384),
),
],
)

View File

@ -151,19 +151,23 @@ class AssignmentUI(UI):
Args:
group (AssignmentGroup):
Returns:
bool: If group switched
Examples:
self = AssignmentUI('src')
self.device.screenshot()
self.goto_group(KEYWORDS_ASSIGNMENT_GROUP.Character_Materials)
"""
if ASSIGNMENT_GROUP_SWITCH.get(self) == group:
if not ASSIGNMENT_ENTRY_LIST.cur_buttons:
ASSIGNMENT_ENTRY_LIST.load_rows(self)
return
logger.hr('Assignment group goto', level=3)
if ASSIGNMENT_GROUP_SWITCH.set(group, self):
self._wait_until_entry_loaded()
self._wait_until_correct_entry_loaded(group)
return True
else:
if not ASSIGNMENT_ENTRY_LIST.cur_buttons:
ASSIGNMENT_ENTRY_LIST.load_rows(self)
return False
def goto_entry(self, entry: AssignmentEntry, insight: bool = True):
"""
@ -185,7 +189,10 @@ class AssignmentUI(UI):
return
raise ScriptError(err_msg)
else:
self.goto_group(entry.group)
if self.goto_group(entry.group):
# Already insight in goto_group() - _wait_until_correct_entry_loaded()
ASSIGNMENT_ENTRY_LIST.select_row(entry, self, insight=False)
else:
ASSIGNMENT_ENTRY_LIST.select_row(entry, self, insight=insight)
def _wait_until_group_loaded(self):