From 43102b72b857e8f5a193cb69f3f02d3745f894ef Mon Sep 17 00:00:00 2001 From: Michael Taboada Date: Sat, 7 Nov 2026 10:56:25 -0800 Subject: [PATCH] Update the mtg arena installer and updater to be compatible with new mod. --- .includes/magic-the-gathering-arena.sh | 10 ++++++++++ .install/Magic: The Gathering Arena.sh | 12 +++++------- audiogame-manager.sh | 4 ++++ game-scripts/magic-the-gathering-arena-update.sh | 8 +++----- 4 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 .includes/magic-the-gathering-arena.sh diff --git a/.includes/magic-the-gathering-arena.sh b/.includes/magic-the-gathering-arena.sh new file mode 100644 index 0000000..2b12d19 --- /dev/null +++ b/.includes/magic-the-gathering-arena.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +run_mtga() { + local -a launchCommand=(wine) + if command -v gamemoderun >/dev/null; then + launchCommand=(gamemoderun wine) + fi +cp "$cache/prism.dll" "$WINEPREFIX/drive_c/Program Files (x86)/Wizards of the Coast/MTGA" + "${launchCommand[@]}" "$@" & +} diff --git a/.install/Magic: The Gathering Arena.sh b/.install/Magic: The Gathering Arena.sh index 73a59e4..7681d71 100644 --- a/.install/Magic: The Gathering Arena.sh +++ b/.install/Magic: The Gathering Arena.sh @@ -5,8 +5,9 @@ game="${game:-Magic: The Gathering Arena}" mtgaVersionUrl="https://mtgarena.downloads.wizards.com/Live/Windows32/version" accessibleArenaDllUrl="https://github.com/JeanStiletto/AccessibleArena/releases/latest/download/AccessibleArena.dll" +accessibleArenaPrismUrl="https://stormgames.wolfe.casa/downloads/prism.dll" melonLoaderZipUrl="https://github.com/LavaGang/MelonLoader/releases/latest/download/MelonLoader.x64.zip" -tolkDllUrl="https://stormgames.wolfe.casa/downloads/Tolk.dll" +byctrlDllUrl="https://stormgames.wolfe.casa/downloads/byctrl-x64.dll" get_mtga_installer_url() { local versionJson="" @@ -63,17 +64,14 @@ configure_accessible_arena_loader() { install_accessible_arena_support() { local mtgaRoot="$1" - if [[ -z "${nvdaControllerClient64Dll:-}" ]]; then - # shellcheck disable=SC2154 # ipfs is sourced through audiogame-manager helpers - nvdaControllerClient64Dll="${ipfs[nvdaControllerClient64]}" - fi +rm "$cache/AccessibleArena.dll" - download "$accessibleArenaDllUrl" "$melonLoaderZipUrl" "$tolkDllUrl" "$nvdaControllerClient64Dll" + download "$accessibleArenaDllUrl" "$melonLoaderZipUrl" "$accessibleArenaPrismUrl" "$byctrlDllUrl" "$nvdaControllerClient64Dll" install_with_progress unzip "Installing MelonLoader..." -d "$mtgaRoot" "${cache}/MelonLoader.x64.zip" mkdir -p "${mtgaRoot}/Mods" install_with_progress cp "Installing Accessible Arena..." "${cache}/AccessibleArena.dll" "${mtgaRoot}/Mods/AccessibleArena.dll" - install_with_progress cp "Installing screen reader support DLLs..." "${cache}/Tolk.dll" "${cache}/nvdaControllerClient64.dll" "$mtgaRoot" + install_with_progress cp "Installing screen reader support DLLs..." "${cache}/prism.dll" "${cache}/byctrl-x64.dll" "$mtgaRoot" configure_accessible_arena_loader "$mtgaRoot" } diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 28c752c..954852f 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -913,6 +913,10 @@ game_launcher() { # shellcheck source=.includes/city-of-division.sh source "${scriptDir}/.includes/city-of-division.sh" run_city_of_division "${game[1]##*\\}" + elif [[ "${wineExec,,}" == "MTGA.exe" ]]; then + # shellcheck source=.includes/city-of-division.sh + source "${scriptDir}/.includes/magic-the-gathering-arena.sh" + run_mtga "${game[1]##*\\}" else # Use direct wine execution instead of 'wine start' to ensure clipboard works # See: https://bugs.winehq.org/show_bug.cgi?id=50598 diff --git a/game-scripts/magic-the-gathering-arena-update.sh b/game-scripts/magic-the-gathering-arena-update.sh index 82e174a..6f472b7 100755 --- a/game-scripts/magic-the-gathering-arena-update.sh +++ b/game-scripts/magic-the-gathering-arena-update.sh @@ -24,12 +24,9 @@ source "${0%/*}/../.includes/dialog-interface.sh" source "${0%/*}/../.includes/functions.sh" source "${0%/*}/../.includes/bottle.sh" -export nvdaControllerClient64Dll="${ipfs[nvdaControllerClient64]}" - mtgaVersionUrl="https://mtgarena.downloads.wizards.com/Live/Windows32/version" accessibleArenaDllUrl="https://github.com/JeanStiletto/AccessibleArena/releases/latest/download/AccessibleArena.dll" melonLoaderZipUrl="https://github.com/LavaGang/MelonLoader/releases/latest/download/MelonLoader.x64.zip" -tolkDllUrl="https://stormgames.wolfe.casa/downloads/Tolk.dll" get_mtga_installer_url() { local versionJson="" @@ -84,12 +81,13 @@ configure_accessible_arena_loader() { install_accessible_arena_support() { local mtgaRoot="$1" - download "$accessibleArenaDllUrl" "$melonLoaderZipUrl" "$tolkDllUrl" "$nvdaControllerClient64Dll" +rm "$cache/AccessibleArena.dll" + + download "$accessibleArenaDllUrl" "$melonLoaderZipUrl" install_with_progress unzip "Reinstalling MelonLoader..." -d "$mtgaRoot" "${cache}/MelonLoader.x64.zip" mkdir -p "${mtgaRoot}/Mods" install_with_progress cp "Installing Accessible Arena..." "${cache}/AccessibleArena.dll" "${mtgaRoot}/Mods/AccessibleArena.dll" - install_with_progress cp "Installing screen reader support DLLs..." "${cache}/Tolk.dll" "${cache}/nvdaControllerClient64.dll" "$mtgaRoot" configure_accessible_arena_loader "$mtgaRoot" }