Overhaul scripts for 2026 refresh
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
# Last install verified to apply all UI patches. Refresh with: bash ui/verify.sh --record
|
||||
verified_date=2026-05-26T11:02:00-07:00
|
||||
eqgame_mtime=2026-05-22 10:52:08.000000000 -0700
|
||||
EQUI_PlayerWindow_mtime=2022-09-15 08:04:02.000000000 -0700
|
||||
game_path=/home/pleb/.local/share/Steam/steamapps/common/Everquest F2P
|
||||
patch_count=6
|
||||
patches=EQUI_Animations,EQUI_CastSpellWnd,EQUI_ChatWindow,EQUI_HotButtonWnd,EQUI_PlayerWindow,EQUI_Templates
|
||||
@@ -0,0 +1,39 @@
|
||||
# Shared EverQuest install root detection. Source from other ui/*.sh scripts.
|
||||
find_game_path() {
|
||||
if [[ -n "${EQ_GAME_PATH:-}" && -f "${EQ_GAME_PATH}/eqgame.exe" ]]; then
|
||||
echo "${EQ_GAME_PATH}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local steam_linux="${HOME}/.local/share/Steam/steamapps/common/Everquest F2P"
|
||||
if [[ -f "${steam_linux}/eqgame.exe" ]]; then
|
||||
echo "${steam_linux}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ -f "/mnt/d/EverQuest/eqgame.exe" ]]; then
|
||||
echo "/mnt/d/EverQuest"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local game_location
|
||||
game_location=$(find /mnt -type f -name eqgame.exe ! -path '*RECYCLE.BIN*' 2>/dev/null | head -n1)
|
||||
if [[ -n "${game_location}" ]]; then
|
||||
dirname "${game_location}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
resolve_game_path() {
|
||||
local game_path="${EQ_GAME_PATH:-}"
|
||||
if [[ -z "${game_path}" ]] || [[ ! -f "${game_path}/eqgame.exe" ]]; then
|
||||
if ! game_path=$(find_game_path); then
|
||||
echo "Error: EverQuest was not found! Set EQ_GAME_PATH to your install root." >&2
|
||||
return 1
|
||||
fi
|
||||
echo "Using GAME_PATH=${game_path}" >&2
|
||||
fi
|
||||
echo "${game_path}"
|
||||
}
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Rebuild custom UI files using patches
|
||||
# -u, --update to update the patch set with new changes
|
||||
|
||||
GAME_PATH=/mnt/d/EverQuest
|
||||
UI_NAME=isuldor
|
||||
|
||||
if [[ ! -f "${GAME_PATH}/eqgame.exe" ]]
|
||||
then
|
||||
echo "Notice: Game path not set, searching for EverQuest..."
|
||||
GAME_LOCATION=$(find /mnt -type f -name eqgame.exe ! -path '*RECYCLE.BIN*' 2>/dev/null | head -n1)
|
||||
if [[ ${GAME_LOCATION} ]]
|
||||
then
|
||||
GAME_PATH=$(dirname ${GAME_LOCATION})
|
||||
echo "Set GAME_PATH=${GAME_PATH}"
|
||||
else
|
||||
echo "Error: EverQuest was not found!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
SCRIPT_PATH=$(dirname ${0})
|
||||
UI_FOLDER="${GAME_PATH}/uifiles/${UI_NAME}"
|
||||
|
||||
# We can update our patch set with changes
|
||||
if [[ "-u" == ${1} || "--update" == ${1} ]]
|
||||
then
|
||||
echo "Updating patch set!"
|
||||
# rm -v "${SCRIPT_PATH}/EQUI_*.diff"
|
||||
UI_FILES=( $( find "${UI_FOLDER}" -name '*.xml' -exec basename {} .xml \; ))
|
||||
for UI_FILE in "${UI_FILES[@]}"
|
||||
do
|
||||
diff -u "${GAME_PATH}/uifiles/default/${UI_FILE}.xml" \
|
||||
"${UI_FOLDER}/${UI_FILE}.xml" > ${SCRIPT_PATH}/${UI_FILE}.diff
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Build custom UI directory
|
||||
mkdir -vp "${UI_FOLDER}"
|
||||
cp ${SCRIPT_PATH}/*.tga "${UI_FOLDER}/"
|
||||
|
||||
# Build an array of all diffs to patch, stripping the extension
|
||||
UI_FILES=( $( find "${SCRIPT_PATH}" -name '*.diff' -exec basename {} .diff \; ))
|
||||
|
||||
for UI_FILE in "${UI_FILES[@]}"
|
||||
do
|
||||
patch --ignore-whitespace --fuzz 3 -o "${UI_FOLDER}/${UI_FILE}.xml" "${GAME_PATH}/uifiles/default/${UI_FILE}.xml" < ${SCRIPT_PATH}/${UI_FILE}.diff
|
||||
done
|
||||
Executable
+66
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
# Rebuild custom UI files using patches
|
||||
# install.sh — apply patches to uifiles/isuldor/
|
||||
# install.sh --update — regenerate *.diff from uifiles/isuldor/ (CRLF-normalized)
|
||||
#
|
||||
# Set EQ_GAME_PATH to your install root, or rely on auto-detection.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
UI_NAME=isuldor
|
||||
SCRIPT_PATH=$(dirname "${0}")
|
||||
# shellcheck source=eq-path.sh
|
||||
source "${SCRIPT_PATH}/eq-path.sh"
|
||||
|
||||
GAME_PATH=$(resolve_game_path) || exit 1
|
||||
UI_FOLDER="${GAME_PATH}/uifiles/${UI_NAME}"
|
||||
DEFAULT_UI="${GAME_PATH}/uifiles/default"
|
||||
|
||||
# Stock uifiles/default/*.xml use CRLF; LF-only isuldor files produce whole-file diffs.
|
||||
crlf_temp() {
|
||||
local src=$1
|
||||
local dest=$2
|
||||
sed 's/$/\r/' "${src}" > "${dest}"
|
||||
}
|
||||
|
||||
needs_crlf_diff() {
|
||||
local default_xml=$1
|
||||
file "${default_xml}" 2>/dev/null | grep -q CRLF
|
||||
}
|
||||
|
||||
# Regenerate patch set from built skin
|
||||
if [[ "${1:-}" == "-u" || "${1:-}" == "--update" ]]; then
|
||||
echo "Updating patch set from ${UI_FOLDER}..."
|
||||
UI_FILES=( $( find "${UI_FOLDER}" -name '*.xml' -exec basename {} .xml \; ))
|
||||
for UI_FILE in "${UI_FILES[@]}"; do
|
||||
default_xml="${DEFAULT_UI}/${UI_FILE}.xml"
|
||||
isuldor_xml="${UI_FOLDER}/${UI_FILE}.xml"
|
||||
out_diff="${SCRIPT_PATH}/${UI_FILE}.diff"
|
||||
if needs_crlf_diff "${default_xml}"; then
|
||||
crlf_temp "${isuldor_xml}" "${out_diff}.isuldor.crlf"
|
||||
diff -u "${default_xml}" "${out_diff}.isuldor.crlf" > "${out_diff}"
|
||||
rm -f "${out_diff}.isuldor.crlf"
|
||||
else
|
||||
diff -u "${default_xml}" "${isuldor_xml}" > "${out_diff}"
|
||||
fi
|
||||
echo " ${UI_FILE}.diff"
|
||||
done
|
||||
echo "Run: bash ui/verify.sh --record"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -vp "${UI_FOLDER}"
|
||||
cp "${SCRIPT_PATH}"/*.tga "${UI_FOLDER}/"
|
||||
|
||||
UI_FILES=( $( find "${SCRIPT_PATH}" -name '*.diff' -exec basename {} .diff \; ))
|
||||
|
||||
for UI_FILE in "${UI_FILES[@]}"; do
|
||||
if ! patch --ignore-whitespace --fuzz 3 -o "${UI_FOLDER}/${UI_FILE}.xml" \
|
||||
"${DEFAULT_UI}/${UI_FILE}.xml" < "${SCRIPT_PATH}/${UI_FILE}.diff"; then
|
||||
echo "Error: patch failed for ${UI_FILE}" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Installed ${#UI_FILES[@]} files to ${UI_FOLDER}"
|
||||
echo "Set UISkin=${UI_NAME} in your character UI INI, then: bash ui/verify.sh --record"
|
||||
Executable
+112
@@ -0,0 +1,112 @@
|
||||
#!/bin/bash
|
||||
# Dry-run all UI patches against uifiles/default. Exit 1 on any failure.
|
||||
#
|
||||
# Usage:
|
||||
# bash ui/verify.sh # verify patches only
|
||||
# bash ui/verify.sh --strict # also warn if eqgame.exe mtime differs from ui/.verified-build
|
||||
# bash ui/verify.sh --record # verify, then refresh ui/.verified-build from current install
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_PATH=$(dirname "${0}")
|
||||
# shellcheck source=eq-path.sh
|
||||
source "${SCRIPT_PATH}/eq-path.sh"
|
||||
|
||||
STRICT=0
|
||||
RECORD=0
|
||||
for arg in "$@"; do
|
||||
case "${arg}" in
|
||||
--strict) STRICT=1 ;;
|
||||
--record) RECORD=1 ;;
|
||||
-h|--help)
|
||||
echo "Usage: verify.sh [--strict] [--record]"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: ${arg}" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
GAME_PATH=$(resolve_game_path) || exit 1
|
||||
DEFAULT_UI="${GAME_PATH}/uifiles/default"
|
||||
PATCH_DIR="${SCRIPT_PATH}"
|
||||
VERIFIED_FILE="${PATCH_DIR}/.verified-build"
|
||||
|
||||
if [[ ! -d "${DEFAULT_UI}" ]]; then
|
||||
echo "Error: missing ${DEFAULT_UI}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
shopt -s nullglob
|
||||
diffs=( "${PATCH_DIR}"/*.diff )
|
||||
if [[ ${#diffs[@]} -eq 0 ]]; then
|
||||
echo "Error: no *.diff files in ${PATCH_DIR}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
FAIL=0
|
||||
for diff_file in "${diffs[@]}"; do
|
||||
base=$(basename "${diff_file}" .diff)
|
||||
default_xml="${DEFAULT_UI}/${base}.xml"
|
||||
if [[ ! -f "${default_xml}" ]]; then
|
||||
echo "FAIL: ${base} — missing ${default_xml}"
|
||||
FAIL=1
|
||||
continue
|
||||
fi
|
||||
if patch --dry-run --ignore-whitespace --fuzz 3 -o /dev/null \
|
||||
"${default_xml}" < "${diff_file}" >/dev/null 2>&1; then
|
||||
echo "OK: ${base}"
|
||||
else
|
||||
echo "FAIL: ${base}"
|
||||
patch --dry-run --ignore-whitespace --fuzz 3 -o /dev/null \
|
||||
"${default_xml}" < "${diff_file}" 2>&1 | tail -5
|
||||
FAIL=1
|
||||
fi
|
||||
done
|
||||
|
||||
# Required theme textures
|
||||
for tga in dark_tile_64.tga dark_tile_192.tga; do
|
||||
if [[ ! -f "${PATCH_DIR}/${tga}" ]]; then
|
||||
echo "FAIL: missing texture ${PATCH_DIR}/${tga}"
|
||||
FAIL=1
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ ${FAIL} -ne 0 ]]; then
|
||||
echo "Verify failed." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "All ${#diffs[@]} patches apply cleanly against ${DEFAULT_UI}"
|
||||
|
||||
if [[ ${STRICT} -eq 1 && -f "${VERIFIED_FILE}" ]]; then
|
||||
pinned=$(grep -E '^eqgame_mtime=' "${VERIFIED_FILE}" | cut -d= -f2- | tr -d '\r\n' || true)
|
||||
current=$(stat -c '%y' "${GAME_PATH}/eqgame.exe" 2>/dev/null | tr -d '\r\n')
|
||||
if [[ -n "${pinned}" && "${pinned}" != "${current}" ]]; then
|
||||
echo "WARN: eqgame.exe mtime differs from ui/.verified-build" >&2
|
||||
echo " pinned: ${pinned}" >&2
|
||||
echo " current: ${current}" >&2
|
||||
echo " Re-run: bash ui/verify.sh --record (after confirming patches still OK in-game)" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${RECORD} -eq 1 ]]; then
|
||||
eq_mtime=$(stat -c '%y' "${GAME_PATH}/eqgame.exe")
|
||||
pw_mtime=$(stat -c '%y' "${DEFAULT_UI}/EQUI_PlayerWindow.xml" 2>/dev/null || echo unknown)
|
||||
patch_list=$(basename -a "${diffs[@]}" .diff | paste -sd, -)
|
||||
cat > "${VERIFIED_FILE}" <<EOF
|
||||
# Last install verified to apply all UI patches. Refresh with: bash ui/verify.sh --record
|
||||
verified_date=$(date -Iseconds)
|
||||
eqgame_mtime=${eq_mtime}
|
||||
EQUI_PlayerWindow_mtime=${pw_mtime}
|
||||
game_path=${GAME_PATH}
|
||||
patch_count=${#diffs[@]}
|
||||
patches=${patch_list}
|
||||
EOF
|
||||
echo "Recorded ${VERIFIED_FILE}"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user