Skip to content

Commit f43cb75

Browse files
author
Shadowed
committed
Initial import on wowace again, since importing logs is being a pain I'll list all changes since the last release on the 28th
- Added support for boss and arena units, if you are using ShadowedUF_Arena then delete it as it's now unnecessary - Cleaned up units code a little and fixed a few comments that made no sense - Added support for Looking for Dungeon role indicators in 3.3 - Cleaned up health bar code - Empty bar now supports coloring by unit reaction and class - Color by reaction will now only override on non-player units, enemy players will default to whatever color by health is set to - Changed highlighting to highlight the inside edges of a frame rather than all of it, should result in more visible highlights - Configuration restructing: - Layout manager, Disable vehicle swap, Anchor point for combat text are now advanced options - Highlight -> Border highlight, various sub-options renamed to make more sense - Positioning/spacing of various Bars options changed to be a little more logical - Party/Raid units for the Party/Raid tab Show inside -> Visibility, merged Hide options into there too, Frame Growth renamed to Row growth - Visiblity help description is hidden if advanced options are enabled
1 parent 9f27f56 commit f43cb75

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+15461
-0
lines changed

ShadowedUnitFrames.lua

+506
Large diffs are not rendered by default.

ShadowedUnitFrames.toc

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## Interface: 30200
2+
## Title: Shadowed Unit Frames
3+
## Notes: Standby for witty TOC note.
4+
## Author: Shadowed
5+
## SavedVariables: ShadowedUFDB
6+
7+
8+
#@no-lib-strip@
9+
libs\LibStub-1.0\LibStub-1.0.xml
10+
libs\CallbackHandler-1.0\CallbackHandler-1.0.xml
11+
libs\LibSharedMedia-3.0\lib.xml
12+
libs\LibHealComm-4.0\LibHealComm-4.0.xml
13+
libs\AceDB-3.0\AceDB-3.0.xmllibs\AceDBOptions-3.0\AceDBOptions-3.0.xml
14+
libs\AceGUI-3.0\AceGUI-3.0.xml
15+
libs\AceGUI-3.0-SharedMediaWidgets\widget.xml
16+
libs\AceConfig-3.0\AceConfig-3.0.xml
17+
#@end-no-lib-strip@
18+
19+
localization.enUS.lua
20+
localization.koKR.lua
21+
localization.ruRU.lua
22+
localization.zhCN.lua
23+
localization.zhTW.lua
24+
25+
ShadowedUnitFrames.lua
26+
modules\units.lua
27+
modules\layout.lua
28+
modules\movers.lua
29+
modules\defaultlayout.lua
30+
modules\highlight.lua
31+
modules\tags.lua
32+
modules\health.lua
33+
modules\power.lua
34+
modules\portrait.lua
35+
modules\indicators.lua
36+
modules\xp.lua
37+
modules\cast.lua
38+
modules\auras.lua
39+
modules\combattext.lua
40+
modules\totems.lua
41+
modules\runes.lua
42+
modules\fader.lua
43+
modules\combopoints.lua
44+
modules\incheal.lua
45+
modules\range.lua
46+
modules\empty.lua
47+
modules\druid.lua
48+
49+
options\config.lua

globalcheck.lua

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
local isOSX = os.getenv("MANPATH") and true or false
2+
local leaks = {}
3+
local results = ""
4+
local function output(msg)
5+
results = results .. "\r\n" .. msg
6+
end
7+
8+
local function scanFile(path)
9+
output(io.popen(string.format("luac -l %s", path)):read("*all"))
10+
end
11+
12+
local function scanFolder(path)
13+
local command
14+
if( isOSX ) then
15+
command = string.format("ls \"%s\"", (path or "./"))
16+
else
17+
command = string.format("dir /B \"%s\"", (path or ""))
18+
end
19+
20+
for file in io.popen(command):lines() do
21+
local extension = string.match(file, "%.([%a%d]+)$")
22+
if( file ~= "" and not extension and file ~= "libs" ) then
23+
if( path ) then
24+
scanFolder(path .. "/" .. file)
25+
else
26+
scanFolder(file)
27+
end
28+
elseif( extension == "lua" and file ~= "localcheck.lua" and file ~= "globalcheck.lua" and not string.match(file, "^localization%.([a-zA-Z]+)%.lua") ) then
29+
if( path ) then
30+
scanFile(path .. "/" .. file)
31+
else
32+
scanFile(file)
33+
end
34+
end
35+
end
36+
end
37+
38+
scanFolder()
39+
40+
if( isOSX ) then
41+
io.popen("unlink luac.out")
42+
else
43+
io.popen("del luac.out")
44+
end
45+
46+
local file = io.open("results.txt", "w")
47+
file:write(tostring(results))
48+
file:flush()
49+
file:close()
50+
51+
52+
local f = io.open("results.txt", "r")
53+
local data = f:read("*all")
54+
function lines(str)
55+
local t = {}
56+
local function helper(line) table.insert(t, line) return "" end
57+
helper((str:gsub("(.-)\r?\n", helper)))
58+
return t
59+
end
60+
61+
local printFile
62+
for _, line in pairs(lines(data)) do
63+
if( string.match(line, "(.+) <(.+)>") ) then
64+
file = line
65+
printFile = nil
66+
end
67+
68+
if( string.match(line, "SETGLOBAL") ) then
69+
if( not printFile ) then
70+
print(file)
71+
printFile = true
72+
end
73+
74+
print(line)
75+
end
76+
end
77+
78+
f:close()
79+
if( isOSX ) then
80+
io.popen("unlink results.txt")
81+
else
82+
io.popen("del results.txt")
83+
end

