2024-12-15 19:29:55 -05:00
check_architecture x86_64
check_dependencies steamcmd
2024-12-29 15:22:39 -05:00
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 = $?
2024-12-15 19:29:55 -05:00
appId = "646570"
2024-12-29 15:22:39 -05:00
gogFileName = "slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh"
if [ [ $installMethod -eq 1 ] ] ; then
# Steam Installation
2024-12-15 19:29:55 -05:00
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
2024-12-29 15:22:39 -05:00
if [ [ $? -ne 0 ] ] ; then
dialog --backtitle "Linux Game Manager" \
--msgbox "Error installing game through Steam." -1 -1 --stdout
exit 1
fi
2024-12-15 19:29:55 -05:00
else
2024-12-29 15:22:39 -05:00
# GOG Installation
get_installer " $gogFileName " "https://www.gog.com/en/game/slay_the_spire"
DISPLAY = "" find ~/Downloads -maxdepth 1 -type f -name " $gogFileName " -exec bash "{}" \; ||
2024-12-29 15:27:34 -05:00
DISPLAY = "" find ~/Desktop -maxdepth 1 -type f -name " $gogFileName " -exec bash "{}" \;
2024-12-15 19:29:55 -05:00
if [ [ $? -eq 0 ] ] ; then
2024-12-29 12:02:44 -05:00
ln -sf " ${ HOME } /GOG Games/Slay the Spire/game " " ${ installPath } /SlayTheSpire " ||
2024-12-29 15:22:39 -05:00
{ dialog --backtitle "Linux Game Manager" \
--msgbox "Error creating link to game directory." -1 -1 --stdout
exit 1; }
2024-12-29 12:02:44 -05:00
else
2024-12-29 15:22:39 -05:00
dialog --backtitle "Linux Game Manager" \
--msgbox "Error installing game from GOG installer." -1 -1 --stdout
2024-12-15 19:29:55 -05:00
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 &&
2024-12-29 12:02:44 -05:00
cp -v .files/SlayTheSpire/mod_lists.json " ${ HOME } /.config/ModTheSpire/mod_lists.json "
2024-12-15 19:29:55 -05:00
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
2024-12-29 15:22:39 -05:00
declare -A modsMap = (
2024-12-15 19:29:55 -05:00
[ mod the spire] = 1605060445
[ base mod] = 1605833019
[ stslib] = 1609158507
[ curses come first] = 2304840098
[ achievement enabler] = 1692554109
[ say the spire] = 2239220106
)
installString = ""
2024-12-29 15:22:39 -05:00
for modId in ${ modsMap [@] } ; do
installString = " $installString +workshop_download_item $appId $modId "
2024-12-15 19:29:55 -05:00
done
steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir " ${ HOME } /.local/games/SlayTheSpire/ " +login anonymous $installString +quit
2024-12-29 15:22:39 -05:00
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
2024-12-15 19:29:55 -05:00
mkdir -p " $HOME /.local/games/SlayTheSpire/mods "
2024-12-29 15:22:39 -05:00
for modName in " ${ !modsMap[@] } " ; do
if [ [ " $modName " = = "mod the spire" ] ] ; then
ln -sr " $HOME /.local/games/SlayTheSpire/steamapps/workshop/content/ $appId / ${ modsMap [ $modName ] } " /* " $HOME /.local/games/SlayTheSpire/ "
2024-12-15 19:29:55 -05:00
else
2024-12-29 15:22:39 -05:00
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
2024-12-15 19:29:55 -05:00
fi
done