linux-game-manager/.install/Slay the Spire.sh

59 lines
2.7 KiB
Bash
Raw Normal View History

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
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
echo "Please enter Steam user name:"
read -er steamUser
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire" +login "$steamUser" +app_update "$appId" +quit
else
DISPLAY=""
find ~/Downloads -maxdepth 1 -type f -name 'slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh' -exec bash "{}" \; ||
find ~/Desktop -maxdepth 1 -type f -name 'slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh' -exec bash "{}" \;
if [[ $? -eq 0 ]]; then
ln -sf "${HOME}/GOG Games/Slay the Spire/game" "${installPath}/SlayTheSpire" ||
{ echo "Error creating link."
exit 1; }
else
echo "Error installing game."
exit 1
fi
fi
# Move files into place
mkdir -p "${HOME}/.config/ModTheSpire"
if [[ -f ~"/.config/ModTheSpire/mod_lists.json" ]]; then
dialog --backtitle "Linux Game manager" \
--yesno "Existing mod_lists.json file found. Would you like to replace it?" -1 -1 --stdout &&
cp -v .files/SlayTheSpire/mod_lists.json "${HOME}/.config/ModTheSpire/mod_lists.json"
else
cp -v .files/SlayTheSpire/mod_lists.json "${HOME}/.config/ModTheSpire/mod_lists.json"
fi
cp -v .files/SlayTheSpire/MTS.sh "${HOME}/.local/games/SlayTheSpire/"
# Get mods
declare -A mods=(
[mod the spire]=1605060445
[base mod]=1605833019
[stslib]=1609158507
[curses come first]=2304840098
[achievement enabler]=1692554109
[say the spire]=2239220106
)
installString=""
for x in ${mods[@]} ; do
installString="$installString +workshop_download_item $appId $x"
done
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir "${HOME}/.local/games/SlayTheSpire/" +login anonymous $installString +quit
mkdir -p "$HOME/.local/games/SlayTheSpire/mods"
for x in "${!mods[@]}" ; do
if [ "$x" == "mod the spire" ] ; then
ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${mods[$x]}"/* "$HOME/.local/games/SlayTheSpire/"
else
ln -sr "$HOME/.local/games/SlayTheSpire/steamapps/workshop/content/$appId/${mods[$x]}"/* "$HOME/.local/games/SlayTheSpire/mods/"
fi
done
launcherPath="$(readlink -f "$0")"
launcherPath="${launcherPath%/*}"