Merge branch 'testing' latest work on Toby Doom Accessibility Mod.

This commit is contained in:
Storm Dragon 2024-08-11 00:03:41 -04:00
commit 870185f83d
9 changed files with 248 additions and 154 deletions

View File

@ -5,6 +5,8 @@ DIALOG_ITEM_HELP=""
export DIALOGOPTS='--no-lines --visit-items' export DIALOGOPTS='--no-lines --visit-items'
# Toby games path
gamePath=~/.local/games/doom
# Path where doom wads are stored # Path where doom wads are stored
export doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null | head -1)" export doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null | head -1)"
@ -12,28 +14,34 @@ export doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null | head -1)"
export gzdoom="$(command -v gzdoom)" export gzdoom="$(command -v gzdoom)"
# Version of the accessibility mod # Version of the accessibility mod
export tobyVersion="7-0" export tobyVersion="7-5"
doomGames=( doomGames=(
# Toby demo map # Toby demo map
"TobyAccMod_V${tobyVersion}.pk3 Toby-Demo-Level.wad ""$doomPath/Addons/TobyV${tobyVersion%%-*}_"* "Freedoom Toby Demo Map" "TobyAccMod_V${tobyVersion}.pk3 Toby-Demo-Level.wad ""$gamePath/Addons/TobyV${tobyVersion%%-*}_"* "Freedoom Toby Demo Map"
# Unmodified Doom with accessibility. # Unmodified Doom with accessibility.
"TobyAccMod_V${tobyVersion}.pk3 ""$doomPath/Addons/TobyV${tobyVersion%%-*}_"* "Freedoom" "TobyAccMod_V${tobyVersion}.pk3 ""$gamePath/Addons/TobyV${tobyVersion%%-*}_"* "Freedoom"
# Toby accessibility mods # Toby accessibility mods
"TobyAccMod_V${tobyVersion}.pk3 TobyDoomLevels.wad ""$doomPath/Addons/TobyV${tobyVersion%%-*}_"* "Freedoom Toby Delux Map Pack" "TobyAccMod_V${tobyVersion}.pk3 TobyDoomLevels.wad ""$gamePath/Addons/TobyV${tobyVersion%%-*}_"* "Freedoom Toby Delux Map Pack"
# OperationMDK # OperationMDK
"TobyAccMod_V${tobyVersion}.pk3 OpMDK.wad ""$doomPath/Addons/TobyV${tobyVersion%%-*}_"* "Freedoom OperationMDK" "TobyAccMod_V${tobyVersion}.pk3 OpMDK.wad ""$gamePath/Addons/TobyV${tobyVersion%%-*}_"* "Freedoom OperationMDK"
# Unmodified Heretic with accessibility
"TobyAccMod_V${tobyVersion}.pk3 ""$gamePath/Addons/HERETIC/TobyHeretic"* "Classic Heretic"
# Heretic accessibility mods
"TobyAccMod_V${tobyVersion}.pk3 TobyHereticLevels.wad ""$gamePath/Addons/HERETIC/TobyHeretic"* "Toby Heretic"
"custom_game" "Custom Game" "custom_game" "Custom Game"
) )
export antiGrepStrings=( export antiGrepStrings=(
'-E' '-v' '-E' '-v'
'-e' '^Resolution:' '-e' '^Resolution:'
'-e' '^READMe(\d+).*'
) )
export grepStrings=( export grepStrings=(
'-E' '-E'
'-e' '^\[Toby Accessibility Mod\]'
'-e' '^[A-Z][0-9a-z]+: .+' '-e' '^[A-Z][0-9a-z]+: .+'
'-e' 'is now known as' '-e' 'is now known as'
'-e' '.+ punched .+ to death\.' '-e' '.+ punched .+ to death\.'
@ -57,6 +65,8 @@ export grepStrings=(
) )
export sedStrings=( export sedStrings=(
'-e' 's/^\[Toby Accessibility Mod\] M_/[Toby Accessibility Mod] /'
'-e' 's/^\[Toby Accessibility Mod\] //'
'-e' 's/"cl_run" = "true"/run/' '-e' 's/"cl_run" = "true"/run/'
'-e' 's/"cl_run" = "false"/walk/' '-e' 's/"cl_run" = "false"/walk/'
'-e' 's:.*/:Game saved. (:' '-e' 's:.*/:Game saved. (:'
@ -94,9 +104,9 @@ gameOption="$(dialog --backtitle "Select your Doom!" \
--help-label "Exit" \ --help-label "Exit" \
--menu "Please select one" 0 0 0 "${doomGames[@]}" --stdout)" --menu "Please select one" 0 0 0 "${doomGames[@]}" --stdout)"
buttonCode=$? buttonCode=$?
if [[ -e "${doomPath}/DoomMetalVol7.wad" ]]; then if [[ -e "${gamePath}/DoomMetalVol7.wad" ]]; then
gameOption+=" DoomMetalVol7.wad" gameOption+=" DoomMetalVol7.wad"
elif [[ -e "${doomPath}/DoomMetalVol6.wad" ]]; then elif [[ -e "${gamePath}/DoomMetalVol6.wad" ]]; then
gameOption+=" DoomMetalVol6.wad" gameOption+=" DoomMetalVol6.wad"
fi fi
@ -104,7 +114,7 @@ case ${buttonCode} in
1) 1)
# Death match setup # Death match setup
# Ignore the choice of map made above # Ignore the choice of map made above
gameOption="${doomPath}/TobyAccMod_V${tobyVersion}.pk3 ${doomPath}/TobyDeathArena_V1-0.wad ""$doomPath/Addons/TobyV${tobVersion%%-*}_"* gameOption="${gamePath}/TobyAccMod_V${tobyVersion}.pk3 ${gamePath}/TobyDeathArena_V1-0.wad ""$gamePath/Addons/TobyV${tobVersion%%-*}_"*
ipAddress="$(dialog --backtitle "Deathmatch Options" \ ipAddress="$(dialog --backtitle "Deathmatch Options" \
--clear \ --clear \
--no-tags \ --no-tags \
@ -189,7 +199,7 @@ case ${buttonCode} in
) )
fi fi
pushd "$doomPath" pushd "$doomPath"
exec stdbuf -oL ${gzdoom} ${gameOption} "$doomPath/Addons/TobyV${tobyVersion%%-*}_"* "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e ${spd_module} ${spd_pitch} ${spd_rate} ${spd_voice} ${spd_volume} --; } ; echo "$l";done exec stdbuf -oL ${gzdoom} ${gameOption} "$gamePath/Addons/TobyV${tobyVersion%%-*}_"* "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e ${spd_module} ${spd_pitch} ${spd_rate} ${spd_voice} ${spd_volume} --; } ; echo "$l";done
;; ;;
2) 2)
# Exit was pressed, so exit. # Exit was pressed, so exit.
@ -241,7 +251,7 @@ case ${buttonCode} in
) )
fi fi
pushd "${doomPath}" pushd "${doomPath}"
exec stdbuf -oL ${gzdoom} ${gameOption} "$doomPath/Addons/TobyV${tobyVersion%%-*}_"* "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e ${spd_module} ${spd_pitch} ${spd_rate} ${spd_voice} ${spd_volume} --; } ; echo "$l";done exec stdbuf -oL ${gzdoom} ${gameOption} "$gamePath/Addons/TobyV${tobyVersion%%-*}_"* "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e ${spd_module} ${spd_pitch} ${spd_rate} ${spd_voice} ${spd_volume} --; } ; echo "$l";done
;; ;;
0) 0)
if [[ "${gameOption%% *}" == "custom_game" ]]; then if [[ "${gameOption%% *}" == "custom_game" ]]; then