localcheck.lua

+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
local isOSX = os.getenv("MANPATH") and true or false
2+
local function output(msg)
3+
io.stdout:write(msg)
4+
io.stdout:write("\n")
5+
io.stdout:flush()
6+
end
7+
8+
local file = io.open("localization.enUS.lua")
9+
local contents = file:read("*line")
10+
file:close()
11+
12+
local LOCAL_VAR = string.match(contents, "^(.+) = {")
13+
if( not LOCAL_VAR ) then
14+
output("Failed to find localization variable in localization.enUS.lua")
15+
return
16+
else
17+
output("Localization key " .. LOCAL_VAR)
18+
end
19+
20+
function string.trim(text)
21+
return string.gsub(text, "^%s*(.-)%s*$", "%1")
22+
end
23+
24+
local foundLocals = {}
25+
local totalFound = 0
26+
local function scanFile(path)
27+
output("Scanning " .. path)
28+
29+
local contents = io.open(path):read("*all")
30+
for line in string.gmatch(contents, "L%[\"(.-)\"%]") do
31+
foundLocals[string.trim(line)] = true
32+
totalFound = totalFound + 1
33+
end
34+
35+
for line in string.gmatch(contents, LOCAL_VAR .. "%[\"(.-)\"%]") do
36+
foundLocals[string.trim(line)] = true
37+
totalFound = totalFound + 1
38+
end
39+
end
40+
41+
local function scanFolder(path)
42+
local command
43+
if( isOSX ) then
44+
command = string.format("ls \"%s\"", (path or "./"))
45+
else
46+
command = string.format("dir /B \"%s\"", (path or ""))
47+
end
48+
49+
for file in io.popen(command):lines() do
50+
local extension = string.match(file, "%.([%a%d]+)$")
51+
if( file ~= "" and not extension and file ~= "libs" ) then
52+
if( path ) then
53+
scanFolder(path .. "/" .. file)
54+
else
55+
scanFolder(file)
56+
end
57+
elseif( extension == "lua" and file ~= "localcheck.lua" and file ~= "globalcheck.lua" and not string.match(file, "^localization") ) then
58+
if( path ) then
59+
scanFile(path .. "/" .. file)
60+
else
61+
scanFile(file)
62+
end
63+
end
64+
end
65+
end
66+
67+
scanFolder()
68+
69+
output("Total keys found " .. totalFound)
70+
71+
-- Sort everything
72+
local keyOrder = {}
73+
for key in pairs(foundLocals) do
74+
table.insert(keyOrder, key)
75+
end
76+
77+
table.sort(keyOrder, function(a, b) return a < b end)
78+
79+
-- Load the current localization to get the tables out
80+
dofile("localization.enUS.lua")
81+
82+
local file = io.open("localization.enUS.lua", "w")
83+
file:write(LOCAL_VAR .. " = {")
84+
85+
-- Write all used keys
86+
for _, key in pairs(keyOrder) do
87+
file:write(string.format("\n [\"%s\"] = \"%s\",", key, key))
88+
end
89+
90+
-- Format the string so it can be written
91+
local function parse(text)
92+
text = string.gsub(text, "\n", "\\n")
93+
text = string.gsub(text, "\"", "\\\"")
94+
text = string.trim(text)
95+
96+
return text
97+
end
98+
99+
-- Tables inside localization are assumed to always be there
100+
local _G = getfenv(0)
101+
local keyOrder = {}
102+
for key, data in pairs(_G[LOCAL_VAR]) do
103+
if( type(data) == "table" ) then
104+
table.insert(keyOrder, key)
105+
end
106+
end
107+
108+
table.sort(keyOrder, function(a, b) return a < b end)
109+
110+
file:write("\n")
111+
112+
local hadTables
113+
local function writeTable(key, tbl, depth)
114+
file:write(string.format(string.rep(" ", depth) .. "[\"%s\"] = {\n", key))
115+
116+
local data = tbl[key]
117+
local subKeyOrder = {}
118+
for subKey in pairs(data) do
119+
table.insert(subKeyOrder, subKey)
120+
end
121+
122+
table.sort(subKeyOrder, function(a, b) return a < b end)
123+
for _, subKey in pairs(subKeyOrder) do
124+
if( type(data[subKey]) == "table" ) then
125+
writeTable(subKey, data, depth + 1)
126+
elseif( tonumber(subKey) ) then
127+
file:write(string.format("%s[%s] = \"%s\",\n", string.rep(" ", depth + 1), subKey, parse(data[subKey])))
128+
else
129+
file:write(string.format("%s[\"%s\"] = \"%s\",\n", string.rep(" ", depth + 1), parse(subKey), parse(data[subKey])))
130+
end
131+
end
132+
133+
hadTables = true
134+
file:write(string.rep(" ", depth) .. "},\n")
135+
end
136+
137+
for _, key in pairs(keyOrder) do
138+
writeTable(key, _G[LOCAL_VAR], 1)
139+
end
140+
141+
if( hadTables ) then
142+
file:write("\n")
143+
end
144+
145+
file:write("}")
146+
file:flush()
147+
file:close()
148+
149+
150+
output("Done")
151+
152+
153+

0 commit comments

Comments
 (0)