Add progress bars to some more operations, e.g. installing games. This required a bulk edit to all installer scripts, thanks Claud for the assist. Oh and send downloads through a progressbar.

This commit is contained in:
Storm Dragon
2025-08-05 03:11:37 -04:00
parent 19f54405bd
commit e12bcadb2a
109 changed files with 148 additions and 210 deletions

View File

@@ -65,10 +65,10 @@ install_rhvoice() {
fi
local voiceFile="${RHVoice[${voiceName}]##*/}"
download "${RHVoice[${voiceName}]}"
winetricks -q win8
winetricks -q win8 | agm_progressbox "RHVoice Setup" "Preparing Windows environment for RHVoice..."
echo "Installing RHVoice ${voiceName^}..."
wine "${cache}/${voiceFile}" &
sleep 20
sleep 20 | agm_progressbox "RHVoice Setup" "Installing RHVoice ${voiceName^} voice..."
wineserver -k
}
@@ -109,9 +109,9 @@ install_wine_bottle() {
fi
echo -n "Using "
wine --version
DISPLAY="" wineboot -u
wine msiexec /i z:"$monoPath" /quiet
wine msiexec /i z:"$geckoPath" /quiet
DISPLAY="" wineboot -u | agm_progressbox "Wine Setup" "Initializing wine bottle..."
wine msiexec /i z:"$monoPath" /quiet | agm_progressbox "Wine Setup" "Installing .NET Framework..."
wine msiexec /i z:"$geckoPath" /quiet | agm_progressbox "Wine Setup" "Installing Web Browser support..."
if [[ "${*}" =~ (speechsdk|sapi) ]]; then
install_rhvoice
fi
@@ -122,7 +122,7 @@ install_wine_bottle() {
cp "${cache}/nvda2speechd" "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd"
chmod +x "${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/nvda2speechd"
fi
winetricks -q isolate_home "$@" "${winVer:-win7}" ${winetricksSettings}
winetricks -q isolate_home "$@" "${winVer:-win7}" ${winetricksSettings} | agm_progressbox "Wine Setup" "Installing wine dependencies..."
# Set default voice for speech-enabled games
if [[ ${#defaultVoice} -ge 2 ]] && [[ "$*" =~ (speechsdk|sapi) ]]; then

View File

@@ -1,3 +1,5 @@
#!/usr/bin/env bash
# Alerts, for when user needs to read something.
alert() {
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
@@ -51,10 +53,10 @@ download() {
fi
# Skip if the item is in cache.
[[ -e "${cache}/${dest}" ]] && continue
{ if ! curl -L4 -C - --retry 10 --output "${cache}/${dest}" "${i}" ; then
echo "Could not download \"$i\"..."
if ! curl -L4 -C - --retry 10 --output "${cache}/${dest}" "${i}" 2>&1 | agm_progressbox "Audio Game Manager" "Downloading \"$dest\"..."; then
agm_infobox "Audio Game Manager" "Audio Game Manager" "Could not download \"$dest\". Installation cannot continue."
exit 1
fi; } | agm_progressbox "Audio Game Manager" "Downloading \"$dest\" from \"$i\""
fi
local downloadError=1
case "${dest##*.}" in
"pk3"|"zip")
@@ -173,3 +175,29 @@ unix2dos() {
sed -i 's/\r\{0,\}$/\r/' "$file"
done
}
# Progress wrapper for game installation operations
install_with_progress() {
local operation="$1"
local message="$2"
shift 2
case "$operation" in
"unzip")
unzip "$@" | agm_progressbox "Game Installation" "$message"
;;
"7z")
7z "$@" | agm_progressbox "Game Installation" "$message"
;;
"cp"|"copy")
cp -v "$@" | agm_progressbox "Game Installation" "$message"
;;
"find")
find "$@" | agm_progressbox "Game Installation" "$message"
;;
*)
# Default: run command with progress box
"$operation" "$@" | agm_progressbox "Game Installation" "$message"
;;
esac
}