124
.scripts/TobyCustom/' Normal file
View File

@ -0,0 +1,124 @@
#!/usr/bin/env bash
pushd "$doomPath"
# Set up the pk3 and wad files
gameOption=(
"$(find /usr/share/games/ -name 'Project_Brutality-master.pk3')"
"${doomPath}/TobyAccMod_V${tobyVersion}.pk3"
"${doomPath}/PB-Toby-Compatibility-Addon.pk3"
"${doomPath}/Toby-Universal-Pickup-Beacon-Prototype.pk3"
"${doomPath}/TobyDeathArena_V1-0.wad"
)
# Death match setup
ipAddress="$(dialog --backtitle "Deathmatch Options" \
--clear \
--no-tags \
--ok-label "Join" \
--cancel-label "Exit" \
--extra-button \
--extra-label "Host" \
--inputbox "Enter ip or URL, required for join." -1 -1 --stdout)"
buttonCode=$?
[[ $buttonCode -eq 1 ]] && exit 0
if [[ $buttonCode -eq 0 ]]; then
if [[ "${#ipAddress}" -lt 3 ]]; then
dialog --backtitle "Deathmatch" --clear --msgbox "No ip address or URL given." -1 -1 --stdout
exit 1
fi
flags=('-join' "${ipAddress}")
else
# List of maps included:
maps=(
"1" "Com Station (2-4 players)"
"2" "Warehouse (2-4 players)"
"3" "Sector 3 (2-4 players)"
"4" "Dungeon of Doom (2-4 players)"
"5" "Ocean Fortress (2-4 players)"
"6" "Water Treatment Facility (2-4 players)"
"7" "Phobos Base Site 4 (2-4 players)"
"8" "Hangar Bay 18 (2-4 players)")
# Array of how many players a given map supports in dialog rangebox syntax
declare -a mapPlayers=(
[1]="2 4"
[2]="2 4"
[3]="2 4"
[4]="2 4"
[5]="2 4"
[6]="2 4"
[7]="2 4"
[8]="2 4")
map="$(dialog --backtitle "Select Map" \
--clear \
--no-tags \
--cancel-label "Exit" \
--ok-label "Next" \
--menu "Please select one" 0 0 0 "${maps[@]}" --stdout)"
fraglimit="$(dialog --backtitle "Fraglimit" \
--clear \
--ok-label "Next" \
--cancel-label "Exit" \
--rangebox "Select Fraglimit" -1 -1 1 500 20 --stdout)"
[[ $? -eq 1 ]] && exit 0
# Get ip address
yourIpAddress="$(curl -4s https://icanhazip.com)"
players="$(dialog --backtitle "Host Deathmatch Game" \
--clear \
--ok-label "Next" \
--cancel-label "Exit" \
--rangebox "Select number of players. Remember to give them your IP address: ${yourIpAddress}" -1 -1 ${mapPlayers[$map]} --stdout)"
[[ $? -eq 1 ]] && exit 0
skillLevel="$(dialog --backtitle "Host Deathmatch Game" \
--clear \
--ok-label "Start" \
--cancel-label "Exit" \
--extra-button \
--extra-label "Bots Only" \
--rangebox "Select difficulty. 1 easiest, 5 hardest." -1 -1 1 5 3 --stdout)"
code=$?
[[ $code -eq 1 ]] && exit 0
if [[ $code -eq 3 ]]; then
players=1
dialog --backtitle "Preparing to Launch" \
--msgbox "When the game starts, press \` to open the console. Type addbot, press enter. Repeat addbot for as many bots as you would like. Press \` again to close the console." -1 -1 --stdout
fi
flags=(
'-host' "${players}"
'-skill' "${skillLevel}"
'-deathmatch'
'+set' 'sv_cheats' '1'
'+fraglimit' "$fraglimit"
'+dmflags' '16384' '+dmflags' '4' '+dmflags' '128' '+dmflags' '4096'
'+dmflags2' '512' '+dmflags2' '1024'
'-extratic' '-dup' '3'
'-warp' "$map"
)
fi
# Check for and include if present a wad. Some people may not have it.
if [[ -e "${doomPath}/DoomMetalVol7.wad" ]]; then
gameOption+=" DoomMetalVol7.wad"
elif [[ -e "${doomPath}/DoomMetalVol6.wad" ]]; then
gameOption+=" DoomMetalVol6.wad"
fi
# Extend the search for new messages to be read.
grepStrings+=('-e' ' died.'
'-e' 'Ectoplasmic Surge!'
'-e' ' has been '
'-e' '^(Armor|Health) boosted!'
'-e' 'Lesser demon energy'
'-e' '^Found '
'-e' 'Got the '
'-e' 'Picked up '
'-e' '^(Mega|Soul)sphere$'
'-e' '^Took '
'-e' ' was .*(\.|!)'
'-e' '^Vanguard of the gods!$'
'-e' "You've found "
'-e' 'You (collected|got|found|picked up) ')
# Launch the game and pipe things to be spoken through speech-dispatcher.
# This also leaves the console output intact for people who may want to read it.
exec stdbuf -oL ${gzdoom} ${gameOption[@]} "${flags[@]}" | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e ${spd_module} ${spd_pitch} ${spd_rate} ${spd_voice} ${spd_volume} -- > /dev/null 2>&1; }; echo "$l";done

