Added yad dialogues if in GUI session, retains the dialog interface if in console.

This commit is contained in:
Storm Dragon
2025-08-01 15:25:53 -04:00
parent 15f90a7979
commit 76f0c66c96
16 changed files with 392 additions and 113 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# âe contents of this file are subject to the Common Public Attribution
# License Version 1.0 (the âcenseâ you may not use this file except in
@ -37,6 +37,10 @@
# Works which are defined in the CPAL as a work which combines Covered Code
# or portions thereof with code not governed by the terms of the CPAL.
# Source dialog interface wrapper
source "${0%/*}/../.includes/dialog-interface.sh"
for i in dialog unix2dos; do
if ! command -v $i &> /dev/null ; then
echo "Please install dialog and dos2unix before using this script."
@ -55,12 +59,7 @@ for i in "${gameList[@]}" ; do
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)"
gameList="$(agm_checklist "Crazy Party Game Builder" "Crazy Party Game Builder" "Press space to check or uncheck a selected game." "${menuList[@]}")"
if [[ -z "${gameList}" ]]; then
exit 0
@ -70,5 +69,5 @@ mkdir -p "$HOME/.local/wine/crazy-party/drive_c/Program Files/Crazy-Party-beta73
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
agm_infobox "Crazy Party Game Builder" "Crazy Party Game Builder" "Game list \"$1\" updated."
exit 0