Skip to content

Commit dcb2fe9

Browse files
committed
Initial Conversion
1 parent 87f2da1 commit dcb2fe9

136 files changed

Lines changed: 27078 additions & 25790 deletions

File tree

Some content is hidden

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

.styluaignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
WeakAurasModelPaths
2+
Libs
3+
babelfish.lua
4+
WeakAuras_Main.lua
5+
WeakAuras_Options.lua
6+
WeakAuras_Templates.lua

WeakAuras/Animations.lua

Lines changed: 237 additions & 237 deletions
Large diffs are not rendered by default.

WeakAuras/AuraEnvironment.lua

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
if not WeakAuras.IsLibsOK() then return end
1+
if not WeakAuras.IsLibsOK() then
2+
return
3+
end
24
local AddonName, Private = ...
35

46
local WeakAuras = WeakAuras
@@ -14,11 +16,13 @@ local UnitAura = UnitAura
1416
-- Unit Aura functions that return info about the first Aura matching the spellName or spellID given on the unit.
1517
local WA_GetUnitAura = function(unit, spell, filter)
1618
if filter and not filter:upper():find("FUL") then
17-
filter = filter.."|HELPFUL"
19+
filter = filter .. "|HELPFUL"
1820
end
1921
for i = 1, 255 do
2022
local name, _, _, _, _, _, _, _, _, spellId = UnitAura(unit, i, filter)
21-
if not name then return end
23+
if not name then
24+
return
25+
end
2226
if spell == spellId or spell == name then
2327
return UnitAura(unit, i, filter)
2428
end
@@ -32,33 +36,33 @@ if WeakAuras.IsClassic() then
3236
if spellId then
3337
local durationNew, expirationTimeNew = LCD:GetAuraDurationByUnit(unit, spellId, source, name)
3438
if duration == 0 and durationNew then
35-
duration = durationNew
36-
expirationTime = expirationTimeNew
39+
duration = durationNew
40+
expirationTime = expirationTimeNew
3741
end
3842
end
3943
return name, icon, count, debuffType, duration, expirationTime, source, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossDebuff, castByPlayer, nameplateShowAll, timeMod
4044
end
4145
end
4246

4347
local WA_GetUnitBuff = function(unit, spell, filter)
44-
filter = filter and filter.."|HELPFUL" or "HELPFUL"
48+
filter = filter and filter .. "|HELPFUL" or "HELPFUL"
4549
return WA_GetUnitAura(unit, spell, filter)
4650
end
4751

4852
local WA_GetUnitDebuff = function(unit, spell, filter)
49-
filter = filter and filter.."|HARMFUL" or "HARMFUL"
53+
filter = filter and filter .. "|HARMFUL" or "HARMFUL"
5054
return WA_GetUnitAura(unit, spell, filter)
5155
end
5256

5357
-- Function to assist iterating group members whether in a party or raid.
5458
local WA_IterateGroupMembers = function(reversed, forceParty)
55-
local unit = (not forceParty and IsInRaid()) and 'raid' or 'party'
56-
local numGroupMembers = unit == 'party' and GetNumSubgroupMembers() or GetNumGroupMembers()
57-
local i = reversed and numGroupMembers or (unit == 'party' and 0 or 1)
59+
local unit = (not forceParty and IsInRaid()) and "raid" or "party"
60+
local numGroupMembers = unit == "party" and GetNumSubgroupMembers() or GetNumGroupMembers()
61+
local i = reversed and numGroupMembers or (unit == "party" and 0 or 1)
5862
return function()
5963
local ret
60-
if i == 0 and unit == 'party' then
61-
ret = 'player'
64+
if i == 0 and unit == "party" then
65+
ret = "player"
6266
elseif i <= numGroupMembers and i > 0 then
6367
ret = unit .. i
6468
end
@@ -93,7 +97,7 @@ local WA_Utf8Sub = function(input, size)
9397
return output
9498
end
9599
local i = 1
96-
while (size > 0) do
100+
while size > 0 do
97101
local byte = input:byte(i)
98102
if not byte then
99103
return output
@@ -114,7 +118,7 @@ local WA_Utf8Sub = function(input, size)
114118
end
115119

