added scene images to scene json
This commit is contained in:
parent
2cc7eba22b
commit
12051045cc
3 changed files with 23 additions and 18 deletions
|
|
@ -52,12 +52,14 @@ class QuestDB(BaseDB):
|
||||||
questSceneMstId,
|
questSceneMstId,
|
||||||
name,
|
name,
|
||||||
summaryText,
|
summaryText,
|
||||||
|
img,
|
||||||
group_concat(partIds) as parts
|
group_concat(partIds) as parts
|
||||||
FROM (
|
FROM (
|
||||||
SELECT
|
SELECT
|
||||||
qs.questSceneMstId,
|
qs.questSceneMstId,
|
||||||
qs.name,
|
qs.name,
|
||||||
qs.summaryText,
|
qs.summaryText,
|
||||||
|
qs.img,
|
||||||
CASE
|
CASE
|
||||||
WHEN qp.afterTalkName == '' AND qp.beforeTalkName == '' THEN NULL
|
WHEN qp.afterTalkName == '' AND qp.beforeTalkName == '' THEN NULL
|
||||||
WHEN qp.afterTalkName == '' AND qp.beforeTalkName != '' THEN qp.beforeTalkName
|
WHEN qp.afterTalkName == '' AND qp.beforeTalkName != '' THEN qp.beforeTalkName
|
||||||
|
|
@ -74,9 +76,11 @@ class QuestDB(BaseDB):
|
||||||
)
|
)
|
||||||
res = self.cursor.fetchall()
|
res = self.cursor.fetchall()
|
||||||
scenes = {}
|
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)] = {}
|
||||||
scenes[str(scene_id)]["Name"] = name
|
scenes[str(scene_id)]["Name"] = name
|
||||||
scenes[str(scene_id)]["SummaryText"] = summary
|
scenes[str(scene_id)]["SummaryText"] = summary
|
||||||
|
if img:
|
||||||
|
scenes[str(scene_id)]["Image"] = img
|
||||||
scenes[str(scene_id)]["Parts"] = parts.split(",")
|
scenes[str(scene_id)]["Parts"] = parts.split(",")
|
||||||
return scenes
|
return scenes
|
||||||
|
|
|
||||||
|
|
@ -51,22 +51,23 @@ def scene_mst(qdb, old_path, languages, utage_in, is_global):
|
||||||
|
|
||||||
for lang in languages:
|
for lang in languages:
|
||||||
out_dict = {}
|
out_dict = {}
|
||||||
if lang == "jpn" or is_global:
|
for key, value in scenes.items():
|
||||||
for key, value in scenes.items():
|
name = ""
|
||||||
out_dict[key] = {
|
summary = ""
|
||||||
"Name": value["Name"],
|
credit = ""
|
||||||
"SummaryText": value["SummaryText"],
|
enabled = False
|
||||||
"Credits": "POKELABO",
|
|
||||||
"Enabled": False,
|
if lang == "jpn" or is_global:
|
||||||
}
|
name = value["Name"]
|
||||||
else:
|
summary = value["SummaryText"]
|
||||||
for key in scenes.keys():
|
credit = "POKELABO"
|
||||||
out_dict[key] = {
|
|
||||||
"Name": "",
|
out_dict[key] = {
|
||||||
"SummaryText": "",
|
"Name": name,
|
||||||
"Credits": "",
|
"SummaryText": summary,
|
||||||
"Enabled": False,
|
"Credits": credit,
|
||||||
}
|
"Enabled": enabled,
|
||||||
|
}
|
||||||
|
|
||||||
langfile = os.path.join(old_path, f"XduSceneNames_{lang}.json")
|
langfile = os.path.join(old_path, f"XduSceneNames_{lang}.json")
|
||||||
if os.path.isfile(langfile):
|
if os.path.isfile(langfile):
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ def translate_dir(dir_in, tsv_out_dir, json_out_dir, is_global):
|
||||||
files = [
|
files = [
|
||||||
f
|
f
|
||||||
for f in glob(os.path.join(dir_in, "**/Scenario/*.tsv"), recursive=True)
|
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:
|
if len(files) == 0:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue