Skip to content

Commit

Permalink
StyLua: Drop column_width down to 180 again
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanzilla committed Sep 16, 2022
1 parent a72c888 commit 2b0f39b
Show file tree
Hide file tree
Showing 41 changed files with 1,899 additions and 263 deletions.
9 changes: 7 additions & 2 deletions WeakAuras/Animations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ function Private.Animate(namespace, uid, type, anim, region, inverse, onFinished
local auraDisplayName = Private.UIDtoID(uid)
local key = tostring(region)
local valid
if anim and anim.type == "custom" and (anim.use_translate or anim.use_alpha or (anim.use_scale and region.Scale) or (anim.use_rotate and region.Rotate) or (anim.use_color and region.Color)) then
if
anim
and anim.type == "custom"
and (anim.use_translate or anim.use_alpha or (anim.use_scale and region.Scale) or (anim.use_rotate and region.Rotate) or (anim.use_color and region.Color))
then
valid = true
elseif anim and anim.type == "preset" and anim.preset and Private.anim_presets[anim.preset] then
anim = Private.anim_presets[anim.preset]
Expand All @@ -195,7 +199,8 @@ function Private.Animate(namespace, uid, type, anim, region, inverse, onFinished
end
anim.x = anim.x or 0
anim.y = anim.y or 0
selfPoint, anchor, anchorPoint, startX, startY = animations[key].selfPoint, animations[key].anchor, animations[key].anchorPoint, animations[key].startX, animations[key].startY
selfPoint, anchor, anchorPoint, startX, startY =
animations[key].selfPoint, animations[key].anchor, animations[key].anchorPoint, animations[key].startX, animations[key].startY
anim.alpha = anim.alpha or 0
startAlpha = animations[key].startAlpha
anim.scalex = anim.scalex or 1
Expand Down
26 changes: 23 additions & 3 deletions WeakAuras/AuraEnvironment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,30 @@ end
if WeakAuras.IsClassic() then
local WA_GetUnitAuraBase = WA_GetUnitAura
WA_GetUnitAura = function(unit, spell, filter)
local name, icon, count, debuffType, duration, expirationTime, source, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossDebuff, castByPlayer, nameplateShowAll, timeMod = WA_GetUnitAuraBase(unit, spell, filter)
local name, icon, count, debuffType, duration, expirationTime, source, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossDebuff, castByPlayer, nameplateShowAll, timeMod =
WA_GetUnitAuraBase(unit, spell, filter)
if spellId then
local durationNew, expirationTimeNew = LCD:GetAuraDurationByUnit(unit, spellId, source, name)
if duration == 0 and durationNew then
duration = durationNew
expirationTime = expirationTimeNew
end
end
return name, icon, count, debuffType, duration, expirationTime, source, isStealable, nameplateShowPersonal, spellId, canApplyAura, isBossDebuff, castByPlayer, nameplateShowAll, timeMod
return name,
icon,
count,
debuffType,
duration,
expirationTime,
source,
isStealable,
nameplateShowPersonal,
spellId,
canApplyAura,
isBossDebuff,
castByPlayer,
nameplateShowAll,
timeMod
end
end

Expand Down Expand Up @@ -437,7 +452,12 @@ local exec_env = setmetatable({}, {
end,
__newindex = function(table, key, value)
if _G[key] then
Private.AuraWarnings.UpdateWarning(current_uid, "OverridingGlobal", "warning", string.format(L["The aura has overwritten the global '%s', this might affect other auras."], key))
Private.AuraWarnings.UpdateWarning(
current_uid,
"OverridingGlobal",
"warning",
string.format(L["The aura has overwritten the global '%s', this might affect other auras."], key)
)
end
rawset(table, key, value)
end,
Expand Down
209 changes: 193 additions & 16 deletions WeakAuras/BuffTrigger2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,13 @@ local function GetSubTable(base, next, ...)
end

local function IsGroupTrigger(trigger)
return trigger.unit == "group" or trigger.unit == "party" or trigger.unit == "raid" or trigger.unit == "boss" or trigger.unit == "nameplate" or trigger.unit == "arena" or trigger.unit == "multi"
return trigger.unit == "group"
or trigger.unit == "party"
or trigger.unit == "raid"
or trigger.unit == "boss"
or trigger.unit == "nameplate"
or trigger.unit == "arena"
or trigger.unit == "multi"
end

local function IsSingleMissing(trigger)
Expand Down Expand Up @@ -213,7 +219,11 @@ end
local function ScanMatchData(time, triggerInfo, unit, filter)
if matchData[unit] and matchData[unit][filter] then
for index, match in pairs(matchData[unit][filter]) do
if (not triggerInfo.auranames and not triggerInfo.auraspellids) or (triggerInfo.auranames and tContains(triggerInfo.auranames, match.name)) or (triggerInfo.auraspellids and tContains(triggerInfo.auraspellids, match.spellId)) then
if
(not triggerInfo.auranames and not triggerInfo.auraspellids)
or (triggerInfo.auranames and tContains(triggerInfo.auranames, match.name))
or (triggerInfo.auraspellids and tContains(triggerInfo.auraspellids, match.spellId))
then
if triggerInfo.fetchTooltip then
matchData[unit][filter][index]:UpdateTooltip(time)
end
Expand Down Expand Up @@ -271,7 +281,25 @@ local function UpdateToolTipDataInMatchData(matchData, time)
return changed
end

local function UpdateMatchData(time, matchDataChanged, unit, index, filter, name, icon, stacks, debuffClass, duration, expirationTime, unitCaster, isStealable, isBossDebuff, isCastByPlayer, spellId, modRate)
local function UpdateMatchData(
time,
matchDataChanged,
unit,
index,
filter,
name,
icon,
stacks,
debuffClass,
duration,
expirationTime,
unitCaster,
isStealable,
isBossDebuff,
isCastByPlayer,
spellId,
modRate
)
if not matchData[unit] then
matchData[unit] = {}
end
Expand Down Expand Up @@ -504,7 +532,21 @@ local roleIcons = {
TANK = CreateTextureMarkup([[Interface\LFGFrame\UI-LFG-ICON-ROLES]], 256, 256, 0, 0, GetTexCoordsForRole("TANK")),
}

local function UpdateStateWithMatch(time, bestMatch, triggerStates, cloneId, matchCount, unitCount, maxUnitCount, matchCountPerUnit, totalStacks, affected, unaffected, role, raidMark)
local function UpdateStateWithMatch(
time,
bestMatch,
triggerStates,
cloneId,
matchCount,
unitCount,
maxUnitCount,
matchCountPerUnit,
totalStacks,
affected,
unaffected,
role,
raidMark
)
local debuffClassIcon = WeakAuras.EJIcons[bestMatch.debuffClass]
if not triggerStates[cloneId] then
triggerStates[cloneId] = {
Expand Down Expand Up @@ -736,7 +778,22 @@ local function UpdateStateWithMatch(time, bestMatch, triggerStates, cloneId, mat
end
end

local function UpdateStateWithNoMatch(time, triggerStates, triggerInfo, cloneId, unit, matchCount, unitCount, maxUnitCount, matchCountPerUnit, totalStacks, affected, unaffected, role, raidMark)
local function UpdateStateWithNoMatch(
time,
triggerStates,
triggerInfo,
cloneId,
unit,
matchCount,
unitCount,
maxUnitCount,
matchCountPerUnit,
totalStacks,
affected,
unaffected,
role,
raidMark
)
local fallbackName, fallbackIcon = BuffTrigger.GetNameAndIconSimple(WeakAuras.GetData(triggerInfo.id), triggerInfo.triggernum)
if not triggerStates[cloneId] then
triggerStates[cloneId] = {
Expand Down Expand Up @@ -1365,7 +1422,21 @@ local function UpdateTriggerState(time, id, triggernum)

local role = roleForTriggerInfo(triggerInfo, auraData.unit)
local mark = markForTriggerInfo(triggerInfo, auraData.unit)
updated = UpdateStateWithMatch(time, auraData, triggerStates, cloneId, matchCount, unitCount, maxUnitCount, matchCountPerUnit[auraData.unit], totalStacks, affected, unaffected, role, mark) or updated
updated = UpdateStateWithMatch(
time,
auraData,
triggerStates,
cloneId,
matchCount,
unitCount,
maxUnitCount,
matchCountPerUnit[auraData.unit],
totalStacks,
affected,
unaffected,
role,
mark
) or updated
cloneIds[cloneId] = true
end

Expand Down Expand Up @@ -1422,7 +1493,21 @@ local function UpdateTriggerState(time, id, triggernum)
if bestMatch then
local role = roleForTriggerInfo(triggerInfo, unit)
local mark = markForTriggerInfo(triggerInfo, unit)
updated = UpdateStateWithMatch(time, bestMatch, triggerStates, unit, matchCount, unitCount, maxUnitCount, matchCountPerUnit[unit], totalStacks, affected, unaffected, role, mark) or updated
updated = UpdateStateWithMatch(
time,
bestMatch,
triggerStates,
unit,
matchCount,
unitCount,
maxUnitCount,
matchCountPerUnit[unit],
totalStacks,
affected,
unaffected,
role,
mark
) or updated
cloneIds[unit] = true
end
end
Expand All @@ -1435,11 +1520,39 @@ local function UpdateTriggerState(time, id, triggernum)
local mark = markForTriggerInfo(triggerInfo, unit)
if bestMatch then
if triggerInfo.perUnitMode == "all" then
updated = UpdateStateWithMatch(time, bestMatch, triggerStates, unit, matchCount, unitCount, maxUnitCount, matchCountPerUnit[unit], totalStacks, affected, unaffected, role, mark) or updated
updated = UpdateStateWithMatch(
time,
bestMatch,
triggerStates,
unit,
matchCount,
unitCount,
maxUnitCount,
matchCountPerUnit[unit],
totalStacks,
affected,
unaffected,
role,
mark
) or updated
cloneIds[unit] = true
end
else
updated = UpdateStateWithNoMatch(time, triggerStates, triggerInfo, unit, unit, matchCount, unitCount, maxUnitCount, matchCountPerUnit[unit], totalStacks, affected, unaffected, role) or updated
updated = UpdateStateWithNoMatch(
time,
triggerStates,
triggerInfo,
unit,
unit,
matchCount,
unitCount,
maxUnitCount,
matchCountPerUnit[unit],
totalStacks,
affected,
unaffected,
role
) or updated
cloneIds[unit] = true
end
end
Expand Down Expand Up @@ -1489,7 +1602,8 @@ local function PrepareMatchData(unit, filter)
local time = GetTime()
local index = 1
while true do
local name, icon, stacks, debuffClass, duration, expirationTime, unitCaster, isStealable, _, spellId, _, isBossDebuff, isCastByPlayer, _, modRate = UnitAura(unit, index, filter)
local name, icon, stacks, debuffClass, duration, expirationTime, unitCaster, isStealable, _, spellId, _, isBossDebuff, isCastByPlayer, _, modRate =
UnitAura(unit, index, filter)
if not name then
break
end
Expand All @@ -1502,7 +1616,25 @@ local function PrepareMatchData(unit, filter)
debuffClass = string.lower(debuffClass)
end

local updatedMatchData = UpdateMatchData(time, matchDataChanged, unit, index, filter, name, icon, stacks, debuffClass, duration, expirationTime, unitCaster, isStealable, isBossDebuff, isCastByPlayer, spellId, modRate)
local updatedMatchData = UpdateMatchData(
time,
matchDataChanged,
unit,
index,
filter,
name,
icon,
stacks,
debuffClass,
duration,
expirationTime,
unitCaster,
isStealable,
isBossDebuff,
isCastByPlayer,
spellId,
modRate
)
index = index + 1
end

Expand Down Expand Up @@ -2564,7 +2696,14 @@ function BuffTrigger.Add(data)
end

local matchPerUnitCountFunc
if IsGroupTrigger(trigger) and combineMode == "showPerUnit" and perUnitMode ~= "unaffected" and trigger.useMatchPerUnit_count and tonumber(trigger.matchPerUnit_count) and trigger.matchPerUnit_countOperator then
if
IsGroupTrigger(trigger)
and combineMode == "showPerUnit"
and perUnitMode ~= "unaffected"
and trigger.useMatchPerUnit_count
and tonumber(trigger.matchPerUnit_count)
and trigger.matchPerUnit_countOperator
then
local count = tonumber(trigger.matchPerUnit_count)
local match_countFuncStr = Private.function_strings.count:format(trigger.matchPerUnit_countOperator, count)
matchPerUnitCountFunc = WeakAuras.LoadFunction(match_countFuncStr)
Expand Down Expand Up @@ -2961,7 +3100,8 @@ function Private.CanConvertBuffTrigger2(trigger)
end

if trigger.unit == "group" then
return true, L["Warning: Name info is now available via %affected, %unaffected. Number of affected group members via %unitCount. Some options behave differently now. This is not automatically adjusted."]
return true,
L["Warning: Name info is now available via %affected, %unaffected. Number of affected group members via %unitCount. Some options behave differently now. This is not automatically adjusted."]
end

if trigger.fullscan then
Expand Down Expand Up @@ -3371,7 +3511,8 @@ local function AugmentMatchDataMulti(matchData, unit, filter, sourceGUID, nameKe
end
local auraSourceGuid = unitCaster and UnitGUID(unitCaster)
if (name == nameKey or spellId == spellKey) and sourceGUID == auraSourceGuid then
local changed = AugmentMatchDataMultiWith(matchData, unit, name, icon, stacks, debuffClass, duration, expirationTime, unitCaster, isStealable, _, spellId, _, _, _, _, modRate)
local changed =
AugmentMatchDataMultiWith(matchData, unit, name, icon, stacks, debuffClass, duration, expirationTime, unitCaster, isStealable, _, spellId, _, _, _, _, modRate)
return changed
end
index = index + 1
Expand Down Expand Up @@ -3461,7 +3602,25 @@ local function CheckAurasMulti(base, unit, filter)
end
local auraCasterGUID = unitCaster and UnitGUID(unitCaster)
if base[name] and base[name][auraCasterGUID] then
local changed = AugmentMatchDataMultiWith(base[name][auraCasterGUID], unit, name, icon, stacks, debuffClass, duration, expirationTime, unitCaster, isStealable, _, spellId, _, _, _, _, modRate)
local changed = AugmentMatchDataMultiWith(
base[name][auraCasterGUID],
unit,
name,
icon,
stacks,
debuffClass,
duration,
expirationTime,
unitCaster,
isStealable,
_,
spellId,
_,
_,
_,
_,
modRate
)
if changed then
for id, idData in pairs(base[name][auraCasterGUID].auras) do
for triggernum in pairs(idData) do
Expand All @@ -3472,7 +3631,25 @@ local function CheckAurasMulti(base, unit, filter)
end
end
if base[spellId] and base[spellId][auraCasterGUID] then
local changed = AugmentMatchDataMultiWith(base[spellId][auraCasterGUID], unit, name, icon, stacks, debuffClass, duration, expirationTime, unitCaster, isStealable, _, spellId, _, _, _, _, modRate)
local changed = AugmentMatchDataMultiWith(
base[spellId][auraCasterGUID],
unit,
name,
icon,
stacks,
debuffClass,
duration,
expirationTime,
unitCaster,
isStealable,
_,
spellId,
_,
_,
_,
_,
modRate
)
if changed then
for id, idData in pairs(base[spellId][auraCasterGUID].auras) do
for triggernum in pairs(idData) do
Expand Down
Loading

0 comments on commit 2b0f39b

Please sign in to comment.