From c66c165a495c7f48095579dc618a278980d775dd Mon Sep 17 00:00:00 2001 From: d10sfan Date: Wed, 8 Nov 2023 21:01:30 -0600 Subject: [PATCH] Hammer of Thyrion - Support cloud saves --- .../hammerofthyrion/assets/hammerofthyrion.sh | 25 +++++++++++++++++++ metadata/packagessniper_v2.json | 8 +++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/engines/hammerofthyrion/assets/hammerofthyrion.sh b/engines/hammerofthyrion/assets/hammerofthyrion.sh index 4aaf8427f..f6ed002c6 100755 --- a/engines/hammerofthyrion/assets/hammerofthyrion.sh +++ b/engines/hammerofthyrion/assets/hammerofthyrion.sh @@ -7,4 +7,29 @@ ln -rsf ./data1/Hexen.rc ./data1/hexen.rc ln -rsf ./data1/Config.cfg ./data1/config.cfg ln -rsf ./data1/Autoexec.cfg ./data1/autoexec.cfg +if ! [[ -z "${LUX_STEAM_CLOUD}" ]]; then + engine_config_dir="$HOME/.hexen2" + engine_save_dir="$engine_config_dir/data1" + cloud_save_dir="$PWD/data1" + cloud_transfer_run_file="$PWD/luxsteamcloud" + + if [ ! -f "${cloud_transfer_run_file}" ]; then + echo "$engine_save_dir" + if [ ! -d "${engine_save_dir}" ]; then + mkdir -p "$engine_save_dir" + fi + + if [ -d "${engine_save_dir}" ]; then + cp -rfv "$engine_save_dir"/* "$cloud_save_dir" + mv "$engine_save_dir" "$engine_save_dir"-beforelux + fi + + ln -s "$cloud_save_dir" "$engine_save_dir" + touch "$cloud_transfer_run_file" + fi + + mv "$engine_save_dir" "$engine_save_dir"-oldlink + ln -s "$cloud_save_dir" "$engine_save_dir" +fi + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./lib" ./glhexen2 -f "$@" diff --git a/metadata/packagessniper_v2.json b/metadata/packagessniper_v2.json index e37ad2aa2..e3481097d 100644 --- a/metadata/packagessniper_v2.json +++ b/metadata/packagessniper_v2.json @@ -3734,6 +3734,12 @@ } ], "cloudAvailable": true, + "cloudSupported": true + "notices": [ + { + "label": "Cloud saves are supported with Hammer of Thyrion" + } + ], "app_id": "9060" }, { @@ -9977,4 +9983,4 @@ "value": "Unworkable Location" } ] -} \ No newline at end of file +}