-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathut2004
executable file
·62 lines (53 loc) · 2.33 KB
/
ut2004
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# Copyright 2023 Daniel Rusek <mail@asciiwolf.com>
# Based on ioquake3 launcher script by Mattias Bengtsson
# SPDX-License-Identifier: GPL-3.0-or-later
function error-message {
cat << EOM
Unreal Tournament 2004 needs the official game files
to function properly.
Please copy the game installation directory content
from Steam, GOG or retail DVD release here:
~/.var/app/com.epicgames.ut2004/data/
… and restart Unreal Tournament 2004
EOM
}
for i in Animations Sounds System Textures; do
if [ ! -d "${XDG_DATA_HOME}/${i}" ]; then
zenity --error \
--width=400 \
--height=200 \
--text="$(error-message)"
exit 2
fi
done
if [ ! -f "${XDG_DATA_HOME}/patched" ]; then
cp -rf /app/extra/UT2004-Patch/* "${XDG_DATA_HOME}"/
# Replace outdated bundled libraries with newer versions
ln -sf /usr/lib/x86_64-linux-gnu/libopenal.so.1 "${XDG_DATA_HOME}"/System/openal.so
ln -sf /app/lib/libSDL-1.2.so.0 "${XDG_DATA_HOME}"/System/libSDL-1.2.so.0
ln -sf /app/share/games/ut2004/libs/libstdc++.so.5.0.7 "${XDG_DATA_HOME}"/System/libstdc++.so.5
# Use OpenSpy master server
sed -i "s/ut2004master1.epicgames.com/utmaster.openspy.net/" "${XDG_DATA_HOME}"/System/Default.ini
sed -e '/MasterServerList=(Address="ut2004master2.epicgames.com"/ s/^;*/;/' -i "${XDG_DATA_HOME}"/System/Default.ini
# Install foxWSFix
if grep -Fxq "InputClass=Class'foxWSFix.foxPlayerInput'" "${XDG_DATA_HOME}"/System/User.ini; then
echo "foxWSFix already installed"
else
cp /app/share/games/ut2004/foxwsfix/foxWSFix.u "${XDG_DATA_HOME}"/System/foxWSFix.u
sed -i "s/InputClass=Class'Engine.PlayerInput'/InputClass=Class'foxWSFix.foxPlayerInput'/g" "${XDG_DATA_HOME}"/System/User.ini
echo -e "\n\n[XGame.xPlayer]\nInputClass=Class'foxWSFix.foxPlayerInput'" >> "${XDG_DATA_HOME}"/System/User.ini
fi
touch "${XDG_DATA_HOME}"/patched
fi
if [ ! -s "${XDG_DATA_HOME}/System/cdkey" ]; then
CDKEY=$(zenity --entry \
--width=400 \
--height=200 \
--title="CD Key Required" \
--text="Please enter your Unreal Tournament 2004 CD Key." \
--entry $CDKEY)
[ ! -z "$CDKEY" ] && echo $CDKEY > "${XDG_DATA_HOME}"/System/cdkey
fi
cd ${XDG_DATA_HOME}/System
exec ./ut2004-bin-linux-amd64 "$@"