From 9ac8af663929db3ab3d626789c66e279a52c11f6 Mon Sep 17 00:00:00 2001 From: Florian Piesche Date: Fri, 30 Aug 2024 01:42:50 +0100 Subject: [PATCH] Add comments for missing features in launcher script --- .../linux/io.github.fgsfdsfgs.perfect_dark.py | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/dist/linux/io.github.fgsfdsfgs.perfect_dark.py b/dist/linux/io.github.fgsfdsfgs.perfect_dark.py index 47c752fee..ea4b9815d 100644 --- a/dist/linux/io.github.fgsfdsfgs.perfect_dark.py +++ b/dist/linux/io.github.fgsfdsfgs.perfect_dark.py @@ -2,14 +2,36 @@ import argparse import subprocess -parser = argparse.ArgumentParser() +xdg_data_home = os.environ["XDG_XATA_HOME"] +# Create data/saves/mods directories if needed for directory in ["data", "saves", "mods"]: - abs_dir = os.path.join(os.environ["XDG_DATA_HOME"], directory + abs_dir = os.path.join(xdg_data_home, directory) if not os.path.isdir(abs_dir): os.makedirs(abs_dir) -xdg_data_home = os.environ["XDG_XATA_HOME"] -default_args = ["--basedir", f"{xdg_data_home}/data", "--savedir", f"{xdg_data_home}/saves"] +parser = argparse.ArgumentParser() +# TODO: Implement ability to select game ROM and choose correct executable based on that choice +# - check for .z64 files in data path +# - if none found, exit with error message +# - if only one found: +# - check filename or md5sum and run appropriate executable +# - if no matches, exit with error message +# - for each rom: +# - if rom filename matches selected version, run game +# - else: +# - md5sum the roms one by one +# - if one matches the selected version: use that one +# - else error out + +# TODO: implement mod loading +# - if romdir parameter is relative, prefix with $XDG_DATA_HOME/mods +# - else use as is + +# TODO: implement arbitrary other parameters +# - get unmatched arguments from ArgumentParser +# - pass them through to executable + +default_args = ["--basedir", f"{xdg_data_home}/data", "--savedir", f"{xdg_data_home}/saves"] subprocess.run(["pd"] + default_args)