Updated changelog.
This commit is contained in:
@@ -78,6 +78,64 @@ setup_and_run_downloadable() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Enhanced function to handle downloadable games with direct URL support
|
||||
setup_and_run_downloadable_url() {
|
||||
local downloadUrl="$1"
|
||||
local gameDir="$2"
|
||||
local executable="$3"
|
||||
local fallbackUrl="$4"
|
||||
local needNvda="$5"
|
||||
local extractDir="$HOME/.local/games/$gameDir"
|
||||
local tempZip="/tmp/${gameDir}_download.zip"
|
||||
|
||||
# Check if game is already installed
|
||||
if [[ -e "$extractDir/$executable" ]]; then
|
||||
run_wine "$gameDir" "./$executable" "$needNvda"
|
||||
return
|
||||
fi
|
||||
|
||||
# Download the game
|
||||
echo "Downloading $gameDir..."
|
||||
if curl -L -o "$tempZip" "$downloadUrl"; then
|
||||
# Recreate extractDir
|
||||
rm -rf "$extractDir"
|
||||
mkdir -p "$extractDir"
|
||||
|
||||
# Get the first path component of each file in the zip
|
||||
mapfile -t topDirs < <(unzip -l "$tempZip" | awk 'NR>3 {print $4}' | grep '/$' | cut -d/ -f1 | sort -u | grep -v '^$')
|
||||
if [[ ${#topDirs[@]} -eq 1 ]]; then
|
||||
# Zip has a single top-level dir - extract to ~/.local/games, then rename
|
||||
unzip -q "$tempZip" -d ~/.local/games
|
||||
# If the extracted dir name differs from gameDir, rename it
|
||||
if [[ "${topDirs[0]}" != "$gameDir" ]]; then
|
||||
mv ~/.local/games/"${topDirs[0]}" "$extractDir"
|
||||
fi
|
||||
else
|
||||
# Unzips file into the given directory without creating a subdirectory
|
||||
unzip -q "$tempZip" -d "$extractDir"
|
||||
fi
|
||||
|
||||
# Copy NVDA DLLs
|
||||
for i in 32 64; do
|
||||
find "$extractDir" -type f -name "nvdaControllerClient${i}.dll" -exec cp -v "$HOME/.local/games/nvda/nvdaControllerClient${i}.dll" '{}' \;
|
||||
done
|
||||
|
||||
rm -f "$tempZip"
|
||||
echo "Download and installation complete!"
|
||||
|
||||
# Now run the game
|
||||
if [[ -e "$extractDir/$executable" ]]; then
|
||||
run_wine "$gameDir" "./$executable" "$needNvda"
|
||||
else
|
||||
echo "Error: Game executable not found after installation"
|
||||
run_web "$fallbackUrl"
|
||||
fi
|
||||
else
|
||||
echo "Download failed, opening fallback URL"
|
||||
run_web "$fallbackUrl"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to handle all web-based games
|
||||
run_web() {
|
||||
orca &
|
||||
@@ -377,6 +435,12 @@ case "$GAME" in
|
||||
"Wicked Quest")
|
||||
run_native "wicked-quest" "wicked_quest.py"
|
||||
;;
|
||||
"Wreckingball")
|
||||
setup_and_run_downloadable_url "https://sightlesswolf.com/wreckingball.zip" "wreckingball" "wreckingball.exe" "https://sightlesswolf.com" "nvda2speechd"
|
||||
;;
|
||||
"Wreckingball (Pulped)")
|
||||
setup_and_run_downloadable_url "https://sightlesswolf.com/wreckingball-pulped.zip" "wreckingball-pulped" "wreckingball.exe" "https://sightlesswolf.com" "nvda2speechd"
|
||||
;;
|
||||
"Kitchensinc")
|
||||
pushd "/home/stormux/.wine32/drive_c/Program Files/Kitchen's Sink"
|
||||
WINEPREFIX=/home/stormux/.wine32 /home/stormux/.local/wine32/bin/wine gamemenu.exe
|
||||
|
||||
Reference in New Issue
Block a user