Added a game list maker script for Crazy Party. did some restructuring of convenience scripts.
This commit is contained in:
parent
047904e471
commit
0f6f5939f3
37
game-scripts/crazy-party-build-games.sh
Executable file
37
game-scripts/crazy-party-build-games.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user