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
9 changed files with 248 additions and 154 deletions

View File

@ -677,13 +677,14 @@ case "${game}" in
add_launcher "${installPath}/FS2_2.7_Linux/fs2.x86_64" "-ESpeakApplication=espeak-ng"
;;
"Freedoom")
tobyVersion="7-0"
tobyVersion="7-5"
mkdir -p "${installPath}/doom"
doomPath="$(find /usr/share -type d -name "doom" 2> /dev/null)"
if [[ ${#doomPath} -lt 5 ]]; then
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
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
su -c 'slapt-src -i freedoom gzdoom'
elif command -v dnf &> /dev/null ; then
@ -696,7 +697,7 @@ case "${game}" in
fi
fi
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
dialog --backtitle "Linux Game manager" \
--extra-button \
@ -715,22 +716,22 @@ case "${game}" in
fi
# The url breaks the normal download function
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"
echo "The next step may require your password."
echo "It is necessary to move the extracted files into their proper place."
alert
[[ -e "${cache}/DoomMetalVol6.wad" ]] && sudo mv "${cache}/DoomMetalVol6.wad" "${doomPath}/"
[[ -e "${cache}/DoomMetalVol7.wad" ]] && sudo mv "${cache}/DoomMetalVol7.wad" "${doomPath}/"
sudo unzip -n -d "${doomPath}" "${cache}/TobyAccessibilityMod_Version${tobyVersion}.zip"
sudo unzip -n -d "${doomPath}" "${cache}/OpMDK_ForV7-0.zip"
sudo cp -v "${cache}/keyshare-universal.pk3" "${doomPath}"
sudo rm -fv "${doomPath}/"*.{bat,exe}
download "${ipfsGateway}/ipfs/QmNtn1bugWQg2Y8rB29FH6zYzthsebxmpuMcHcErprzx3z?filename=TobyAccessibilityMod_Version${tobyVersion}.zip" "${ipfsGateway}/ipfs/QmNUfYa5P9J6EaDZoGvsiG2ArMR3BCc3gTcW3wPo1HABLU?filename=OpMDK_ForV${tobyVersion}.zip"
[[ -e "${cache}/DoomMetalVol6.wad" ]] && mv "${cache}/DoomMetalVol6.wad" "${installPath}/doom"
[[ -e "${cache}/DoomMetalVol7.wad" ]] && mv "${cache}/DoomMetalVol7.wad" "${installPath}/doom"
unzip -n -d "${installPath}/doom" "${cache}/TobyAccessibilityMod_Version${tobyVersion}.zip"
unzip -n -d "${installPath}/doom" "${cache}/OpMDK_ForV7-0.zip"
cp -v "${cache}/keyshare-universal.pk3" "${installPath}/doom"
rm -fv "${installPath}/doom/"*.{bat,dll,exe}
if [[ -e /usr/share/doom/blasphem.wad ]]; then
ln -s /usr/share/doom/blasphem.wad "${installPath}/doom/"
fi
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom"
cp "${doomPath}/TobyConfig.ini" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
cp "${doomPath}/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;^\[FileSearch.Directories\]$;[FileSearch.Directories]\nPath=${doomPath};" "${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"
cp "${installPath}/doom/TobyConfig.ini" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/gzdoom.ini"
cp "${installPath}/doom/zcajun/bots.cfg" "${XDG_CONFIG_HOME:-$HOME/.config}/gzdoom/"
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}\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\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"
launcherPath="$(readlink -f "$0")"
launcherPath="${launcherPath%/*}"