From ea69dd4444e794687570a47a96fb853ca9782339 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 31 Jul 2023 17:15:05 -0400 Subject: [PATCH] Started work on Slay the Spire. --- .files/SlayTheSpire/MTS.sh | 4 ++++ .files/SlayTheSpire/mod_lists.json | 12 +++++++++++ .scripts/SlayTheSpire.sh | 33 ++++++++++++++++++++++++++++++ linux-game-manager.sh | 29 ++++++++++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100755 .files/SlayTheSpire/MTS.sh create mode 100644 .files/SlayTheSpire/mod_lists.json create mode 100755 .scripts/SlayTheSpire.sh diff --git a/.files/SlayTheSpire/MTS.sh b/.files/SlayTheSpire/MTS.sh new file mode 100755 index 0000000..f8a216d --- /dev/null +++ b/.files/SlayTheSpire/MTS.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +speech-dispatcher -c inet_socket -t 0 -P "$HOME/.local/share/speechd.pid" +./jre/bin/java -jar ModTheSpire.jar --skip-launcher "$@" &> file.log diff --git a/.files/SlayTheSpire/mod_lists.json b/.files/SlayTheSpire/mod_lists.json new file mode 100644 index 0000000..43a0e0d --- /dev/null +++ b/.files/SlayTheSpire/mod_lists.json @@ -0,0 +1,12 @@ +{ + "defaultList": "Default", + "lists": { + "Default": [ + "BaseMod.jar", + "StSLib.jar", + "Curses_Come_First.jar", + "AchievementEnabler.jar", + "sayTheSpire.jar" + ] + } +} diff --git a/.scripts/SlayTheSpire.sh b/.scripts/SlayTheSpire.sh new file mode 100755 index 0000000..a914399 --- /dev/null +++ b/.scripts/SlayTheSpire.sh @@ -0,0 +1,33 @@ +#!/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/linux-game-manager.sh b/linux-game-manager.sh index e34db44..8e79f3d 100755 --- a/linux-game-manager.sh +++ b/linux-game-manager.sh @@ -479,6 +479,7 @@ gameList=( "QuentinC Play Room" "Periphery Synthetic EP" "S.E.A." + #"Slay the Spire" "Slay the Text" "SoundRTS" "soundStrider" @@ -695,6 +696,34 @@ case "${game}" in unzip -d "${installPath}/S.E.A." "${cache}/SEA-linux-x64.zip" add_launcher "${installPath}/S.E.A./SEA" ;; + "Slay the Spire") + if ! [[ -f ~/Downloads/slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh ]] && ! [[ -f ~/Desktop/slay_the_spire_2020_12_15_8735c9fe3cc2280b76aa3ec47c953352a7df1f65_43444.sh ]]; then + check_dependencies steamcmd + appId="646570" + echo "Please enter Steam user name:" + read -er steamUser + echo "Please enter Steam password:" + read -er steamPass + steamcmd +@sSteamCmdForcePlatformType windows +login "$steamUser" "$steamPass" +force_install_dir "${HOME}/.local/games/SlayTheSpire" +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 "{}" \; + fi + # Move files into place + mkdir -p ~/.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 ~"/.config/ModTheSpire/mod_lists.json" + else + cp -v .files/SlayTheSpire/mod_lists.json ~"/.config/ModTheSpire/mod_lists.json" + fi + cp -v .files/SlayTheSpire/MTS.sh ~/.local/games/SlayTheSpire/ + launcherPath="$(readlink -f "$0")" + launcherPath="${launcherPath%/*}" + add_launcher "${launcherPath}/.scripts/SlayTheSpire.sh" + ;; "Slay the Text") check_dependencies python-ansimarkup:ansimarkup git -C "${installPath}/" clone https://github.com/Difio3333/slaythetext.git | \