Added game The Omega Reach

Update the alert function to show the actual guidance in a single acknowledgement dialog instead of a generic OK prompt followed by a separate message.
This commit is contained in:
Storm Dragon
2026-03-02 22:56:05 -05:00
parent c86edee113
commit 647e97a105
9 changed files with 86 additions and 48 deletions

View File

@@ -340,7 +340,8 @@ check_architecture() {
export fex="FEXLoader -- "
return
fi
local architecture="$(uname -m)"
local architecture
architecture="$(uname -m)"
for i in "$@" ; do
if [[ "${architecture}" == "$i" ]]; then
return
@@ -408,6 +409,8 @@ desktop_launcher() {
exit 1
fi
local dotDesktop
local execLine
local launchDirectory
local terminal
# Try to find an accessible terminal
for i in mate-terminal lxterminal terminator gnome-terminal ; do
@@ -416,11 +419,13 @@ desktop_launcher() {
break
fi
done
launchDirectory="$(readlink -e "${0%/*}")"
printf -v execLine "Exec=%s -t \"Linux Game Manager\" -e \"/usr/bin/bash -c 'pushd %q;nohup ./%q 2> /dev/null'\"" "${terminal}" "${launchDirectory}" "${0##*/}"
dotDesktop=('[Desktop Entry]'
'Name=Linux game manager'
'GenericName=Linux game Manager'
'Comment=Install and launch games that are accessible to the blind'
"Exec=${terminal} -t \"Linux Game Manager\" -e \"/usr/bin/bash -c 'pushd $(readlink -e "${0%/*}");nohup ./"${0##*/}" 2> /dev/null'\""
"${execLine}"
'Terminal=false'
'Type=Application'
'StartupNotify=false'
@@ -438,8 +443,25 @@ desktop_launcher() {
# Alerts, for when user needs to read something.
alert() {
local title="Linux Game Manager"
local backTitle="Linux Game Manager"
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
ui_msgbox "Linux Game Manager" "Linux Game Manager" "Press OK to continue."
ui_msgbox "${title}" "${backTitle}" "${message}"
}
clear_cache() {
@@ -549,8 +571,7 @@ download() {
esac
if [[ $downloadError -ne 0 ]]; then
rm -fv "${cache}/${dest}"
ui_infobox "Linux Game Manager" "Linux Game Manager" "Error downloading \"${dest}\". Installation cannot continue."
alert
alert "Linux Game Manager" "Linux Game Manager" "Error downloading \"${dest}\". Installation cannot continue."
exit 1
fi
done
@@ -593,11 +614,10 @@ get_installer() {
if echo "$2" | xclip -selection clipboard 2> /dev/null ; then
message+="\n\nThe URL has been copied to the clipboard."
fi
alert
ui_msgbox "Linux Game Manager" "Linux Game Manager" "$message"
alert "Linux Game Manager" "Linux Game 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 mv -v {} "${cache}/" \;
find "$i" -type f -name "$1" -exec mv -v {} "${cache}/" \;
done
# If the file is still not available abort.
if [[ ! -f "${cache}/$1" ]]; then
@@ -624,6 +644,7 @@ help() {
help_text+="spd_voice=<voice_name>\" # set speech-dispatcher voice. Be sure module is correct.\n"
help_text+="spd_volume=<number>\" # set speech-dispatcher speech volume.\n\n"
help_text+="INSTALLER SCRIPT DIALOG FUNCTIONS:\n"
help_text+="alert [\"title\" \"backtitle\"] \"message\" - Play alert sound and show acknowledgement dialog\n"
help_text+="ui_msgbox \"title\" \"backtitle\" \"message\" - Show information message\n"
help_text+="ui_yesno \"title\" \"backtitle\" \"question\" - Ask yes/no question\n"
help_text+="ui_inputbox \"title\" \"backtitle\" \"prompt\" \"default\" - Get text input\n"
@@ -643,6 +664,7 @@ help() {
game_installer() {
# Create the menu of available games by reading from .install directory
declare -a menuList
# shellcheck disable=SC2154 # installedGames may be populated by sourced config or launch migration
# Get all .sh files from .install directory, excluding those starting with #//, and sort them
mapfile -t sortedGames < <(for f in "${0%/*}/.install/"*.sh; do
# Skip if first line starts with #//
@@ -687,6 +709,7 @@ game_installer() {
# Check if install script exists
if [[ -f "$installScript" ]]; then
# Source and execute the install script
# shellcheck disable=SC1090 # install scripts are selected dynamically from .install
source "$installScript"
# Show success message
ui_msgbox "Game Installer" "Game Installer" "${game} has been installed."
@@ -732,7 +755,8 @@ game_removal() {
# Get the actual game file paths
local gameName="${selectedGame##*/}"
gameName="${gameName%.sh}"
local gameFile="$(readlink -f "${0%/*}/.launch/${gameName}.sh")"
local gameFile
gameFile="$(readlink -f "${0%/*}/.launch/${gameName}.sh")"
# Get the actual installation path from the .game file
local gameInstallPath
gameInstallPath="$(grep -F "installPath" "$gameFile" | grep -v 'pushd' | head -n1)"
@@ -774,7 +798,8 @@ game_update() {
done
menuList+=("Donate" "Donate")
menuList+=("Become a Patron" "Become a Patron")
local game="$(ui_menu "Audio Game Updater" "Audio Game Updater" "Please select a game to update" "${menuList[@]}")"
local game
game="$(ui_menu "Audio Game Updater" "Audio Game Updater" "Please select a game to update" "${menuList[@]}")"
if [[ ${#game} -gt 0 ]]; then
if [[ "$game" == "Donate" ]]; then
open_url "https://ko-fi.com/stormux"
@@ -787,6 +812,7 @@ game_update() {
# Get the game name for success message
local updateGameName="${game##*/}"
updateGameName="${updateGameName%.sh}"
# shellcheck disable=SC1090 # update scripts are selected dynamically from .update
source "${game}"
else
exit 0
@@ -827,6 +853,7 @@ game_launcher() {
if [[ $menuCode -ne 0 ]] || [[ -z "$selectedGame" ]]; then
exit 0
fi
# shellcheck disable=SC1090 # launcher scripts are selected dynamically from .launch
. "${selectedGame}"
exit 0
}
@@ -876,6 +903,7 @@ cache="${XDG_CACHE_HOME:-$HOME/.cache}/linux-game-manager"
configFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/linux-game-manager/games.conf"
mkdir -p "${cache}"
mkdir -p "${configFile%/*}"
declare -a installedGames=()
# Load any arguments from settings.conf file
if [[ -r "${configFile%/*}/settings.conf" ]]; then
source "${configFile%/*}/settings.conf"
@@ -949,5 +977,6 @@ while getopts "${args}" i ; do
esac
done
[[ "${noCache}" == "true" ]] && :
exit 0