From 0f6f5939f36c0eaa6b70a6f8b316f50ada4b2df2 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sun, 1 Nov 2020 21:09:33 -0500 Subject: [PATCH] Added a game list maker script for Crazy Party. did some restructuring of convenience scripts. --- game-scripts/crazy-party-build-games.sh | 37 +++++++++++++++++++ .../swamp-update.sh | 0 .../topspeedserver.sh | 0 set-voice.sh => speech/set-voice.sh | 0 setup.sh => wine/install-wine.sh | 0 mkwine.sh => wine/mkwine.sh | 0 6 files changed, 37 insertions(+) create mode 100755 game-scripts/crazy-party-build-games.sh rename swamp-update.sh => game-scripts/swamp-update.sh (100%) rename topspeedserver.sh => game-scripts/topspeedserver.sh (100%) rename set-voice.sh => speech/set-voice.sh (100%) rename setup.sh => wine/install-wine.sh (100%) rename mkwine.sh => wine/mkwine.sh (100%) diff --git a/game-scripts/crazy-party-build-games.sh b/game-scripts/crazy-party-build-games.sh new file mode 100755 index 0000000..7897c17 --- /dev/null +++ b/game-scripts/crazy-party-build-games.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +for i in dialog unix2dos; do + if ! command -v $i &> /dev/null ; then + echo "Please install dialog and dos2unix before using this script." + fi +done + +if [[ $# -ne 1 ]]; then + echo "usage: $0 filename without the .txt extension." + exit 1 +fi + +mapfile -t gameList < <(tail +3 "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta73/Mini-games reference.txt") + +for i in "${gameList[@]}" ; do + menuList+=("$i" "${i#* }" "off") +done + +unset gameList +gameList="$(dialog --clear \ + --no-tags \ + --ok-label "Add Games" \ + --separate-output \ + --backtitle "Select games to add to the $1 list." \ + --checklist "Press space to check or uncheck a selected game." 0 0 0 "${menuList[@]}" --stdout)" + +if [[ -z "${gameList}" ]]; then + exit 0 +fi + +mkdir -p "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta73/game" +echo "$gameList" >> "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta73/game/${1}.txt" +sort -uno "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta73/game/${1}.txt" "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta73/game/${1}.txt" +eunix2dos "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta73/game/${1}.txt" +dialog --infobox "Game list \"$1\" updated." 10 80 +exit 0 diff --git a/swamp-update.sh b/game-scripts/swamp-update.sh similarity index 100% rename from swamp-update.sh rename to game-scripts/swamp-update.sh diff --git a/topspeedserver.sh b/game-scripts/topspeedserver.sh similarity index 100% rename from topspeedserver.sh rename to game-scripts/topspeedserver.sh diff --git a/set-voice.sh b/speech/set-voice.sh similarity index 100% rename from set-voice.sh rename to speech/set-voice.sh diff --git a/setup.sh b/wine/install-wine.sh similarity index 100% rename from setup.sh rename to wine/install-wine.sh diff --git a/mkwine.sh b/wine/mkwine.sh similarity index 100% rename from mkwine.sh rename to wine/mkwine.sh