added scene images to scene json

This commit is contained in:
argoneus 2020-10-21 23:40:00 +02:00 committed by tomato
parent 421e313f10
commit b42c731c17
3 changed files with 23 additions and 18 deletions

View file

@ -52,12 +52,14 @@ class QuestDB(BaseDB):
questSceneMstId,
name,
summaryText,
img,
group_concat(partIds) as parts
FROM (
SELECT
qs.questSceneMstId,
qs.name,
qs.summaryText,
qs.img,
CASE
WHEN qp.afterTalkName == '' AND qp.beforeTalkName == '' THEN NULL
WHEN qp.afterTalkName == '' AND qp.beforeTalkName != '' THEN qp.beforeTalkName
@ -74,9 +76,11 @@ class QuestDB(BaseDB):
)
res = self.cursor.fetchall()
scenes = {}
for scene_id, name, summary, parts in res:
for scene_id, name, summary, img, parts in res:
scenes[str(scene_id)] = {}
scenes[str(scene_id)]["Name"] = name
scenes[str(scene_id)]["SummaryText"] = summary
if img:
scenes[str(scene_id)]["Image"] = img
scenes[str(scene_id)]["Parts"] = parts.split(",")
return scenes

View file

@ -51,22 +51,23 @@ def scene_mst(qdb, old_path, languages, utage_in, is_global):
for lang in languages:
out_dict = {}
if lang == "jpn" or is_global:
for key, value in scenes.items():
out_dict[key] = {
"Name": value["Name"],
"SummaryText": value["SummaryText"],
"Credits": "POKELABO",
"Enabled": False,
}
else:
for key in scenes.keys():
out_dict[key] = {
"Name": "",
"SummaryText": "",
"Credits": "",
"Enabled": False,
}
for key, value in scenes.items():
name = ""
summary = ""
credit = ""
enabled = False
if lang == "jpn" or is_global:
name = value["Name"]
summary = value["SummaryText"]
credit = "POKELABO"
out_dict[key] = {
"Name": name,
"SummaryText": summary,
"Credits": credit,
"Enabled": enabled,
}
langfile = os.path.join(old_path, f"XduSceneNames_{lang}.json")
if os.path.isfile(langfile):

View file

@ -15,7 +15,7 @@ def translate_dir(dir_in, tsv_out_dir, json_out_dir, is_global):
files = [
f
for f in glob(os.path.join(dir_in, "**/Scenario/*.tsv"), recursive=True)
if "{os.path.sep}Diva{os.path.sep}" not in f
if f"{os.path.sep}Diva{os.path.sep}" not in f
]
if len(files) == 0: