mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-25 01:49:41 +00:00
Fix: [EN] Use roman numbers in dungeon keywords (fixed #325)
This commit is contained in:
parent
b0a6745bc7
commit
e96a5ef1da
@ -144,7 +144,10 @@ class GenerateKeyword:
|
||||
pass
|
||||
|
||||
def convert_name(self, text: str, keyword: dict) -> str:
|
||||
return text_to_variable(text)
|
||||
return text_to_variable(replace_templates(text))
|
||||
|
||||
def convert_keyword(self, text: str, lang: str) -> str:
|
||||
return replace_templates(text)
|
||||
|
||||
def iter_rows(self) -> t.Iterable[dict]:
|
||||
for keyword in self.iter_keywords():
|
||||
@ -163,11 +166,12 @@ class GenerateKeyword:
|
||||
base.update(keyword)
|
||||
# Name
|
||||
_, name = self.find_keyword(text_id, lang='en')
|
||||
name = self.convert_name(replace_templates(name), keyword=base)
|
||||
name = self.convert_name(name, keyword=base)
|
||||
base['name'] = name
|
||||
# Translations
|
||||
for lang in UI_LANGUAGES:
|
||||
value = replace_templates(self.find_keyword(text_id, lang=lang)[1])
|
||||
value = self.find_keyword(text_id, lang=lang)[1]
|
||||
value = self.convert_keyword(value, lang=lang)
|
||||
base[lang] = value
|
||||
return base
|
||||
|
||||
|
@ -73,6 +73,14 @@ class GenerateDungeonList(GenerateKeyword):
|
||||
text = f'{text}_{plane.name}'
|
||||
return text
|
||||
|
||||
def convert_keyword(self, text: str, lang: str) -> str:
|
||||
text = super().convert_keyword(text, lang=lang)
|
||||
# Bud of Memories (Jarilo-Ⅵ)
|
||||
# Use roman numbers instead
|
||||
text = re.sub(r'-[VⅤ][IⅠ]', '-Ⅵ', text)
|
||||
|
||||
return text
|
||||
|
||||
def iter_rows(self) -> t.Iterable[dict]:
|
||||
dungeons = list(super().iter_rows())
|
||||
calyx = []
|
||||
@ -88,7 +96,6 @@ class GenerateDungeonList(GenerateKeyword):
|
||||
]
|
||||
for keyword in order:
|
||||
condition = lambda x: x['name'].startswith(keyword)
|
||||
print([d for d in dungeons])
|
||||
calyx += [d for d in dungeons if condition(d)]
|
||||
dungeons = [d for d in dungeons if not condition(d)]
|
||||
dungeons = calyx + dungeons
|
||||
|
@ -8,9 +8,9 @@ Calyx_Golden_Memories_Jarilo_VI = DungeonList(
|
||||
name='Calyx_Golden_Memories_Jarilo_VI',
|
||||
cn='回忆之蕾•雅利洛-Ⅵ',
|
||||
cht='回憶之蕾•雅利洛-Ⅵ',
|
||||
en='Bud of Memories (Jarilo-VI)',
|
||||
jp='回憶の蕾・ヤリーロ-VI',
|
||||
es='Flor de los recuerdos (Jarilo-VI)',
|
||||
en='Bud of Memories (Jarilo-Ⅵ)',
|
||||
jp='回憶の蕾・ヤリーロ-Ⅵ',
|
||||
es='Flor de los recuerdos (Jarilo-Ⅵ)',
|
||||
plane_id=2010101,
|
||||
)
|
||||
Calyx_Golden_Aether_Jarilo_VI = DungeonList(
|
||||
@ -18,9 +18,9 @@ Calyx_Golden_Aether_Jarilo_VI = DungeonList(
|
||||
name='Calyx_Golden_Aether_Jarilo_VI',
|
||||
cn='以太之蕾•雅利洛-Ⅵ',
|
||||
cht='乙太之蕾•雅利洛-Ⅵ',
|
||||
en='Bud of Aether (Jarilo-VI)',
|
||||
jp='エーテルの蕾・ヤリーロ-VI',
|
||||
es='Flor de éter (Jarilo-VI)',
|
||||
en='Bud of Aether (Jarilo-Ⅵ)',
|
||||
jp='エーテルの蕾・ヤリーロ-Ⅵ',
|
||||
es='Flor de éter (Jarilo-Ⅵ)',
|
||||
plane_id=2011101,
|
||||
)
|
||||
Calyx_Golden_Treasures_Jarilo_VI = DungeonList(
|
||||
@ -28,9 +28,9 @@ Calyx_Golden_Treasures_Jarilo_VI = DungeonList(
|
||||
name='Calyx_Golden_Treasures_Jarilo_VI',
|
||||
cn='藏珍之蕾•雅利洛-Ⅵ',
|
||||
cht='藏珍之蕾•雅利洛-Ⅵ',
|
||||
en='Bud of Treasures (Jarilo-VI)',
|
||||
jp='秘蔵の蕾・ヤリーロ-VI',
|
||||
es='Flor de tesoros (Jarilo-VI)',
|
||||
en='Bud of Treasures (Jarilo-Ⅵ)',
|
||||
jp='秘蔵の蕾・ヤリーロ-Ⅵ',
|
||||
es='Flor de tesoros (Jarilo-Ⅵ)',
|
||||
plane_id=2012101,
|
||||
)
|
||||
Calyx_Golden_Memories_The_Xianzhou_Luofu = DungeonList(
|
||||
|
@ -80,7 +80,7 @@ class OcrDungeonNav(Ocr):
|
||||
class OcrDungeonList(Ocr):
|
||||
def after_process(self, result):
|
||||
# 乙太之蕾•雅利洛-Ⅵ
|
||||
result = result.replace('-VI', '-Ⅵ')
|
||||
result = re.sub(r'-[VⅤ][IⅠ]', '-Ⅵ', result)
|
||||
|
||||
result = super().after_process(result)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user