From a33c4a3c23aae8b4936a95c2a6fd3aabb5692a45 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 29 Dec 2024 14:56:43 -0500 Subject: [PATCH] Continuing work on Slay the Spire. It didn't do well in the move. --- .launch/Slay the Spire.game | 35 +++++++++++++++++++++++++++++++++-- .launch/SlayTheSpire.game | 33 --------------------------------- 2 files changed, 33 insertions(+), 35 deletions(-) mode change 100644 => 100755 .launch/Slay the Spire.game delete mode 100755 .launch/SlayTheSpire.game diff --git a/.launch/Slay the Spire.game b/.launch/Slay the Spire.game old mode 100644 new mode 100755 index 5b13217..a914399 --- a/.launch/Slay the Spire.game +++ b/.launch/Slay the Spire.game @@ -1,2 +1,33 @@ -pushd "${installPath}" -"${launcherPath}/.scripts/SlayTheSpire.sh" +#!/usr/bin/env bash + +menulist() { + # Args: menu options. + # returns: selected tag + local i + local menuList + for i in $@ ; do + menuList+=("$i" "$i") + done + dialog --backtitle "Select a Slay the Spire profile." \ + --clear \ + --no-tags \ + --menu "$(gettext "Please select one")" 0 0 0 "${menuList[@]}" --stdout + if [[ $? -ne 1 ]]; then + exit 0 + fi +} + +# Create a list of profiles +profiles=($(jq -r '.lists | keys[]' "${HOME}/.config/ModTheSpire/mod_lists.json")) + +if [[ "${#profiles[@]}" -ne 1 ]]; then + currentProfile="$(menulist "${profiles[@]}")" +else + currentProfile="Default" +fi + +pushd "${HOME}/.local/games/SlayTheSpire" +./MTS.sh --profile "$currentProfile" +popd + +exit 0 diff --git a/.launch/SlayTheSpire.game b/.launch/SlayTheSpire.game deleted file mode 100755 index a914399..0000000 --- a/.launch/SlayTheSpire.game +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -menulist() { - # Args: menu options. - # returns: selected tag - local i - local menuList - for i in $@ ; do - menuList+=("$i" "$i") - done - dialog --backtitle "Select a Slay the Spire profile." \ - --clear \ - --no-tags \ - --menu "$(gettext "Please select one")" 0 0 0 "${menuList[@]}" --stdout - if [[ $? -ne 1 ]]; then - exit 0 - fi -} - -# Create a list of profiles -profiles=($(jq -r '.lists | keys[]' "${HOME}/.config/ModTheSpire/mod_lists.json")) - -if [[ "${#profiles[@]}" -ne 1 ]]; then - currentProfile="$(menulist "${profiles[@]}")" -else - currentProfile="Default" -fi - -pushd "${HOME}/.local/games/SlayTheSpire" -./MTS.sh --profile "$currentProfile" -popd - -exit 0