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
|
pass
|
||||||
|
|
||||||
def convert_name(self, text: str, keyword: dict) -> str:
|
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]:
|
def iter_rows(self) -> t.Iterable[dict]:
|
||||||
for keyword in self.iter_keywords():
|
for keyword in self.iter_keywords():
|
||||||
@ -163,11 +166,12 @@ class GenerateKeyword:
|
|||||||
base.update(keyword)
|
base.update(keyword)
|
||||||
# Name
|
# Name
|
||||||
_, name = self.find_keyword(text_id, lang='en')
|
_, 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
|
base['name'] = name
|
||||||
# Translations
|
# Translations
|
||||||
for lang in UI_LANGUAGES:
|
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
|
base[lang] = value
|
||||||
return base
|
return base
|
||||||
|
|
||||||
|
@ -73,6 +73,14 @@ class GenerateDungeonList(GenerateKeyword):
|
|||||||
text = f'{text}_{plane.name}'
|
text = f'{text}_{plane.name}'
|
||||||
return text
|
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]:
|
def iter_rows(self) -> t.Iterable[dict]:
|
||||||
dungeons = list(super().iter_rows())
|
dungeons = list(super().iter_rows())
|
||||||
calyx = []
|
calyx = []
|
||||||
@ -88,7 +96,6 @@ class GenerateDungeonList(GenerateKeyword):
|
|||||||
]
|
]
|
||||||
for keyword in order:
|
for keyword in order:
|
||||||
condition = lambda x: x['name'].startswith(keyword)
|
condition = lambda x: x['name'].startswith(keyword)
|
||||||
print([d for d in dungeons])
|
|
||||||
calyx += [d for d in dungeons if condition(d)]
|
calyx += [d for d in dungeons if condition(d)]
|
||||||
dungeons = [d for d in dungeons if not condition(d)]
|
dungeons = [d for d in dungeons if not condition(d)]
|
||||||
dungeons = calyx + dungeons
|
dungeons = calyx + dungeons
|
||||||
|
@ -8,9 +8,9 @@ Calyx_Golden_Memories_Jarilo_VI = DungeonList(
|
|||||||
name='Calyx_Golden_Memories_Jarilo_VI',
|
name='Calyx_Golden_Memories_Jarilo_VI',
|
||||||
cn='回忆之蕾•雅利洛-Ⅵ',
|
cn='回忆之蕾•雅利洛-Ⅵ',
|
||||||
cht='回憶之蕾•雅利洛-Ⅵ',
|
cht='回憶之蕾•雅利洛-Ⅵ',
|
||||||
en='Bud of Memories (Jarilo-VI)',
|
en='Bud of Memories (Jarilo-Ⅵ)',
|
||||||
jp='回憶の蕾・ヤリーロ-VI',
|
jp='回憶の蕾・ヤリーロ-Ⅵ',
|
||||||
es='Flor de los recuerdos (Jarilo-VI)',
|
es='Flor de los recuerdos (Jarilo-Ⅵ)',
|
||||||
plane_id=2010101,
|
plane_id=2010101,
|
||||||
)
|
)
|
||||||
Calyx_Golden_Aether_Jarilo_VI = DungeonList(
|
Calyx_Golden_Aether_Jarilo_VI = DungeonList(
|
||||||
@ -18,9 +18,9 @@ Calyx_Golden_Aether_Jarilo_VI = DungeonList(
|
|||||||
name='Calyx_Golden_Aether_Jarilo_VI',
|
name='Calyx_Golden_Aether_Jarilo_VI',
|
||||||
cn='以太之蕾•雅利洛-Ⅵ',
|
cn='以太之蕾•雅利洛-Ⅵ',
|
||||||
cht='乙太之蕾•雅利洛-Ⅵ',
|
cht='乙太之蕾•雅利洛-Ⅵ',
|
||||||
en='Bud of Aether (Jarilo-VI)',
|
en='Bud of Aether (Jarilo-Ⅵ)',
|
||||||
jp='エーテルの蕾・ヤリーロ-VI',
|
jp='エーテルの蕾・ヤリーロ-Ⅵ',
|
||||||
es='Flor de éter (Jarilo-VI)',
|
es='Flor de éter (Jarilo-Ⅵ)',
|
||||||
plane_id=2011101,
|
plane_id=2011101,
|
||||||
)
|
)
|
||||||
Calyx_Golden_Treasures_Jarilo_VI = DungeonList(
|
Calyx_Golden_Treasures_Jarilo_VI = DungeonList(
|
||||||
@ -28,9 +28,9 @@ Calyx_Golden_Treasures_Jarilo_VI = DungeonList(
|
|||||||
name='Calyx_Golden_Treasures_Jarilo_VI',
|
name='Calyx_Golden_Treasures_Jarilo_VI',
|
||||||
cn='藏珍之蕾•雅利洛-Ⅵ',
|
cn='藏珍之蕾•雅利洛-Ⅵ',
|
||||||
cht='藏珍之蕾•雅利洛-Ⅵ',
|
cht='藏珍之蕾•雅利洛-Ⅵ',
|
||||||
en='Bud of Treasures (Jarilo-VI)',
|
en='Bud of Treasures (Jarilo-Ⅵ)',
|
||||||
jp='秘蔵の蕾・ヤリーロ-VI',
|
jp='秘蔵の蕾・ヤリーロ-Ⅵ',
|
||||||
es='Flor de tesoros (Jarilo-VI)',
|
es='Flor de tesoros (Jarilo-Ⅵ)',
|
||||||
plane_id=2012101,
|
plane_id=2012101,
|
||||||
)
|
)
|
||||||
Calyx_Golden_Memories_The_Xianzhou_Luofu = DungeonList(
|
Calyx_Golden_Memories_The_Xianzhou_Luofu = DungeonList(
|
||||||
|
@ -80,7 +80,7 @@ class OcrDungeonNav(Ocr):
|
|||||||
class OcrDungeonList(Ocr):
|
class OcrDungeonList(Ocr):
|
||||||
def after_process(self, result):
|
def after_process(self, result):
|
||||||
# 乙太之蕾•雅利洛-Ⅵ
|
# 乙太之蕾•雅利洛-Ⅵ
|
||||||
result = result.replace('-VI', '-Ⅵ')
|
result = re.sub(r'-[VⅤ][IⅠ]', '-Ⅵ', result)
|
||||||
|
|
||||||
result = super().after_process(result)
|
result = super().after_process(result)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user