Continuing work on Slay the Spire. It didn't do well in the move.

This commit is contained in:
Storm Dragon 2024-12-29 14:56:43 -05:00
parent a624691b0d
commit a33c4a3c23
2 changed files with 33 additions and 35 deletions

35
.launch/Slay the Spire.game Normal file → Executable file
View File

@ -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

View File

@ -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