Finally... a proper way to patch ui files

This commit is contained in:
Isuldor
2016-09-12 23:09:53 -07:00
parent 9a7117bbb5
commit 052592181e
214 changed files with 1283 additions and 190218 deletions
Executable
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
# Rebuild custom UI files using patches
GAME_PATH=/mnt/d/EverQuest
SCRIPT_PATH=$(dirname ${0})
UI_NAME=isuldor
if [[ ! -d "${GAME_PATH}/uifiles/default" ]]
then
echo "Notice: Searching for game location..."
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!"
fi
fi
UI_FOLDER="${GAME_PATH}/uifiles/${UI_NAME}"
mkdir -vp "${UI_FOLDER}"
cp ${SCRIPT_PATH}/*.tga "${GAME_PATH}/uifiles/${UI_NAME}/"
UI_FILES=( $( find . -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