From e13b36973d6c2ee8751e852f9d8c46dedeb76f9d Mon Sep 17 00:00:00 2001 From: Bunny67 Date: Wed, 1 Jul 2020 17:42:02 +0300 Subject: [PATCH] cleanup --- WeakAuras/BuffTrigger.lua | 14 +++++++------- WeakAuras/DefaultOptions.lua | 2 +- WeakAuras/GenericTrigger.lua | 5 +---- WeakAuras/Pools.lua | 2 +- WeakAuras/Prototypes.lua | 1 - WeakAuras/RegionTypes/ProgressTexture.lua | 2 +- WeakAuras/Transmission.lua | 2 +- WeakAuras/Types.lua | 1 - WeakAuras/WeakAuras.lua | 2 +- 9 files changed, 13 insertions(+), 18 deletions(-) diff --git a/WeakAuras/BuffTrigger.lua b/WeakAuras/BuffTrigger.lua index ff2b4ed..6f0ad0d 100644 --- a/WeakAuras/BuffTrigger.lua +++ b/WeakAuras/BuffTrigger.lua @@ -466,7 +466,7 @@ function WeakAuras.ScanAuras(unit) -- Iterate over all displays (list of display lists) for _, aura_list in pairs(aura_lists) do -- Locals - local name, rank, icon, count, duration, expirationTime, unitCaster, isStealable, spellId = true; + local name, icon, count, duration, expirationTime, unitCaster, isStealable, spellId = true; local tooltip, debuffClass, tooltipSize; local remaining, checkPassed; @@ -501,7 +501,7 @@ function WeakAuras.ScanAuras(unit) -- Update scan cache if(aura_scan_cache[unit][filter].up_to_date < index) then -- Query aura data - name, rank, icon, count, debuffClass, duration, expirationTime, unitCaster, isStealable, _, spellId = UnitAura(unit, index, filter); + name, _, icon, count, debuffClass, duration, expirationTime, unitCaster, isStealable, _, spellId = UnitAura(unit, index, filter); if (debuffClass == nil) then debuffClass = "none"; elseif (debuffClass == "") then @@ -624,7 +624,7 @@ function WeakAuras.ScanAuras(unit) -- Fetch aura data local detected for i = 1, BUFF_MAX_DISPLAY do - name, rank, icon, count, _, duration, expirationTime, unitCaster, isStealable, _, spellId = UnitAura(unit, i, filter); + name, _, icon, count, _, duration, expirationTime, unitCaster, isStealable, _, spellId = UnitAura(unit, i, filter); if not name then break end if name == checkname then detected = true @@ -1040,9 +1040,9 @@ do for triggernum, data in pairs(triggers) do local filter = data.debuffType..(data.ownOnly and "|PLAYER" or ""); local detected - local name, rank, icon, count, duration, expirationTime, unitCaster, spellId, _ + local name, icon, count, duration, expirationTime, unitCaster, spellId, _ for i = 1, BUFF_MAX_DISPLAY do - name, rank, icon, count, _, duration, expirationTime, unitCaster, _, _, spellId = UnitAura(unit, i, filter); + name, _, icon, count, _, duration, expirationTime, unitCaster, _, _, spellId = UnitAura(unit, i, filter); if not name then break end if name == spellName then detected = true @@ -1220,9 +1220,9 @@ do local filter = data.debuffType..(data.ownOnly and "|PLAYER" or ""); local detected - local name, rank, icon, count, duration, expirationTime, unitCaster, _ + local name, icon, count, duration, expirationTime, unitCaster, _ for i = 1, BUFF_MAX_DISPLAY do - name, rank, icon, count, _, duration, expirationTime, unitCaster = UnitAura(uid, i, filter); + name, _, icon, count, _, duration, expirationTime, unitCaster = UnitAura(uid, i, filter); if not name then break end if name == spellName then detected = true diff --git a/WeakAuras/DefaultOptions.lua b/WeakAuras/DefaultOptions.lua index 9008654..d542338 100644 --- a/WeakAuras/DefaultOptions.lua +++ b/WeakAuras/DefaultOptions.lua @@ -1,4 +1,4 @@ --[[ Manual override for the default font and font size until proper options are built ]] WeakAuras.defaultFont = "Friz Quadrata TT" -WeakAuras.defaultFontSize = 12 \ No newline at end of file +WeakAuras.defaultFontSize = 12 diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index 102b015..c6ef248 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -62,9 +62,6 @@ local tinsert, tconcat, wipe = table.insert, table.concat, wipe local tostring, pairs, type = tostring, pairs, type local error, setmetatable = error, setmetatable --- WoW APIs -local IsPlayerMoving = IsPlayerMoving - WeakAurasAceEvents = setmetatable({}, {__tostring=function() return "WeakAuras" end}); LibStub("AceEvent-3.0"):Embed(WeakAurasAceEvents); local aceEvents = WeakAurasAceEvents @@ -3121,7 +3118,6 @@ end -- Mounted Frame do local mountedFrame - WeakAuras.frames["Mount Use Handler"] = mountedFrame; local elapsed = 0; local delay = 0.5; local isMounted = IsMounted(); @@ -3143,6 +3139,7 @@ do function WeakAuras.WatchForMounts() if not(mountedFrame) then mountedFrame = CreateFrame("frame"); + WeakAuras.frames["Mount Use Handler"] = mountedFrame; mountedFrame:RegisterEvent("COMPANION_UPDATE"); mountedFrame:SetScript("OnEvent", function() elapsed = 0; diff --git a/WeakAuras/Pools.lua b/WeakAuras/Pools.lua index af1a226..2d230f6 100644 --- a/WeakAuras/Pools.lua +++ b/WeakAuras/Pools.lua @@ -313,7 +313,7 @@ function FixedSizeFramePoolCollectionMixin:CreatePool(frameType, parent, templat return pool; end -function FixedSizeFramePoolCollectionMixin:Acquire(template) +function FixedSizeFramePoolCollectionMixin:Acquire(template) local pool = self:GetPool(template); assert(pool); diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index d86a300..4a5f9a9 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -3449,7 +3449,6 @@ WeakAuras.event_prototypes = { local activeName; ]] for index in pairs(trigger.talent.multi) do - local tier, column local tier = index and ceil(index / MAX_NUM_TALENTS) local column = index and ((index - 1) % MAX_NUM_TALENTS + 1) local ret2 = [[ diff --git a/WeakAuras/RegionTypes/ProgressTexture.lua b/WeakAuras/RegionTypes/ProgressTexture.lua index 36d41a7..448433b 100644 --- a/WeakAuras/RegionTypes/ProgressTexture.lua +++ b/WeakAuras/RegionTypes/ProgressTexture.lua @@ -640,7 +640,7 @@ local function modify(parent, region, data) if (progress < 0) then progress = 0; end - + if (progress > 1) then progress = 1; end diff --git a/WeakAuras/Transmission.lua b/WeakAuras/Transmission.lua index b95c7b6..2ac2f35 100644 --- a/WeakAuras/Transmission.lua +++ b/WeakAuras/Transmission.lua @@ -173,7 +173,7 @@ local function filterFunc(_, event, msg, player, l, cs, t, flag, channelId, ...) local toon = BNGetNumFriendToons(i) for j=1, toon do local _, rName, rGame = BNGetFriendToonInfo(i, j) - if rName == trimmedPlayer and rGame == "WoW" then + if rName == player and rGame == "WoW" then return false, newMsg, player, l, cs, t, flag, channelId, ...; -- Player is a real id friend, allow it end end diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index e2ca16e..732186e 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -7,7 +7,6 @@ local LSM = LibStub("LibSharedMedia-3.0"); local wipe, tinsert = wipe, tinsert local GetNumShapeshiftForms, GetShapeshiftFormInfo = GetNumShapeshiftForms, GetShapeshiftFormInfo -local WrapTextInColorCode, GetClassColor = WrapTextInColorCode, GetClassColor -- for Classic WeakAuras.glow_action_types = { show = L["Show"], diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 10d3fed..9e0c28e 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -1869,7 +1869,7 @@ local function GetInstanceTypeAndSize() size = "fortyman" end end - if isDynamic then + if isDynamicInstance then if playerDifficulty == 0 then difficulty = "normal" elseif playerDifficulty == 1 then