View File

@ -0,0 +1,35 @@
# Extend the search for new messages to be read.
grepStrings+=('-e' '^\*\*\* Brutality Bonus awarded!'
'-e' '^\+[0-9]+ '
'-e' '^A backpack for all your ammo storage needs!$'
'-e' '^Area survey map.$'
'-e' ' died.'
'-e' 'Ectoplasmic Surge!'
'-e' '^Game Saved.'
'-e' ' has been '
'-e' '^(Armor|Health) boosted!'
'-e' '(Greater|Lesser) demon energy'
'-e' '^Found '
'-e' 'Got the '
'-e' ' killed (her|him|it)self(\.|!)'
'-e' '^Low-light goggles.$'
'-e' '^Picked up '
'-e' '^Press '
'-e' 'Rescue operations suit.'
'-e' '^(Mega|Soul|Invulnerability )[Ss]phere!$'
'-e' '^Mancubus '
'-e' ' skeleton key secured!$'
'-e' ' \(Slot [0-9]+\)'
'-e' ' (SPLATTERED|was) .*(\.|!)'
'-e' ' Swiss Cheese '
'-e' '^Took '
'-e' '^Vanguard of the gods!$'
'-e' "You've found "
'-e' 'You (collected|got|found|picked up) ')
antiGrepStrings+=('-e' 'key card'
'-e' ' was .*\?'
)
sedStrings+=('-e' 's/*\{3\}//g'
'-e' 's/^+//')

