Update alert function messaging

Show the actual guidance in a single acknowledgement dialog instead of a generic OK prompt, and update alert-based installer instructions to use the new helper contract.
This commit is contained in:
Storm Dragon
2026-03-02 23:01:50 -05:00
parent f9394f90c9
commit 951fa7c1ba
12 changed files with 48 additions and 50 deletions

View File

@@ -1,13 +1,31 @@
#!/usr/bin/env bash
# shellcheck disable=SC2034,SC2154 # sourced by audiogame-manager with shared globals and exported state
# Source IPFS game URLs
source "${BASH_SOURCE[0]%/*}/ipfs.sh"
# Alerts, for when user needs to read something.
alert() {
local title="Alert"
local backTitle=""
local message="Press OK to continue."
if [[ $# -eq 1 ]]; then
message="$1"
elif [[ $# -eq 2 ]]; then
title="$1"
backTitle="$1"
message="$2"
elif [[ $# -ge 3 ]]; then
title="$1"
backTitle="$2"
shift 2
message="$*"
fi
play -qnV0 synth 3 pluck D3 pluck A3 pluck D4 pluck F4 pluck A4 delay 0 .1 .2 .3 .4 remix - chorus 0.9 0.9 38 0.75 0.3 0.5 -t
echo
agm_msgbox "Alert" "" "Press OK to continue."
agm_msgbox "${title}" "${backTitle}" "${message}"
}
check_requirements() {
@@ -54,7 +72,7 @@ clear_cache() {
}
download() {
local source=($@)
local source=("$@")
for i in "${source[@]}" ; do
local dest="${i##*/}"
dest="${dest//%20/ }"
@@ -120,8 +138,7 @@ download() {
esac
if [[ $downloadError -ne 0 ]]; then
rm -fv "${cache}/${dest}"
agm_infobox "Audio Game Manager" "Audio Game Manager" "Error downloading \"${dest}\". Installation cannot continue."
alert
alert "Audio Game Manager" "Audio Game Manager" "Error downloading \"${dest}\". Installation cannot continue."
exit 1
fi
done
@@ -142,10 +159,10 @@ get_installer() {
if echo "$2" | xclip -selection clipboard 2> /dev/null ; then
message+="\n\nThe URL has been copied to the clipboard."
fi
agm_msgbox "Audiogame Manager" "Audiogame Manager" "$message"
alert "Audiogame Manager" "Audiogame Manager" "$message"
# Search the Desktop and Downloads directories for the installation file
for i in ~/Downloads ~/Desktop ; do
find $i -type f -name "$1" -exec cp -v {} "${cache}/" \;
find "$i" -type f -name "$1" -exec cp -v {} "${cache}/" \;
done
# If the file is still not available abort.
if [[ ! -f "${cache}/$1" ]]; then
@@ -157,8 +174,7 @@ get_installer() {
get_steam() {
# Arguments: $1 id of item for download, $2 url for game
trap "exit 0" SIGINT
echo "manual intervention required."
alert
alert "Audiogame Manager" "Audiogame Manager" "Manual intervention required."
agm_yesno "Audiogame Manager" "Audiogame Manager" "To install the game manually, place files in \"${WINEPREFIX}/drive_c/Program Files/${game}\". Continue with Steam installation?"
case $? in
0) echo "The next steps will install through steamcmd." ;;