mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-22 08:37:42 +00:00
Fix: Help text & details of assignment
- https://github.com/LmeSzinc/StarRailCopilot/pull/23#discussion_r1235492724 - https://github.com/LmeSzinc/StarRailCopilot/pull/23#discussion_r1235495266 - https://github.com/LmeSzinc/StarRailCopilot/pull/23#discussion_r1235497216 - https://github.com/LmeSzinc/StarRailCopilot/pull/23#discussion_r1235500507
This commit is contained in:
parent
0e4ce13b9e
commit
47578306cb
@ -223,11 +223,11 @@
|
||||
"Assignment": {
|
||||
"_info": {
|
||||
"name": "Assignment Settings",
|
||||
"help": ""
|
||||
"help": "Claim rewards and dispatch, handling specified assignments first\nIf the assignment limit is not reached after that, others will be dispatched according to preset priority (EXP Materials/Credits → Character Materials → Synthesis Materials)"
|
||||
},
|
||||
"Filter": {
|
||||
"name": "Assignment Priority",
|
||||
"help": "Example: Nameless Land Nameless People > Akashic Records > The Invisible Hand > Root Out the Turpitude"
|
||||
"help": "Make sure there are no typos\nExample: Nameless Land Nameless People > Akashic Records > The Invisible Hand > Root Out the Turpitude"
|
||||
},
|
||||
"Duration": {
|
||||
"name": "Assignment Duration",
|
||||
|
@ -223,7 +223,7 @@
|
||||
"Assignment": {
|
||||
"_info": {
|
||||
"name": "委托设置",
|
||||
"help": ""
|
||||
"help": "领取奖励并派遣,优先处理指定委托\n若处理指定委托之后未达到上限,则按经验材料 → 角色专属素材 → 合成材料的顺序来派遣委托"
|
||||
},
|
||||
"Filter": {
|
||||
"name": "委托优先级",
|
||||
|
@ -223,7 +223,7 @@
|
||||
"Assignment": {
|
||||
"_info": {
|
||||
"name": "委託設置",
|
||||
"help": ""
|
||||
"help": "領取獎勵並派遣,優先處理指定委託\n若處理指定委託之後未達到上限,則按經驗材料 → 角色專屬素材 → 合成材料的順序來派遣委託"
|
||||
},
|
||||
"Filter": {
|
||||
"name": "委託優先級",
|
||||
|
@ -263,22 +263,11 @@ class DigitCounter(Ocr):
|
||||
class Duration(Ocr):
|
||||
@cached_property
|
||||
def timedelta_regex(self):
|
||||
hour_regex = {
|
||||
'ch': '小时',
|
||||
'en': 'h\s*'
|
||||
regex_str = {
|
||||
'ch': r'\D*((?P<hours>\d{1,2})小时)?((?P<minutes>\d{1,2})分钟)?((?P<seconds>\d{1,2})秒})?',
|
||||
'en': r'\D*((?P<hours>\d{1,2})h\s*)?((?P<minutes>\d{1,2})m\s*)?((?P<seconds>\d{1,2})s)?'
|
||||
}[self.lang]
|
||||
minute_regex = {
|
||||
'ch': '分钟',
|
||||
'en': 'm\s*'
|
||||
}[self.lang]
|
||||
second_regex = {
|
||||
'ch': '秒',
|
||||
'en': 's'
|
||||
}[self.lang]
|
||||
ret = rf'\D*((?P<hours>\d{{1,2}}){hour_regex})?'
|
||||
ret += rf'((?P<minutes>\d{{1,2}}){minute_regex})?'
|
||||
ret += rf'((?P<seconds>\d{{1,2}}){second_regex})?'
|
||||
return re.compile(ret)
|
||||
return re.compile(regex_str)
|
||||
|
||||
def format_result(self, result: str) -> timedelta:
|
||||
"""
|
||||
|
@ -28,7 +28,7 @@ class DraggableList:
|
||||
keyword_class,
|
||||
ocr_class,
|
||||
search_button: ButtonWrapper,
|
||||
active_color: tuple[int, int, int]
|
||||
active_color: tuple[int, int, int] = (190, 175, 124)
|
||||
):
|
||||
"""
|
||||
Args:
|
||||
|
@ -61,8 +61,11 @@ class AssignmentOcr(Ocr):
|
||||
matched = self.ocr_regex.fullmatch(result)
|
||||
if matched is None:
|
||||
return result
|
||||
keyword_lang = self.lang
|
||||
if self.lang == 'ch':
|
||||
keyword_lang = 'cn'
|
||||
matched = getattr(KEYWORDS_ASSIGNMENT_ENTRY, matched.lastgroup)
|
||||
matched = getattr(matched, self.lang)
|
||||
matched = getattr(matched, keyword_lang)
|
||||
logger.attr(name=f'{self.name} after_process',
|
||||
text=f'{result} -> {matched}')
|
||||
return matched
|
||||
|
Loading…
Reference in New Issue
Block a user