-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
make.sh
executable file
·135 lines (114 loc) · 4.31 KB
/
make.sh
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/bin/sh
# backup old readme
mv README.md .README.md
cp -rf ../pfUI/* .
mv .README.md README.md
# delete skins
rm -rf skins
rm init/skins.xml
# misc
rm -rf Bindings.xml
# delete other modules
mv modules/settings.lua .
mv modules/cooldown.lua .
mv modules/nameplates.lua .
mv modules/superwow.lua .
mv modules/turtle-wow.lua .
rm modules/*
mv settings.lua modules
mv cooldown.lua modules
mv superwow.lua modules
mv turtle-wow.lua modules
mv nameplates.lua modules
# replace all variables and frames
find . -iname "*.lua" -type f | xargs sed -i 's/pfUI/ShaguPlates/g'
find . -iname "*.lua" -type f | xargs sed -i 's/PFUI/SHAGUPLATES/g'
find . -iname "*.lua" -type f | xargs sed -i 's/pfui/shaguplates/g'
find . -iname "*.toc" -type f | xargs sed -i 's/|cff33ffccpf|cffffffffUI/|cff33ffccShagu|cffffffffPlates/g'
find . -iname "*.toc" -type f | xargs sed -i 's/pfUI/ShaguPlates/g'
find . -iname "*.toc" -type f | xargs sed -i '/init\\skins.xml/d'
find . -iname "*.toc" -type f | xargs sed -i 's/## Notes:.*/## Notes: Nameplate addon featuring castbars, class colors and much more. Type \/splates to show the settings./g'
find . -iname "*.toc" -type f | xargs sed -i '/Notes-/d'
# use unitframes by default to not interfere with UI
sed -i 's/"use_unitfonts".*"0")/"use_unitfonts", "1")/g' api/config.lua
sed -i 's/"use_unitfonts".*"0")/"use_unitfonts", "1")/g' api/config.lua
sed -i 's/"border",.*"nameplates",.*"-1"/"border", "nameplates", "2"/g' api/config.lua
sed -i 's/\("appearance", "cd", "blizzard", "\)1"/\10"/g' api/config.lua
# use non-pfUI design as default
sed -i 's/"font_unit".*)/"font_unit", "Fonts\\\\FRIZQT__.TTF")/g' api/config.lua
sed -i 's/"font_default".*)/"font_default", "Fonts\\\\FRIZQT__.TTF")/g' api/config.lua
sed -i 's/"force_blizz".*)/"force_blizz", "1")/g' api/config.lua
sed -i 's/"nameplates", "health", "offset", "-3"/"nameplates", "health", "offset", "-4"/' api/config.lua
# only load required modules
echo '<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Include file="..\modules\cooldown.lua"/>
<Include file="..\modules\settings.lua"/>
<Include file="..\modules\nameplates.lua"/>
<Include file="..\modules\superwow.lua"/>
<Include file="..\modules\turtle-wow.lua"/>
</Ui>' > init/modules.xml
# remove unitframe api
rm api/unitframes.lua
sed -i '/.*unitframes.*/d' init/api.xml
# remove libtotem
rm libs/libtotem.lua
rm libs/libpredict.lua
sed -i '/.*libtotem.*/d' init/libs.xml
# remove obsolete graphics
rm img/classicons.tga
rm img/Curse.tga
rm img/Disease.tga
rm img/disenchant.tga
rm img/empty.tga
rm img/full.tga
rm img/key.tga
rm img/Magic.tga
rm img/mail.tga
rm img/minimap.tga
rm img/happy*.tga
rm img/neutral*.tga
rm img/sad*.tga
rm img/picklock.tga
rm img/Poison.tga
rm img/proxy.tga
rm img/pvp.tga
rm img/ress.tga
rm img/sort.tga
rm img/circleparty.tga
rm img/circleraid.tga
# remove obsolete fonts
rm fonts/RobotoMono.ttf
# rename core files
mv pfUI.toc ShaguPlates.toc
mv pfUI-tbc.toc ShaguPlates-tbc.toc
mv pfUI.lua ShaguPlates.lua
# disable changing the default fonts
sed -i '/.*SetFont.*/d' ShaguPlates.lua
sed -i '/.*STANDARD_TEXT_FONT.*/d' ShaguPlates.lua
sed -i '/.*DAMAGE_TEXT_FONT.*/d' ShaguPlates.lua
sed -i '/.*NAMEPLATE_FONT.*/d' ShaguPlates.lua
sed -i '/.*UNIT_NAME_FONT.*/d' ShaguPlates.lua
sed -i '/.*UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT.*/d' ShaguPlates.lua
# remove default error handler
sed -i '/seterrorhandler/d' ShaguPlates.lua
sed -i 's/message = function(msg)/local message = function(msg)/g' ShaguPlates.lua
sed -i '/print = print or message/d' ShaguPlates.lua
sed -i '/SIMPLE_CHAT = /d' ShaguPlates.lua
# add aditional slashcomands
sed -i "7iSLASH_SHAGUPLATES2 = '/splates'" ShaguPlates.lua
sed -i "8iSLASH_SHAGUPLATES3 = '/sp'" ShaguPlates.lua
# remove obsolete translations
for locale in "deDE" "enUS" "frFR" "koKR" "ruRU" "zhCN" "zhTW" "esES"; do
file=env/translations_$locale.lua
file_new=env/translations_$locale.lua_new
echo "ShaguPlates_translation[\"$locale\"] = {" > $file_new
cat *.lua modules/* | sed "s/\(T\[\"\)/\n\1/" | grep -oP "T\[\".*?\"]" | sed 's/T\["\(.*\)"\]/\1/' | sort | uniq | while read -r entry; do
old=$(grep -F "[\"$entry\"]" $file | head -n 1 2> /dev/null)
if [ -z "$old" ] ; then
old=" [\"$entry\"] = nil,"
fi
echo "$old"
done >> $file_new
echo "}" >> $file_new
mv $file_new $file
done