View File

@ -2,18 +2,14 @@
pushd "$doomPath" pushd "$doomPath"
# Add all the TobyDoom stuff we need, exclude things we do not. gamePath=~/.local/games/doom
mapfile -t addons < <(find "${doomPath}/Addons/" -type f -iname "TobyV${tobyVersion%%-*}_*" \
-not -iname "TobyV${tobyVersion%%-*}_Decorations.pk3" \
-not -iname "TobyV${tobyVersion%%-*}_Monsters.pk3"
)
# Set up the pk3 and wad files # Set up the pk3 and wad files
gameOption=( gameOption=(
"${gamePath}/TobyAccMod_V${tobyVersion}.pk3"
"$(find /usr/share/games/ -name 'Project_Brutality-master.pk3')" "$(find /usr/share/games/ -name 'Project_Brutality-master.pk3')"
"${doomPath}/TobyAccMod_V${tobyVersion}.pk3" "$(find ~/.local/games/doom -name 'Project_Brutality-master.pk3')"
${addons[@]} "${gamePath}/TobyDeathArena_V1-0.wad"
"${doomPath}/TobyDeathArena_V1-0.wad"
) )
# Death match setup # Death match setup
@ -102,22 +98,15 @@ else
fi fi
# Check for and include if present a wad. Some people may not have it. # Check for and include if present a wad. Some people may not have it.
if [[ -e "${doomPath}/DoomMetalVol7.wad" ]]; then if [[ -e "${gamePath}/DoomMetalVol7.wad" ]]; then
gameOption+=" DoomMetalVol7.wad" gameOption+=" DoomMetalVol7.wad"
elif [[ -e "${doomPath}/DoomMetalVol6.wad" ]]; then elif [[ -e "${gamePath}/DoomMetalVol6.wad" ]]; then
gameOption+=" DoomMetalVol6.wad" gameOption+=" DoomMetalVol6.wad"
fi fi
# Extend the search for new messages to be read. # Source common variable extensions.
grepStrings+=('-e' 'New PDA Entry:' pbrc="$(find "${0%/*}/" -type f -name '.projectbrutalityrc')"
'-e' ' died.' source "${pbrc}"
'-e' ' has been '
'-e' ' killed '
'-e' 'Lesser demon energy'
'-e' ' was '
'-e' 'Got the '
'-e' "You've found "
'-e' 'Slot ')
# Launch the game and pipe things to be spoken through speech-dispatcher. # Launch the game and pipe things to be spoken through speech-dispatcher.
# This also leaves the console output intact for people who may want to read it. # This also leaves the console output intact for people who may want to read it.

View File

@ -3,36 +3,25 @@
# Set the current path to the Doom path required by some OS. # Set the current path to the Doom path required by some OS.
pushd "${doomPath}" pushd "${doomPath}"
# Add all the TobyDoom stuff we need, exclude things we do not. gamePath=~/.local/games/doom
mapfile -t addons < <(find "${doomPath}/Addons/" -type f -iname "TobyV${tobyVersion%%-*}_*" \
-not -iname "TobyV${tobyVersion%%-*}_Decorations.pk3" \
-not -iname "TobyV${tobyVersion%%-*}_Monsters.pk3"
-not -iname "TobyV${tobyVersion%%-*}_Guns.pk3"
)
# Set up the pk3 and wad files # Set up the pk3 and wad files
gameOption=( gameOption=(
"${gamePath}/TobyAccMod_V${tobyVersion}.pk3"
"${gamePath}/OpMDK.wad"
"$(find /usr/share/games/ -name 'Project_Brutality-master.pk3')" "$(find /usr/share/games/ -name 'Project_Brutality-master.pk3')"
"${doomPath}/TobyAccMod_V${tobyVersion}.pk3" "$(find ~/.local/games/doom -name 'Project_Brutality-master.pk3')"
${addons[@]}
"${doomPath}/PB-Toby-Compatibility-Addon.pk3"
"${doomPath}/OpMDK.wad"
) )
# Check for and include if present a wad. Some people may not have it. # Check for and include if present a wad. Some people may not have it.
if [[ -e "${doomPath}/DoomMetalVol6.wad" ]]; then if [[ -e "${gamePath}/DoomMetalVol7.wad" ]]; then
gameOption+=("${doomPath}/DoomMetalVol6.wad") gameOption+=("${gamePath}/DoomMetalVol7.wad")
elif [[ -e "${gamePath}/DoomMetalVol6.wad" ]]; then
gameOption+=("${gamePath}/DoomMetalVol6.wad")
fi fi
# Extend the search for new messages to be read. # Source common variable extensions.
grepStrings+=('-e' 'New PDA Entry:' pbrc="$(find "${0%/*}/" -type f -name '.projectbrutalityrc')"
'-e' ' died.' source "${pbrc}"
'-e' ' has been '
'-e' 'Lesser demon energy'
'-e' 'Got the '
'-e' '^\([^?]*\)\(was\)\([^?]*\)$'
'-e' "You've found "
'-e' 'Slot ')
# Launch the game and pipe things to be spoken through speech-dispatcher. # Launch the game and pipe things to be spoken through speech-dispatcher.
# This also leaves the console output intact for people who may want to read it. # This also leaves the console output intact for people who may want to read it.

View File

@ -3,36 +3,27 @@
# Set the current path to the Doom path required by some OS. # Set the current path to the Doom path required by some OS.
pushd "${doomPath}" pushd "${doomPath}"
# Add all the TobyDoom stuff we need, exclude things we do not. gamePath=~/.local/games/doom
mapfile -t addons < <(find "${doomPath}/Addons/" -type f -iname "TobyV${tobyVersion%%-*}_*" \
-not -iname "TobyV${tobyVersion%%-*}_Decorations.pk3" \
-not -iname "TobyV${tobyVersion%%-*}_Monsters.pk3"
)
# Set up the pk3 and wad files # Set up the pk3 and wad files
gameOption=( gameOption=(
"${gamePath}/TobyAccMod_V${tobyVersion}.pk3"
"${gamePath}/PB-Toby-Compatibility-Addon.pk3"
"${gamePath}/TobyDoomLevels.wad"
"$(find /usr/share/games/ -name 'Project_Brutality-master.pk3')" "$(find /usr/share/games/ -name 'Project_Brutality-master.pk3')"
"${doomPath}/TobyAccMod_V${tobyVersion}.pk3" "$(find ~/.local/games/doom -name 'Project_Brutality-master.pk3')"
${addons[@]}
"${doomPath}/TobyDoomLevels.wad"
) )
# Check for and include if present a wad. Some people may not have it. # Check for and include if present a wad. Some people may not have it.
if [[ -e "${doomPath}/DoomMetalVol7.wad" ]]; then if [[ -e "${gamePath}/DoomMetalVol7.wad" ]]; then
gameOption+=" DoomMetalVol7.wad" gameOption+=("${gamePath}/DoomMetalVol7.wad")
elif [[ -e "${doomPath}/DoomMetalVol6.wad" ]]; then elif [[ -e "${gamePath}/DoomMetalVol6.wad" ]]; then
gameOption+=" DoomMetalVol6.wad" gameOption+=("${gamePath}/DoomMetalVol6.wad")
fi fi
# Extend the search for new messages to be read. # Source common variable extensions.
grepStrings+=('-e' 'New PDA Entry:' pbrc="$(find "${0%/*}/" -type f -name '.projectbrutalityrc')"
'-e' ' died.' source "${pbrc}"
'-e' ' has been '
'-e' 'Lesser demon energy'
'-e' 'Got the '
'-e' '^\([^?]*\)\(was\)\([^?]*\)$'
'-e' "You've found "
'-e' 'Slot ')
# Launch the game and pipe things to be spoken through speech-dispatcher. # Launch the game and pipe things to be spoken through speech-dispatcher.
# This also leaves the console output intact for people who may want to read it. # This also leaves the console output intact for people who may want to read it.

View File

@ -3,36 +3,27 @@
# Set the current path to the Doom path required by some OS. # Set the current path to the Doom path required by some OS.
pushd "${doomPath}" pushd "${doomPath}"
# Add all the TobyDoom stuff we need, exclude things we do not. gamePath=~/.local/games/doom
mapfile -t addons < <(find "${doomPath}/Addons/" -type f -iname "TobyV${tobyVersion%%-*}_*" \
-not -iname "TobyV${tobyVersion%%-*}_Decorations.pk3" \
-not -iname "TobyV${tobyVersion%%-*}_Monsters.pk3"
)
# Set up the pk3 and wad files # Set up the pk3 and wad files
gameOption=( gameOption=(
"${gamePath}/TobyAccMod_V${tobyVersion}.pk3"
"${gamePath}/PB-Toby-Compatibility-Addon.pk3"
"${gamePath}/Toby-Demo-Level.wad"
"$(find /usr/share/games/ -name 'Project_Brutality-master.pk3')" "$(find /usr/share/games/ -name 'Project_Brutality-master.pk3')"
"${doomPath}/TobyAccMod_V${tobyVersion}.pk3" "$(find ~/.local/games/doom -name 'Project_Brutality-master.pk3')"
${addons[@]}
"${doomPath}/Toby-Demo-Level.wad"
) )
# Check for and include if present a wad. Some people may not have it. # Check for and include if present a wad. Some people may not have it.
if [[ -e "${doomPath}/DoomMetalVol7.wad" ]]; then if [[ -e "${gamePath}/DoomMetalVol7.wad" ]]; then
gameOption+=" DoomMetalVol7.wad" gameOption+=("${gamePath}/DoomMetalVol7.wad")
elif [[ -e "${doomPath}/DoomMetalVol6.wad" ]]; then elif [[ -e "${gamePath}/DoomMetalVol6.wad" ]]; then
gameOption+=" DoomMetalVol6.wad" gameOption+=("${gamePath}/DoomMetalVol6.wad")
fi fi
# Extend the search for new messages to be read. # Source common variable extensions.
grepStrings+=('-e' 'New PDA Entry:' pbrc="$(find "${0%/*}/" -type f -name '.projectbrutalityrc')"
'-e' ' died.' source "${pbrc}"
'-e' ' has been '
'-e' 'Lesser demon energy'
'-e' 'Got the '
'-e' '^\([^?]*\)\(was\)\([^?]*\)$'
'-e' "You've found "
'-e' 'Slot ')
# Launch the game and pipe things to be spoken through speech-dispatcher. # Launch the game and pipe things to be spoken through speech-dispatcher.
# This also leaves the console output intact for people who may want to read it. # This also leaves the console output intact for people who may want to read it.

View File

@ -1,36 +0,0 @@
#!/usr/bin/env bash
# Set the current path to the Doom path required by some OS.
pushd "${doomPath}"
# Add all the TobyDoom stuff we need, exclude things we do not.
mapfile -t addons < <(find "${doomPath}/Addons/" -type f -iname "TobyV${tobyVersion%%-*}_*" \
-not -iname "TobyV${tobyVersion%%-*}_Decorations.pk3" \
-not -iname "TobyV${tobyVersion%%-*}_Monsters.pk3"
)
# Set up the pk3 and wad files
gameOption=(
"$(find "${doomPath}" -iname 'Xim-StarWars*.pk3')"
"${doomPath}/TobyAccMod_V${tobyVersion}.pk3"
${addons[@]}
"${doomPath}/TobyDoomLevels.wad"
)
# Check for and include if present a wad. Some people may not have it.
if [[ -e "${doomPath}/DoomMetalVol6.wad" ]]; then
gameOption+=("${doomPath}/DoomMetalVol6.wad")
fi
# Extend the search for new messages to be read.
grepStrings+=('-e' 'New PDA Entry:'
'-e' ' died.'
'-e' ' has been '
'-e' 'Lesser demon energy'
'-e' 'Got the '
'-e' "You've found "
'-e' 'Slot ')
# Launch the game and pipe things to be spoken through speech-dispatcher.
# This also leaves the console output intact for people who may want to read it.
exec stdbuf -oL ${gzdoom} ${gameOption[@]} | while IFS= read -r l ; do echo "$l" | { grep "${grepStrings[@]}" | grep "${antiGrepStrings[@]}" | sed "${sedStrings[@]}" | spd-say -e ${spd_module} ${spd_pitch} ${spd_rate} ${spd_voice} ${spd_volume} -- > /dev/null 2>&1; }; echo "$l";done

View File

@ -677,13 +677,14 @@ case "${game}" in
add_launcher "${installPath}/FS2_2.7_Linux/fs2.x86_64" "-ESpeakApplication=espeak-ng" add_launcher "${installPath}/FS2_2.7_Linux/fs2.x86_64" "-ESpeakApplication=espeak-ng"
;; ;;
"Freedoom") "Freedoom")
tobyVersion="7-0" tobyVersion="7-5"
mkdir -p "${installPath}/doom"
doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null)" doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null)"
if [[ ${#doomPath} -lt 5 ]]; then if [[ ${#doomPath} -lt 5 ]]; then
dialog --backtitle "Linux Game Manager" \ dialog --backtitle "Linux Game Manager" \
--yesno "Do you want Linux Game Manager to install freedoom and gzdoom for you? If you want to do this manually, select no." -1 -1 --stdout || exit 0 --yesno "Do you want Linux Game Manager to install freedoom and gzdoom for you? If you want to do this manually, select no." -1 -1 --stdout || exit 0
if command -v yay &> /dev/null ; then if command -v yay &> /dev/null ; then
yay -Sy --noconfirm --sudoloop freedoom gzdoom freedm yay -Sy --noconfirm --sudoloop freedoom gzdoom freedm blasphemer-wad
elif command -v slapt-src &> /dev/null ; then elif command -v slapt-src &> /dev/null ; then
su -c 'slapt-src -i freedoom gzdoom' su -c 'slapt-src -i freedoom gzdoom'
elif command -v dnf &> /dev/null ; then elif command -v dnf &> /dev/null ; then
@ -696,7 +697,7 @@ case "${game}" in
fi fi
fi fi
doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null | head -1)" doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null | head -1)"
if ! [[ -e "${doomPath}/DoomMetalVol6.wad" ]] && ! [[ -e "${doomPath}/DoomMetalVol7.wad" ]]; then if ! [[ -e "${installPath}/doom/DoomMetalVol6.wad" ]] && ! [[ -e "${installPath}/doom/DoomMetalVol7.wad" ]]; then
alert alert
dialog --backtitle "Linux Game manager" \ dialog --backtitle "Linux Game manager" \
--extra-button \ --extra-button \
@ -715,22 +716,22 @@ case "${game}" in
fi fi
# The url breaks the normal download function # The url breaks the normal download function
download_named "keyshare-universal.pk3" "https://forum.zdoom.org/download/file.php?id=42262" download_named "keyshare-universal.pk3" "https://forum.zdoom.org/download/file.php?id=42262"
download "${ipfsGateway}/ipfs/QmW5xfL2Z3PQvwKyU34nFLr31dLNZaghjPc68VsA6hFjZD?filename=TobyAccessibilityMod_Version${tobyVersion}.zip" "${ipfsGateway}/ipfs/QmSKgXKDgu6z4NoDt6GWMhDSin8ABpd7oQDj6Tqsfk7xhQ?filename=OpMDK_ForV7-0.zip" download "${ipfsGateway}/ipfs/QmNtn1bugWQg2Y8rB29FH6zYzthsebxmpuMcHcErprzx3z?filename=TobyAccessibilityMod_Version${tobyVersion}.zip" "${ipfsGateway}/ipfs/QmNUfYa5P9J6EaDZoGvsiG2ArMR3BCc3gTcW3wPo1HABLU?filename=OpMDK_ForV${tobyVersion}.zip"
echo "The next step may require your password." [[ -e "${cache}/DoomMetalVol6.wad" ]] && mv "${cache}/DoomMetalVol6.wad" "${installPath}/doom"
echo "It is necessary to move the extracted files into their proper place." [[ -e "${cache}/DoomMetalVol7.wad" ]] && mv "${cache}/DoomMetalVol7.wad" "${installPath}/doom"
alert unzip -n -d "${installPath}/doom" "${cache}/TobyAccessibilityMod_Version${tobyVersion}.zip"
[[ -e "${cache}/DoomMetalVol6.wad" ]] && sudo mv "${cache}/DoomMetalVol6.wad" "${doomPath}/" unzip -n -d "${installPath}/doom" "${cache}/OpMDK_ForV7-0.zip"
[[ -e "${cache}/DoomMetalVol7.wad" ]] && sudo mv "${cache}/DoomMetalVol7.wad" "${doomPath}/" cp -v "${cache}/keyshare-universal.pk3" "${installPath}/doom"
sudo unzip -n -d "${doomPath}" "${cache}/TobyAccessibilityMod_Version${tobyVersion}.zip" rm -fv "${installPath}/doom/"*.{bat,dll,exe}
sudo unzip -n -d "${doomPath}" "${cache}/OpMDK_ForV7-0.zip" if [[ -e /usr/share/doom/blasphem.wad ]]; then
sudo cp -v "${cache}/keyshare-universal.pk3" "${doomPath}" ln -s /usr/share/doom/blasphem.wad "${installPath}/doom/"
sudo rm -fv "${doomPath}/"*.{bat,exe} fi
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom" mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom"
cp "${doomPath}/TobyConfig.ini" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" cp "${installPath}/doom/TobyConfig.ini" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
cp "${doomPath}/zcajun/bots.cfg" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/" cp "${installPath}/doom/zcajun/bots.cfg" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/"
sed -i "s;^\[IWADSearch.Directories\]$;[IWADSearch.Directories]\nPath=${doomPath};" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" sed -i "s;^\[IWADSearch.Directories\]$;[IWADSearch.Directories]\nPath=${doomPath}\nPath=${installPath}/doom;" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
sed -i "s;^\[FileSearch.Directories\]$;[FileSearch.Directories]\nPath=${doomPath};" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" sed -i "s;^\[FileSearch.Directories\]$;[FileSearch.Directories]\nPath=${doomPath}\nPath=${installPath}/doom;" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
sed -i "s;^\[SoundfontSearch.Directories\]$;[SoundfontSearch.Directories]\nPath=${doomPath}/fm_banks\nPath=${doomPath}/soundfonts;" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" sed -i "s;^\[SoundfontSearch.Directories\]$;[SoundfontSearch.Directories]\nPath=${doomPath}/fm_banks\nPath=${doomPath}/soundfonts\nPath=${installPath}/doom/soundfonts;" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
# sed -i 's/Mouse1=+attack/CTRL=+attack/' "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini" # sed -i 's/Mouse1=+attack/CTRL=+attack/' "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
launcherPath="$(readlink -f "$0")" launcherPath="$(readlink -f "$0")"
launcherPath="${launcherPath%/*}" launcherPath="${launcherPath%/*}"