added --utage switch to diva quest
This commit is contained in:
parent
b541f43804
commit
a2308379f2
3 changed files with 21 additions and 12 deletions
|
|
@ -7,16 +7,18 @@ import os
|
||||||
from glob import glob
|
from glob import glob
|
||||||
|
|
||||||
|
|
||||||
def update_missions(dir_in, old_path, languages):
|
def update_missions(dir_in, old_path, languages, is_global, utage_in=None):
|
||||||
|
if not utage_in:
|
||||||
|
utage_in = os.path.join(dir_in, "Common/Asset/Utage")
|
||||||
qdb = db.QuestDB(dir_in)
|
qdb = db.QuestDB(dir_in)
|
||||||
quest_mst(qdb, old_path, languages)
|
quest_mst(qdb, old_path, languages)
|
||||||
scene_mst(qdb, old_path, dir_in, languages)
|
scene_mst(qdb, old_path, dir_in, languages, utage_in)
|
||||||
|
|
||||||
|
|
||||||
def scene_mst(qdb, old_path, dir_in, languages):
|
def scene_mst(qdb, old_path, dir_in, languages, utage_in):
|
||||||
scenes = qdb.get_scenes()
|
scenes = qdb.get_scenes()
|
||||||
|
|
||||||
locations = load_locations(dir_in)
|
locations = load_locations(dir_in, utage_in)
|
||||||
|
|
||||||
for id, scene in scenes.items():
|
for id, scene in scenes.items():
|
||||||
i = 0
|
i = 0
|
||||||
|
|
@ -97,12 +99,9 @@ def quest_mst(qdb, old_path, languages):
|
||||||
return quests
|
return quests
|
||||||
|
|
||||||
|
|
||||||
def load_locations(dir_in):
|
def load_locations(dir_in, utage_in):
|
||||||
locations = {}
|
locations = {}
|
||||||
settings = glob(
|
settings = glob("{}/**/Settings/Scenario.tsv".format(utage_in), recursive=True,)
|
||||||
os.path.join(dir_in, "Common/Asset/Utage/**/Settings/Scenario.tsv"),
|
|
||||||
recursive=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
if len(settings) == 0:
|
if len(settings) == 0:
|
||||||
raise FileNotFoundError("Ya didn't decrypt the files dummy")
|
raise FileNotFoundError("Ya didn't decrypt the files dummy")
|
||||||
|
|
|
||||||
14
divatool.py
14
divatool.py
|
|
@ -117,13 +117,16 @@ def main():
|
||||||
metavar="<command>", title="subcommand", dest="subcommand"
|
metavar="<command>", title="subcommand", dest="subcommand"
|
||||||
)
|
)
|
||||||
parser_diva_quest = parser_diva_subparsers.add_parser(
|
parser_diva_quest = parser_diva_subparsers.add_parser(
|
||||||
"quest", help="Generate quest JSON files"
|
"quest", help="Generate quest JSON files", parents=[global_flag_parser],
|
||||||
)
|
)
|
||||||
parser_diva_quest.add_argument(
|
parser_diva_quest.add_argument(
|
||||||
"INPUT",
|
"INPUT",
|
||||||
help="Directory of databases containing Quest*.db and ResourceEntry.db",
|
help="Directory of databases containing Quest*.db and ResourceEntry.db",
|
||||||
type=str,
|
type=str,
|
||||||
)
|
)
|
||||||
|
parser_diva_quest.add_argument(
|
||||||
|
"--utage", help="Directory of Utage folders and files.", type=str, default=None,
|
||||||
|
)
|
||||||
parser_diva_quest.add_argument(
|
parser_diva_quest.add_argument(
|
||||||
"OLD", help="Directory with old quest files", nargs="?", type=str, default="."
|
"OLD", help="Directory with old quest files", nargs="?", type=str, default="."
|
||||||
)
|
)
|
||||||
|
|
@ -182,7 +185,14 @@ def main():
|
||||||
raise FileNotFoundError(args.INPUT)
|
raise FileNotFoundError(args.INPUT)
|
||||||
elif args.command == "diva":
|
elif args.command == "diva":
|
||||||
if args.subcommand == "quest":
|
if args.subcommand == "quest":
|
||||||
diva.quest.update_missions(args.INPUT, args.OLD, LANGUAGES)
|
if not args.utage:
|
||||||
|
diva.quest.update_missions(
|
||||||
|
args.INPUT, args.OLD, LANGUAGES, args.is_global
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
diva.quest.update_missions(
|
||||||
|
args.INPUT, args.OLD, LANGUAGES, args.is_global, utage_in=args.utage
|
||||||
|
)
|
||||||
elif args.command == "xdudata":
|
elif args.command == "xdudata":
|
||||||
if args.subcommand == "update":
|
if args.subcommand == "update":
|
||||||
# add the tools folder to PATH
|
# add the tools folder to PATH
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ def update_all(
|
||||||
update_tsv(cache_dir, update_dir, extract_dir, translation_dir, languages)
|
update_tsv(cache_dir, update_dir, extract_dir, translation_dir, languages)
|
||||||
|
|
||||||
print("Processing Quest Json files")
|
print("Processing Quest Json files")
|
||||||
diva.quest.update_missions(extract_dir, translation_dir, languages)
|
diva.quest.update_missions(extract_dir, translation_dir, languages, False)
|
||||||
|
|
||||||
print("Processing Sound Effects")
|
print("Processing Sound Effects")
|
||||||
process_se(cache_dir, extract_dir, update_dir)
|
process_se(cache_dir, extract_dir, update_dir)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue