Added a game list maker script for Crazy Party. did some restructuring of convenience scripts.

This commit is contained in:
Storm Dragon 2020-11-01 21:09:33 -05:00
parent 047904e471
commit 0f6f5939f3
6 changed files with 37 additions and 0 deletions

View File

@ -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