116120
-- Add any bytes that are part of the sequence
117-
while (true) do
121+
while true do
118122
local byte = input:byte(i)
119123
if byte and byte >= 128 and byte < 192 then
120124
output = output .. input:sub(i, i)
@@ -135,7 +139,7 @@ WeakAuras.HideOverlayGlow = LCG.ButtonGlow_Stop
135139

136140
local LGF = LibStub("LibGetFrame-1.0")
137141
WeakAuras.GetUnitFrame = LGF.GetUnitFrame
138-
WeakAuras.GetUnitNameplate = function(unit)
142+
WeakAuras.GetUnitNameplate = function(unit)
139143
if Private.multiUnitUnits.nameplate[unit] then
140144
return LGF.GetUnitNameplate(unit)
141145
end
@@ -170,7 +174,7 @@ local blockedFunctions = {
170174
GuildUninvite = true,
171175
securecall = true,
172176
DeleteCursorItem = true,
173-
ChatEdit_SendText = true
177+
ChatEdit_SendText = true,
174178
}
175179

176180
local blockedTables = {
@@ -180,7 +184,7 @@ local blockedTables = {
180184
MailFrameTab2 = true,
181185
ChatFrame1 = true,
182186
WeakAurasOptions = true,
183-
WeakAurasOptionsSaved = true
187+
WeakAurasOptionsSaved = true,
184188
}
185189

186190
local aura_environments = {}
@@ -209,7 +213,7 @@ local current_aura_env = nil
209213
local aura_env_stack = {}
210214

211215
function Private.ClearAuraEnvironment(id)
212-
environment_initialized[id] = nil;
216+
environment_initialized[id] = nil
213217
end
214218

215219
function Private.ActivateAuraEnvironmentForRegion(region, onlyConfig)
@@ -240,7 +244,7 @@ function Private.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig)
240244
current_aura_env.states = states
241245
current_aura_env.region = region
242246
-- Push the new environment onto the stack
243-
tinsert(aura_env_stack, {current_aura_env, data.uid})
247+
tinsert(aura_env_stack, { current_aura_env, data.uid })
244248
elseif onlyConfig then
245249
environment_initialized[id] = 1
246250
aura_environments[id] = {}
@@ -251,7 +255,7 @@ function Private.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig)
251255
current_aura_env.state = state
252256
current_aura_env.states = states
253257
current_aura_env.region = region
254-
tinsert(aura_env_stack, {current_aura_env, data.uid})
258+
tinsert(aura_env_stack, { current_aura_env, data.uid })
255259

256260
if not data.controlledChildren then
257261
current_aura_env.config = CopyTable(data.config)
@@ -268,7 +272,7 @@ function Private.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig)
268272
current_aura_env.states = states
269273
current_aura_env.region = region
270274
-- push new environment onto the stack
271-
tinsert(aura_env_stack, {current_aura_env, data.uid})
275+
tinsert(aura_env_stack, { current_aura_env, data.uid })
272276

273277
if data.controlledChildren then
274278
current_aura_env.child_envs = {}
@@ -291,7 +295,7 @@ function Private.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig)
291295
end
292296
-- Finally, run the init function if supplied
293297
local actions = data.actions.init
294-
if(actions and actions.do_custom and actions.custom) then
298+
if actions and actions.do_custom and actions.custom then
295299
local func = Private.customActionsFunctions[id]["init"]
296300
if func then
297301
xpcall(func, Private.GetErrorHandlerId(id, "init"))
@@ -306,28 +310,26 @@ local function DebugPrint(...)
306310
end
307311

