34 lines
976 B
Bash
Executable File
34 lines
976 B
Bash
Executable File
#!/bin/bash
|
|
# Rebuild custom UI files using patches
|
|
|
|
GAME_PATH=/mnt/d/EverQuest
|
|
UI_NAME=isuldor
|
|
|
|
if [[ ! -d "${GAME_PATH}/uifiles/default" ]]
|
|
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 "Setting 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}"
|
|
|
|
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 -o "${UI_FOLDER}/${UI_FILE}.xml" "${GAME_PATH}/uifiles/default/${UI_FILE}.xml" < ${SCRIPT_PATH}/${UI_FILE}.diff
|
|
done
|