Updates for Slay the Spire installer.

This commit is contained in:
Storm Dragon 2024-12-29 15:22:39 -05:00
parent a33c4a3c23
commit b489bb9a46

View File

@ -1,24 +1,39 @@
check_architecture x86_64 check_architecture x86_64
echo "Please note this requires the game to be available either in your Steam library"
echo "or as the installer purchased from gog.com."
echo "If using the gog.com installer, please use the default path when prompted."
alert
check_dependencies steamcmd check_dependencies steamcmd
alert
dialog --backtitle "Linux Game manager" \
--msgbox \
"Please note this requires the game to be available either in your Steam library\nor as the installer purchased from gog.com.\nIf using the gog.com installer, please use the default path when prompted." -1 -1 --stdout
dialog --backtitle "Linux Game Manager" \
--yes-label "GOG" \
--no-label "Steam" \
--yesno "Select installation method" -1 -1 --stdout
installationMethod=$?
appId="646570" appId="646570"
if ! [[ -f ~/Downloads/slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh ]] && ! [[ -f ~/Desktop/slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh ]]; then gogFileName="slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh"
if [[ $installMethod -eq 1 ]]; then
# Steam Installation
echo "Please enter Steam user name:" echo "Please enter Steam user name:"
read -er steamUser read -er steamUser
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire" +login "$steamUser" +app_update "$appId" +quit steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire" +login "$steamUser" +app_update "$appId" +quit
if [[ $? -ne 0 ]]; then
dialog --backtitle "Linux Game Manager" \
--msgbox "Error installing game through Steam." -1 -1 --stdout
exit 1
fi
else else
DISPLAY="" # GOG Installation
find ~/Downloads -maxdepth 1 -type f -name 'slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh' -exec bash "{}" \; || get_installer "$gogFileName" "https://www.gog.com/en/game/slay_the_spire"
find ~/Desktop -maxdepth 1 -type f -name 'slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh' -exec bash "{}" \; DISPLAY="" find ~/Downloads -maxdepth 1 -type f -name "$gogFileName" -exec bash "{}" \; ||
find ~/Desktop -maxdepth 1 -type f -name "$gogFileName" -exec bash "{}" \;
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
ln -sf "${HOME}/GOG Games/Slay the Spire/game" "${installPath}/SlayTheSpire" || ln -sf "${HOME}/GOG Games/Slay the Spire/game" "${installPath}/SlayTheSpire" ||
{ echo "Error creating link." { dialog --backtitle "Linux Game Manager" \
exit 1; } --msgbox "Error creating link to game directory." -1 -1 --stdout
exit 1; }
else else
echo "Error installing game." dialog --backtitle "Linux Game Manager" \
--msgbox "Error installing game from GOG installer." -1 -1 --stdout
exit 1 exit 1
fi fi
fi fi
@ -33,7 +48,7 @@ else
fi fi
cp -v .files/SlayTheSpire/MTS.sh "${HOME}/.local/games/SlayTheSpire/" cp -v .files/SlayTheSpire/MTS.sh "${HOME}/.local/games/SlayTheSpire/"
# Get mods # Get mods
declare -A mods=( declare -A modsMap=(
[mod the spire]=1605060445 [mod the spire]=1605060445
[base mod]=1605833019 [base mod]=1605833019
[stslib]=1609158507 [stslib]=1609158507
@ -42,15 +57,25 @@ declare -A mods=(
[say the spire]=2239220106 [say the spire]=2239220106
) )
installString="" installString=""
for x in ${mods[@]} ; do for modId in ${modsMap[@]} ; do
installString="$installString +workshop_download_item $appId $x" installString="$installString +workshop_download_item $appId $modId"
done done
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire/" +login anonymous $installString +quit steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire/" +login anonymous $installString +quit
if [[ $? -ne 0 ]]; then
dialog --backtitle "Linux Game Manager" \
--msgbox "Error installing required mods. Some accessibility features may not be available." -1 -1 --stdout
exit 1
fi
mkdir -p "$HOME/.local/games/SlayTheSpire/mods" mkdir -p "$HOME/.local/games/SlayTheSpire/mods"
for x in "${!mods[@]}" ; do for modName in "${!modsMap[@]}" ; do
if [ "$x" == "mod the spire" ] ; then if [[ "$modName" == "mod the spire" ]]; then
ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${mods[$x]}"/* "$HOME/.local/games/SlayTheSpire/" ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${modsMap[$modName]}"/* "$HOME/.local/games/SlayTheSpire/"
else else
ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${mods[$x]}"/* "$HOME/.local/games/SlayTheSpire/mods/" ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${modsMap[$modName]}"/* "$HOME/.local/games/SlayTheSpire/mods/"
fi
if [[ $? -ne 0 ]] && [[ "$modName" == "say the spire" ]]; then
dialog --backtitle "Linux Game Manager" \
--msgbox "Error installing SayTheSpire mod. Screen reader support will not be available." -1 -1 --stdout
exit 1
fi fi
done done