308312
local function blocked(key)
309-
Private.AuraWarnings.UpdateWarning(current_uid, "SandboxForbidden", "error",
310-
string.format(L["Forbidden function or table: %s"], key))
313+
Private.AuraWarnings.UpdateWarning(current_uid, "SandboxForbidden", "error", string.format(L["Forbidden function or table: %s"], key))
311314
end
312315

313316
local function MakeReadOnly(input, options)
314-
return setmetatable({},
315-
{
317+
return setmetatable({}, {
316318
__index = function(t, k)
317-
if options.blockedFunctions[k] then
318-
options.blocked(k)
319-
return function() end
320-
elseif options.blockedTables[k] then
321-
options.blocked(k)
322-
return {}
323-
elseif options.override[k] then
324-
return options.override[k]
325-
else
326-
return input[k]
327-
end
328-
end,
329-
__newindex = options.setBlocked,
330-
__metatable = false
319+
if options.blockedFunctions[k] then
320+
options.blocked(k)
321+
return function() end
322+
elseif options.blockedTables[k] then
323+
options.blocked(k)
324+
return {}
325+
elseif options.override[k] then
326+
return options.override[k]
327+
else
328+
return input[k]
329+
end
330+
end,
331+
__newindex = options.setBlocked,
332+
__metatable = false,
331333
})
332334
end
333335

@@ -384,17 +386,16 @@ local FakeWeakAurasMixin = {
384386
frames = true,
385387
loadFrame = true,
386388
unitLoadFrame = true,
387-
loaded = true
389+
loaded = true,
388390
},
389391
override = {
390392
me = GetUnitName("player", true),
391-
myGUID = UnitGUID("player")
393+
myGUID = UnitGUID("player"),
392394
},
393395
blocked = blocked,
394396
setBlocked = function()
395-
Private.AuraWarnings.UpdateWarning(current_uid, "FakeWeakAurasSet", "error",
396-
L["Writing to the WeakAuras table is not allowed."], true)
397-
end
397+
Private.AuraWarnings.UpdateWarning(current_uid, "FakeWeakAurasSet", "error", L["Writing to the WeakAuras table is not allowed."], true)
398+
end,
398399
}
399400

400401
local FakeWeakAuras = MakeReadOnly(WeakAuras, FakeWeakAurasMixin)
@@ -408,12 +409,11 @@ local overridden = {
408409
WA_Utf8Sub = WA_Utf8Sub,
409410
ActionButton_ShowOverlayGlow = WeakAuras.ShowOverlayGlow,
410411
ActionButton_HideOverlayGlow = WeakAuras.HideOverlayGlow,
411-
WeakAuras = FakeWeakAuras
412+
WeakAuras = FakeWeakAuras,
412413
}
413414

414415
local env_getglobal
415-
local exec_env = setmetatable({},
416-
{
416+
local exec_env = setmetatable({}, {
417417
__index = function(t, k)
418418
if k == "_G" then
419419
return t
@@ -437,12 +437,11 @@ local exec_env = setmetatable({},
437437
end,
438438
__newindex = function(table, key, value)
439439
if _G[key] then
440-
Private.AuraWarnings.UpdateWarning(current_uid, "OverridingGlobal", "warning",
441-
string.format(L["The aura has overwritten the global '%s', this might affect other auras."], key))
440+
Private.AuraWarnings.UpdateWarning(current_uid, "OverridingGlobal", "warning", string.format(L["The aura has overwritten the global '%s', this might affect other auras."], key))
442441
end
443442
rawset(table, key, value)
444443
end,
445-
__metatable = false
444+
__metatable = false,
446445
})
447446

448447
function env_getglobal(k)

WeakAuras/AuraWarnings.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
if not WeakAuras.IsLibsOK() then return end
1+
if not WeakAuras.IsLibsOK() then
2+
return
3+
end
24
local AddonName, Private = ...
35

46
local WeakAuras = WeakAuras
@@ -32,7 +34,7 @@ local function UpdateWarning(uid, key, severity, message, printOnConsole)
3234
if severity and message then
3335
warnings[uid][key] = {
3436
severity = severity,
35-
message = message
37+
message = message,
3638
}
3739
Private.callbacks:Fire("AuraWarningsUpdated", uid)
3840
else
@@ -50,21 +52,21 @@ local severityLevel = {
5052
info = 0,
5153
sound = 1,
5254
warning = 2,
53-
error = 3
55+
error = 3,
5456
}
5557

5658
local icons = {
5759
info = [[Interface/friendsframe/informationicon.blp]],
5860
sound = [[chatframe-button-icon-voicechat]],
5961
warning = [[Interface/buttons/adventureguidemicrobuttonalert.blp]],
60-
error = [[Interface/DialogFrame/UI-Dialog-Icon-AlertNew]]
62+
error = [[Interface/DialogFrame/UI-Dialog-Icon-AlertNew]],
6163
}
6264

6365
local titles = {
6466
info = L["Information"],
6567
sound = L["Sound"],
6668
warning = L["Warning"],
67-
error = L["Error"]
69+
error = L["Error"],
6870
}
6971

7072
local function AddMessages(result, messages, icon, mixedSeverity)

WeakAuras/BuffTrigger.lua

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
--[[ BuffTrigger.lua
22
This used to contains the "aura" trigger for buffs and debuffs. Nowadays all functions do essentially nothing
3-
]]--
3+
]]
4+
--
45

5-
if not WeakAuras.IsLibsOK() then return end
6+
if not WeakAuras.IsLibsOK() then
7+
return
8+
end
69
local AddonName, Private = ...
710

811
local L = WeakAuras.L
@@ -42,9 +45,13 @@ function BuffTrigger.CanHaveDuration(data, triggernum)
4245
return false
4346
end
4447

45-
function BuffTrigger.GetOverlayInfo(data, triggernum) return {} end
48+
function BuffTrigger.GetOverlayInfo(data, triggernum)
49+
return {}
50+
end
4651

47-
function BuffTrigger.CanHaveClones(data, triggernum) return false end
52+
function BuffTrigger.CanHaveClones(data, triggernum)
53+
return false
54+
end
4855

4956
function BuffTrigger.CanHaveTooltip(data, triggernum) end
5057

@@ -61,29 +68,29 @@ function BuffTrigger.GetTriggerConditions(data, triggernum)
6168
end
6269

6370
function BuffTrigger.CreateFallbackState(data, triggernum, state)
64-
state.show = true;
65-
state.changed = true;
66-
state.progressType = "timed";
67-
state.duration = 0;
68-
state.expirationTime = math.huge;
71+
state.show = true
72+
state.changed = true
73+
state.progressType = "timed"
74+
state.duration = 0
75+
state.expirationTime = math.huge
6976
end
7077

7178
function BuffTrigger.GetName(triggerType)
72-
if (triggerType == "aura") then
73-
return L["Legacy Aura (disabled)"];
79+
if triggerType == "aura" then
80+
return L["Legacy Aura (disabled)"]
7481
end
7582
end
7683

7784
function BuffTrigger.GetTriggerDescription(data, triggernum, namestable)
78-
tinsert(namestable, {L["Legacy Aura (disabled):"], L[""]});
85+
tinsert(namestable, { L["Legacy Aura (disabled):"], L[""] })
7986
end
8087

8188
function BuffTrigger.CreateFakeStates(id, triggernum)
82-
local allStates = WeakAuras.GetTriggerStateForTrigger(id, triggernum);
89+
local allStates = WeakAuras.GetTriggerStateForTrigger(id, triggernum)
8390
local data = WeakAuras.GetData(id)
8491
local state = {}
8592
BuffTrigger.CreateFallbackState(data, triggernum, state)
8693
allStates[""] = state
8794
end
8895

89-
WeakAuras.RegisterTriggerSystem({"aura"}, BuffTrigger);
96+
WeakAuras.RegisterTriggerSystem({ "aura" }, BuffTrigger)

0 commit comments

Comments
 (0)