diff --git a/WeakAuras/BuffTrigger2.lua b/WeakAuras/BuffTrigger2.lua index 4f3e8b7..f8633b5 100644 --- a/WeakAuras/BuffTrigger2.lua +++ b/WeakAuras/BuffTrigger2.lua @@ -1708,8 +1708,8 @@ local function RecheckActiveForUnitType(unitType, unit, unitsToRemoveScan) end end -local frame = CreateFrame("Frame") -WeakAuras.frames["WeakAuras Buff2 Frame"] = frame +local Buff2Frame = CreateFrame("Frame") +WeakAuras.frames["WeakAuras Buff2 Frame"] = Buff2Frame local function EventHandler(frame, event, arg1, arg2, ...) @@ -1802,29 +1802,29 @@ local function EventHandler(frame, event, arg1, arg2, ...) Private.StopProfileSystem("bufftrigger2") end -frame:RegisterEvent("UNIT_AURA") -frame:RegisterEvent("UNIT_FACTION") -frame:RegisterEvent("UNIT_NAME_UPDATE") -frame:RegisterEvent("UNIT_FLAGS") -frame:RegisterEvent("PLAYER_FLAGS_CHANGED") -frame:RegisterEvent("UNIT_PET") -frame:RegisterEvent("RAID_TARGET_UPDATE") -frame:RegisterEvent("PLAYER_FOCUS_CHANGED") -frame:RegisterEvent("ARENA_OPPONENT_UPDATE") -frame:RegisterEvent("UNIT_ENTERED_VEHICLE") -frame:RegisterEvent("UNIT_EXITED_VEHICLE") -frame:RegisterEvent("PLAYER_TARGET_CHANGED") -frame:RegisterEvent("PARTY_MEMBERS_CHANGED") -frame:RegisterEvent("RAID_ROSTER_UPDATE") -frame:RegisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT") +Buff2Frame:RegisterEvent("UNIT_AURA") +Buff2Frame:RegisterEvent("UNIT_FACTION") +Buff2Frame:RegisterEvent("UNIT_NAME_UPDATE") +Buff2Frame:RegisterEvent("UNIT_FLAGS") +Buff2Frame:RegisterEvent("PLAYER_FLAGS_CHANGED") +Buff2Frame:RegisterEvent("UNIT_PET") +Buff2Frame:RegisterEvent("RAID_TARGET_UPDATE") +Buff2Frame:RegisterEvent("PLAYER_FOCUS_CHANGED") +Buff2Frame:RegisterEvent("ARENA_OPPONENT_UPDATE") +Buff2Frame:RegisterEvent("UNIT_ENTERED_VEHICLE") +Buff2Frame:RegisterEvent("UNIT_EXITED_VEHICLE") +Buff2Frame:RegisterEvent("PLAYER_TARGET_CHANGED") +Buff2Frame:RegisterEvent("PARTY_MEMBERS_CHANGED") +Buff2Frame:RegisterEvent("RAID_ROSTER_UPDATE") +Buff2Frame:RegisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT") if WeakAuras.isAwesomeEnabled() then - frame:RegisterEvent("NAME_PLATE_UNIT_ADDED") - frame:RegisterEvent("NAME_PLATE_UNIT_REMOVED") + Buff2Frame:RegisterEvent("NAME_PLATE_UNIT_ADDED") + Buff2Frame:RegisterEvent("NAME_PLATE_UNIT_REMOVED") end -frame:RegisterEvent("PLAYER_ENTERING_WORLD") -frame:SetScript("OnEvent", EventHandler) +Buff2Frame:RegisterEvent("PLAYER_ENTERING_WORLD") +Buff2Frame:SetScript("OnEvent", EventHandler) -frame:SetScript("OnUpdate", function() +Buff2Frame:SetScript("OnUpdate", function() if WeakAuras.IsPaused() then return end diff --git a/WeakAurasOptions/AuthorOptions.lua b/WeakAurasOptions/AuthorOptions.lua index 301c405..fb86688 100644 --- a/WeakAurasOptions/AuthorOptions.lua +++ b/WeakAurasOptions/AuthorOptions.lua @@ -69,7 +69,7 @@ local conflictBlue = "|cFF4080FF" local conflict = {} -- magic value local function atLeastOneSet(references, key) - for id, optionData in pairs(references) do + for _, optionData in pairs(references) do local childOption = optionData.options[optionData.index] if childOption[key] ~= nil then return true @@ -138,7 +138,7 @@ local function nameUserDesc(option) return option.text else local text = {} - for id, optionData in pairs(option.references) do + for _, optionData in pairs(option.references) do local childOption = optionData.options[optionData.index] if childOption.text and childOption.text ~= nil then tinsert(text, childOption.text) @@ -288,7 +288,7 @@ end local function getUser(option) return function() local value - for id, optionData in pairs(option.references) do + for _, optionData in pairs(option.references) do if not optionData.config then return elseif value == nil then @@ -335,7 +335,7 @@ end local function getValues(option) local values = {} local firstChild = true - for id, optionData in pairs(option.references) do + for _, optionData in pairs(option.references) do local childOption = optionData.options[optionData.index] local childValues = childOption.values local i = 1 @@ -400,7 +400,7 @@ end -- setters for AceConfig local function set(data, option, key) return function(_, value) - for id, optionData in pairs(option.references) do + for _, optionData in pairs(option.references) do local childOption = optionData.options[optionData.index] local childData = optionData.data childOption[key] = value @@ -412,7 +412,7 @@ end local function setUser(data, option) return function(_, value) - for id, optionData in pairs(option.references) do + for _, optionData in pairs(option.references) do local childData = optionData.data local childConfig = optionData.config childConfig[option.key] = value @@ -465,7 +465,7 @@ local function setUserNum(data, option) if value ~= "" then local num = tonumber(value) if not num or math.abs(num) == math.huge or tostring(num) == "nan" then return end - for id, optionData in pairs(option.references) do + for _, optionData in pairs(option.references) do local childData = optionData.data local childConfig = optionData.config childConfig[option.key] = num @@ -532,7 +532,7 @@ local function ensureUniqueKey(candidate, suffix, options, index) local goodKey = true local key = candidate local existingKeys = {} - for index, option in ipairs(options) do + for _, option in ipairs(options) do if option.key then if option.key == key then goodKey = false @@ -836,7 +836,7 @@ typeControlAdders = { type = "input", width = WeakAuras.normalWidth - 0.15, name = (value == conflict and conflictBlue or "") .. L["Value %i"]:format(j), - desc = descSelect(option, j, conflict), + desc = descSelect(option, j), order = order(), get = function() if value ~= conflict then @@ -1015,7 +1015,7 @@ typeControlAdders = { type = "input", width = WeakAuras.normalWidth - 0.15, name = (value == conflict and conflictBlue or "") .. L["Value %i"]:format(j), - desc = descSelect(option, j, conflict), + desc = descSelect(option, j), order = order(), get = function() if value ~= conflict then @@ -1599,7 +1599,6 @@ function addAuthorModeOption(options, args, data, order, prefix, i) local parent = optionData.parent local parentOptions = parent and parent.references[id].options or optionData.data.authorOptions local childOption = tremove(optionData.options, optionData.index) - local childCollapsed = OptionsPrivate.IsCollapsed(id, "author", optionData.path, true) if parent and parent.groupType == "array" then local dereferencedParent = parent.references[id].options[parent.references[id].index] if dereferencedParent.nameSource == optionData.index then @@ -1634,7 +1633,6 @@ function addAuthorModeOption(options, args, data, order, prefix, i) local parent = optionData.parent local parentOptions = parent and parent.references[id].options or optionData.data.authorOptions local childOption = tremove(optionData.options, optionData.index) - local childCollapsed = OptionsPrivate.IsCollapsed(id, "author", optionData.path, true) if parent and parent.groupType == "array" then local dereferencedParent = parent.references[id].options[parent.references[id].index] if dereferencedParent.nameSource == optionData.index then @@ -1867,7 +1865,6 @@ function addAuthorModeOption(options, args, data, order, prefix, i) local addControlsForType = typeControlAdders[option.type] if addControlsForType then addControlsForType(options, args, data, order, prefix, i) - local option = options[i] end end @@ -2220,7 +2217,7 @@ local function addUserModeOption(options, args, data, order, prefix, i) elseif optionType == "number" then userOption.type = "input" userOption.get = getUserNumAsString(option) - userOption.set = setUserNum(data, option, true) + userOption.set = setUserNum(data, option) elseif optionType == "range" then userOption.softMax = option.softMax userOption.softMin = option.softMin @@ -2251,7 +2248,7 @@ local function addUserModeOption(options, args, data, order, prefix, i) return value end userOption.set = function(_, k, v) - for id, optionData in pairs(option.references) do + for _, optionData in pairs(option.references) do optionData.config[option.key][k] = v WeakAuras.Add(optionData.data) end @@ -2264,7 +2261,7 @@ local function addUserModeOption(options, args, data, order, prefix, i) local name = {} local firstName = nil local conflict = false - for id, optionData in pairs(option.references) do + for _, optionData in pairs(option.references) do local childOption = optionData.options[optionData.index] if childOption.useName and #childOption.text > 0 then if firstName == nil then @@ -2347,7 +2344,6 @@ local function mergeOptions(mergedOptions, data, options, config, prepath, paren local nextInsert = 1 for i = 1, #options do local path = CopyTable(prepath) - local option = options[i] path[#path + 1] = i -- find the best place to start inserting the next option to merge local nextToMerge = options[i] @@ -2622,9 +2618,9 @@ function OptionsPrivate.GetAuthorOptions(data) desc = L["Configure what options appear on this panel."], order = order(), func = function() - for data in OptionsPrivate.Private.TraverseLeafsOrAura(data) do + for configData in OptionsPrivate.Private.TraverseLeafsOrAura(data) do -- no need to add, author mode is picked up by ClearAndUpdateOptions - data.authorMode = true + configData.authorMode = true end WeakAuras.ClearAndUpdateOptions(data.id, true) end diff --git a/WeakAurasOptions/BuffTrigger.lua b/WeakAurasOptions/BuffTrigger.lua index 70215e9..521d829 100644 --- a/WeakAurasOptions/BuffTrigger.lua +++ b/WeakAurasOptions/BuffTrigger.lua @@ -6,9 +6,8 @@ local L = WeakAuras.L; local function getAuraMatchesLabel(name) local ids = WeakAuras.spellCache.GetSpellsMatching(name) if(ids) then - local descText = ""; local numMatches = 0; - for id, _ in pairs(ids) do + for _ in pairs(ids) do numMatches = numMatches + 1; end if(numMatches == 1) then @@ -21,19 +20,12 @@ local function getAuraMatchesLabel(name) end end --- the spell id table is sparse, so tremove doesn't work -local function spellId_tremove(tbl, pos) - for i = pos, 9, 1 do - tbl[i] = tbl[i + 1] - end -end - local function getAuraMatchesList(name) local ids = WeakAuras.spellCache.GetSpellsMatching(name) if(ids) then local descText = ""; - for id, _ in pairs(ids) do - local name, _, icon = GetSpellInfo(id); + for id in pairs(ids) do + local _, _, icon = GetSpellInfo(id); if(icon) then if(descText == "") then descText = "|T"..icon..":0|t: "..id; diff --git a/WeakAurasOptions/BuffTrigger2.lua b/WeakAurasOptions/BuffTrigger2.lua index e576353..41a8917 100644 --- a/WeakAurasOptions/BuffTrigger2.lua +++ b/WeakAurasOptions/BuffTrigger2.lua @@ -7,7 +7,7 @@ local function getAuraMatchesLabel(name) local ids = WeakAuras.spellCache.GetSpellsMatching(name) if ids then local numMatches = 0 - for id, _ in pairs(ids) do + for _ in pairs(ids) do numMatches = numMatches + 1 end return tostring(numMatches) @@ -21,7 +21,7 @@ local function getAuraMatchesList(name) if ids then local descText = "" for id, _ in pairs(ids) do - local name, _, icon = GetSpellInfo(id) + local _, _, icon = GetSpellInfo(id) if icon then if descText == "" then descText = "|T"..icon..":0|t: "..id @@ -113,8 +113,7 @@ local function CreateNameOptions(aura_options, data, trigger, size, isExactSpell if isExactSpellId then aura_options[iconOption].name = function() - local name = GetSpellInfo(WeakAuras.SafeToNumber(trigger[optionKey] and trigger[optionKey][i] or 0)) - return name + return GetSpellInfo(WeakAuras.SafeToNumber(trigger[optionKey] and trigger[optionKey][i] or 0)) end aura_options[iconOption].image = function() local icon @@ -524,7 +523,7 @@ local function GetBuffTriggerOptions(data, triggernum) }, use_stealable = { type = "toggle", - name = function(input) + name = function() local value = trigger.use_stealable if value == nil then return L["Is Stealable"] elseif value == false then return "|cFFFF0000 " .. L["Negator"] .. " " .. L["Is Stealable"] .. "|r" diff --git a/WeakAurasOptions/CommonOptions.lua b/WeakAurasOptions/CommonOptions.lua index 3196ba4..bdd05cb 100644 --- a/WeakAurasOptions/CommonOptions.lua +++ b/WeakAurasOptions/CommonOptions.lua @@ -546,7 +546,6 @@ local function replaceNameDescFuncs(intable, data, subOption) local values = {}; if (get) then values = { get(info) }; - local childOption = getChildOption(childOptions, info) if isToggle and values[1] == nil then values[1] = false end @@ -1372,7 +1371,7 @@ local function AddCodeOption(args, data, name, prefix, url, order, hiddenFunc, p options.extraFunctions = options.extraFunctions or {}; tinsert(options.extraFunctions, 1, { buttonLabel = L["Expand"], - func = function(info) + func = function() OptionsPrivate.OpenTextEditor(OptionsPrivate.GetPickedDisplay(), path, encloseInFunction, options.multipath, options.reloadOptions, options.setOnParent, url, options.validator) end }); @@ -1405,7 +1404,7 @@ local function AddCodeOption(args, data, name, prefix, url, order, hiddenFunc, p OptionsPrivate.ClearOptions(data.id) end end, - get = function(info) + get = function() return GetCustomCode(data, path); end }; diff --git a/WeakAurasOptions/ConditionOptions.lua b/WeakAurasOptions/ConditionOptions.lua index 0d0abd8..5b15861 100644 --- a/WeakAurasOptions/ConditionOptions.lua +++ b/WeakAurasOptions/ConditionOptions.lua @@ -78,8 +78,8 @@ end local function valueToString(a, propertytype) if (propertytype == "color") then if (type(a) == "table") then - local r, g, b, a = floor((a[1] or 0) * 255), floor((a[2] or 0) * 255), floor((a[3] or 0) * 255), floor((a[4] or 0) * 255) - return string.format("|c%02X%02X%02X%02X", a, r, g, b) .. L["color"]; + local r, g, b, alpha = floor((a[1] or 0) * 255), floor((a[2] or 0) * 255), floor((a[3] or 0) * 255), floor((a[4] or 0) * 255) + return string.format("|c%02X%02X%02X%02X", alpha, r, g, b) .. L["color"]; else return ""; end @@ -822,7 +822,7 @@ local function addControlsForChange(args, order, data, conditionVariable, totalA if data.controlledChildren then local ordered = {} - for id, reference in pairs(conditions[i].changes[j].references) do + for _, reference in pairs(conditions[i].changes[j].references) do tinsert(ordered, reference) end for index, reference in ipairs(ordered) do @@ -1843,8 +1843,6 @@ local function addControlsForIfLine(args, order, data, conditionVariable, totalA } order = order + 1; - local multipath = {} - args["condition" .. i .. tostring(path) .. "_value"] = { type = "input", width = WeakAuras.doubleWidth, @@ -1865,10 +1863,10 @@ local function addControlsForIfLine(args, order, data, conditionVariable, totalA if (data.controlledChildren) then -- Collect multi paths local multipath = {}; - for id, reference in pairs(conditions[i].check.references) do + for id in pairs(conditions[i].check.references) do local conditionIndex = conditions[i].check.references[id].conditionIndex; multipath[id] ={ "conditions", conditionIndex, "check" } - for i, v in ipairs(path) do + for _, v in ipairs(path) do tinsert(multipath[id], "checks") tinsert(multipath[id], v) end @@ -1877,7 +1875,7 @@ local function addControlsForIfLine(args, order, data, conditionVariable, totalA OptionsPrivate.OpenTextEditor(data, multipath, nil, true, nil, nil, "https://github.com/WeakAuras/WeakAuras2/wiki/Custom-Code-Blocks#custom-check"); else local fullPath = { "conditions", i, "check" } - for i, v in ipairs(path) do + for _, v in ipairs(path) do tinsert(fullPath, "checks") tinsert(fullPath, v) end @@ -1983,7 +1981,7 @@ local function addControlsForCondition(args, order, data, conditionVariable, tot order = order, disabled = function() if (data.controlledChildren) then - for id, reference in pairs(conditions[i].check.references) do + for _, reference in pairs(conditions[i].check.references) do local index = reference.conditionIndex; if (index > 1) then return false; @@ -2526,7 +2524,6 @@ local function findMatchingProperty(all, change, id) return nil; end -local noop = function() end local function SubPropertiesForChange(change) if change.property == "sound" then return { "sound", "sound_channel", "sound_path", "sound_kit_id", "sound_repeat", "sound_type"} @@ -2705,7 +2702,7 @@ local function mergeConditions(all, aura, id, allConditionTemplates, propertyTyp end local fixupConditions = function(conditions) - for index, condition in ipairs(conditions) do + for _, condition in ipairs(conditions) do condition.check = condition.check or {} condition.changes = condition.changes or {} end diff --git a/WeakAurasOptions/GenericTrigger.lua b/WeakAurasOptions/GenericTrigger.lua index a6b4c71..5dbbd0c 100644 --- a/WeakAurasOptions/GenericTrigger.lua +++ b/WeakAurasOptions/GenericTrigger.lua @@ -4,7 +4,6 @@ local AddonName, OptionsPrivate = ... local L = WeakAuras.L; local function GetCustomTriggerOptions(data, triggernum) - local id = data.id; local trigger = data.triggers[triggernum].trigger local function appendToTriggerPath(...) local ret = {...}; @@ -31,7 +30,7 @@ local function GetCustomTriggerOptions(data, triggernum) width = WeakAuras.doubleWidth, values = OptionsPrivate.Private.custom_trigger_types, hidden = function() return not (trigger.type == "custom") end, - get = function(info) + get = function() return trigger.custom_type end, set = function(info, v) @@ -110,7 +109,7 @@ local function GetCustomTriggerOptions(data, triggernum) name = function() local events = trigger.custom_type == "event" and trigger.events2 or trigger.events -- Check for errors - for index, event in pairs(WeakAuras.split(events)) do + for _, event in pairs(WeakAuras.split(events)) do local trueEvent for i in event:gmatch("[^:]+") do if not trueEvent then @@ -159,7 +158,7 @@ local function GetCustomTriggerOptions(data, triggernum) end local events = trigger.custom_type == "event" and trigger.events2 or trigger.events -- Check for errors - for index, event in pairs(WeakAuras.split(events)) do + for _, event in pairs(WeakAuras.split(events)) do local trueEvent for i in event:gmatch("[^:]+") do if not trueEvent then diff --git a/WeakAurasOptions/InformationOptions.lua b/WeakAurasOptions/InformationOptions.lua index 247332a..7f0a462 100644 --- a/WeakAurasOptions/InformationOptions.lua +++ b/WeakAurasOptions/InformationOptions.lua @@ -127,7 +127,7 @@ function OptionsPrivate.GetInformationOptions(data) -- Show warnings only for single selection for now if not isGroup then - local icon, title, message = OptionsPrivate.Private.AuraWarnings.FormatWarnings(data.uid) + local _, title, message = OptionsPrivate.Private.AuraWarnings.FormatWarnings(data.uid) if title and message then args.warningTitle = { type = "header", diff --git a/WeakAurasOptions/OptionsFrames/ImportExport.lua b/WeakAurasOptions/OptionsFrames/ImportExport.lua index 56b7424..99aa86e 100644 --- a/WeakAurasOptions/OptionsFrames/ImportExport.lua +++ b/WeakAurasOptions/OptionsFrames/ImportExport.lua @@ -80,7 +80,7 @@ local function ConstructImportExport(frame) group:DoLayout() end - function group.Close(self) + function group.Close() input:ClearFocus(); frame.window = "default"; frame:UpdateFrameVisible() diff --git a/WeakAurasOptions/OptionsFrames/MoverSizer.lua b/WeakAurasOptions/OptionsFrames/MoverSizer.lua index af38d34..98a54fd 100644 --- a/WeakAurasOptions/OptionsFrames/MoverSizer.lua +++ b/WeakAurasOptions/OptionsFrames/MoverSizer.lua @@ -908,7 +908,7 @@ local function ConstructMoverSizer(parent) local numInterim = floor(distance/40) - for index, texture in pairs(self.interims) do + for _, texture in pairs(self.interims) do texture:Hide() end for i = 1, numInterim do diff --git a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua index d513dcc..9e7f8d9 100644 --- a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua +++ b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua @@ -142,7 +142,7 @@ function OptionsPrivate.CreateFrame() data.region:Collapse() data.region:OptionsClosed() if WeakAuras.clones[id] then - for cloneId, cloneRegion in pairs(WeakAuras.clones[id]) do + for _, cloneRegion in pairs(WeakAuras.clones[id]) do cloneRegion:Collapse() cloneRegion:OptionsClosed() end @@ -1375,7 +1375,7 @@ function OptionsPrivate.CreateFrame() alreadySelected[child.id] = true end - for index, id in ipairs(batchSelection) do + for _, id in ipairs(batchSelection) do if not alreadySelected[id] then displayButtons[id]:Pick() tinsert(tempGroup.controlledChildren, id) diff --git a/WeakAurasOptions/TriggerOptions.lua b/WeakAurasOptions/TriggerOptions.lua index c8b659e..5dfca41 100644 --- a/WeakAurasOptions/TriggerOptions.lua +++ b/WeakAurasOptions/TriggerOptions.lua @@ -108,7 +108,7 @@ local function AddOptions(allOptions, data) -- Unknown trigger system, empty options local options = {}; OptionsPrivate.commonOptions.AddCommonTriggerOptions(options, data, index) - OptionsPrivate.AddTriggerMetaFunctions(options, data, index, true) + OptionsPrivate.AddTriggerMetaFunctions(options, data, index) triggerOptions = union(triggerOptions, { ["trigger." .. index .. ".unknown"] = options }) diff --git a/WeakAurasOptions/WeakAurasOptions.lua b/WeakAurasOptions/WeakAurasOptions.lua index 648833a..6a597f4 100644 --- a/WeakAurasOptions/WeakAurasOptions.lua +++ b/WeakAurasOptions/WeakAurasOptions.lua @@ -404,7 +404,7 @@ function OptionsPrivate.MultipleDisplayTooltipMenu() local allSameParent = true local commonParent = nil local first = true - for index, id in pairs(tempGroup.controlledChildren) do + for _, id in pairs(tempGroup.controlledChildren) do local childData = WeakAuras.GetData(id); if(childData and childData.controlledChildren) then anyGroup = true; @@ -555,19 +555,6 @@ local function OnAboutToDelete(event, uid, id, parentUid, parentId) collapsedOptions[id] = nil end -local function OnDelete(event, uid, id, parentUid, parentId) - local parentData = OptionsPrivate.Private.GetDataByUID(parentUid) - if(parentData and parentData.controlledChildren and not OptionsPrivate.massDelete) then - for index, childId in pairs(parentData.controlledChildren) do - local childButton = displayButtons[childId]; - if(childButton) then - childButton:SetGroupOrder(index, #parentData.controlledChildren) - end - end - WeakAuras.ClearAndUpdateOptions(parentData.id) - end -end - local function OnRename(event, uid, oldid, newid) local data = OptionsPrivate.Private.GetDataByUID(uid) @@ -582,7 +569,7 @@ local function OnRename(event, uid, oldid, newid) collapsedOptions[oldid] = nil if(data.controlledChildren) then - for index, childId in pairs(data.controlledChildren) do + for _, childId in pairs(data.controlledChildren) do WeakAuras.displayButtons[childId]:SetGroup(newid) end end @@ -722,7 +709,7 @@ local function LayoutDisplayButtons(msg) local func2 = function() local num = frame.loadProgressNum or 0; - for index, id in pairs(unloadedSorted) do + for _, id in pairs(unloadedSorted) do local data = WeakAuras.GetData(id); if(data) then EnsureDisplayButton(data); @@ -764,7 +751,7 @@ local function LayoutDisplayButtons(msg) local func1 = function() local num = frame.loadProgressNum or 0; frame.buttonsScroll:PauseLayout() - for index, id in pairs(loadedSorted) do + for _, id in pairs(loadedSorted) do local data = WeakAuras.GetData(id); if(data) then EnsureDisplayButton(data); @@ -1204,7 +1191,7 @@ function OptionsPrivate.SortDisplayButtons(filter, overrideReset, id) end end - for id, child in pairs(displayButtons) do + for _, child in pairs(displayButtons) do if(not visible[child]) then child.frame:Hide(); if child.ReleaseThumbnail then @@ -1365,7 +1352,7 @@ function OptionsPrivate.StartGrouping(data) children[childId] = true; end -- set grouping for non selected buttons - for id, button in pairs(displayButtons) do + for _, button in pairs(displayButtons) do if not children[button.data.id] then button:StartGrouping(tempGroup.controlledChildren, false); end @@ -1406,7 +1393,7 @@ function OptionsPrivate.Ungroup(data) end function OptionsPrivate.DragReset() - for id, button in pairs(displayButtons) do + for _, button in pairs(displayButtons) do button:DragReset(); end OptionsPrivate.UpdateButtonsScroll() @@ -1502,13 +1489,13 @@ function OptionsPrivate.Drop(mainAura, target, action, area) end end - for index, button in ipairs(buttonsToSort) do + for _, button in ipairs(buttonsToSort) do button:Drop(mode, mainAura, target, action) end -- Update offset, this is a bit wasteful to do for every aura -- But we also need to update the offset if a parent was dragged - for id, button in pairs(displayButtons) do + for _, button in pairs(displayButtons) do button:UpdateOffset(); end @@ -1532,7 +1519,7 @@ function OptionsPrivate.StartDrag(mainAura) children[child.id] = true end -- set dragging for non selected buttons - for id, button in pairs(displayButtons) do + for _, button in pairs(displayButtons) do if not children[button.data.id] then button:DragStart("MULTI", false, mainAura); end @@ -1678,7 +1665,7 @@ function WeakAuras.SetMoverSizer(id) frame.moversizer:SetToRegion(WeakAuras.regions[id].region, db.displays[id]) else if WeakAuras.clones[id] then - local cloneId, clone = next(WeakAuras.clones[id]) + local _, clone = next(WeakAuras.clones[id]) if clone then frame.moversizer:SetToRegion(clone, db.displays[id]) end @@ -1963,7 +1950,7 @@ function OptionsPrivate.AddTextFormatOption(input, withHeader, get, addOption, h local seenSymbols = {} OptionsPrivate.Private.ParseTextStr(input, function(symbol) if not seenSymbols[symbol] then - local triggerNum, sym = string.match(symbol, "(.+)%.(.+)") + local _, sym = string.match(symbol, "(.+)%.(.+)") sym = sym or symbol if sym == "i" then