#!/bin/bash
# Classes-tab picker + multiclass /who (2026-09-29) + weapon Ratio line in the item window (2026-09-28): install the
# staged DLL and inventory XML into one client folder
# (default: Trevor's desktop client). Backups: *.bak-classestab (made once, never overwritten).
# Run on the desktop:  bash install_desktop.sh [client_dir]     (after copying this folder there)
# The Bigg patcher puts the shipped files back if it runs before promotion; re-run this afterwards.
set -euo pipefail
here="$(cd "$(dirname "$0")" && pwd)"
dst="${1:-/home/tj/Desktop/everquest_rof2_tanks}"
for f in dinput8.dll uifiles/default/EQUI_Inventory.xml; do
    src="$here/$(basename "$f")"
    [ -f "$dst/$f.bak-classestab" ] || cp -p "$dst/$f" "$dst/$f.bak-classestab"
    cp "$src" "$dst/$f.new" && mv -f "$dst/$f.new" "$dst/$f"   # rename: a running client keeps its mapped copy
    echo "installed $f"
done
