diff --git a/WeakAuras/Animations.lua b/WeakAuras/Animations.lua index 5bda8ba..fe71514 100644 --- a/WeakAuras/Animations.lua +++ b/WeakAuras/Animations.lua @@ -71,7 +71,7 @@ local function UpdateAnimations() end local progress = anim.inverse and (1 - anim.progress) or anim.progress; progress = anim.easeFunc(progress, anim.easeStrength or 3) - WeakAuras.ActivateAuraEnvironmentForRegion(anim.region) + Private.ActivateAuraEnvironmentForRegion(anim.region) if(anim.translateFunc) then if (anim.region.SetOffsetAnim) then local ok, x, y = pcall(anim.translateFunc, progress, 0, 0, anim.dX, anim.dY); @@ -133,7 +133,7 @@ local function UpdateAnimations() anim.region:ColorAnim(r, g, b, a); end end - WeakAuras.ActivateAuraEnvironment(nil); + Private.ActivateAuraEnvironment(nil); if(finished) then if not(anim.loop) then if (anim.region.SetOffsetAnim) then @@ -321,7 +321,7 @@ function WeakAuras.Animate(namespace, uid, type, anim, region, inverse, onFinish duration = WeakAuras.ParseNumber(anim.duration) or 0; progress = 0; if(namespace == "display" and type == "main" and not onFinished and not anim.duration_type == "relative") then - local data = WeakAuras.GetDataByUID(uid); + local data = Private.GetDataByUID(uid); if(data and data.parent) then local parentRegion = WeakAuras.regions[data.parent].region; if(parentRegion and parentRegion.controlledRegions) then diff --git a/WeakAuras/AuraEnvironment.lua b/WeakAuras/AuraEnvironment.lua index a8e384b..7e58e70 100644 --- a/WeakAuras/AuraEnvironment.lua +++ b/WeakAuras/AuraEnvironment.lua @@ -109,15 +109,6 @@ end WeakAuras.WA_Utf8Sub = WA_Utf8Sub -local helperFunctions = { - WA_GetUnitAura = WA_GetUnitAura, - WA_GetUnitBuff = WA_GetUnitBuff, - WA_GetUnitDebuff = WA_GetUnitDebuff, - WA_IterateGroupMembers = WA_IterateGroupMembers, - WA_ClassColorName = WA_ClassColorName, - WA_Utf8Sub = WA_Utf8Sub, -} - local LCG = LibStub("LibCustomGlow-1.0") WeakAuras.ShowOverlayGlow = LCG.ButtonGlow_Start WeakAuras.HideOverlayGlow = LCG.ButtonGlow_Stop @@ -125,10 +116,6 @@ WeakAuras.HideOverlayGlow = LCG.ButtonGlow_Stop local LGF = LibStub("LibGetFrame-1.0") WeakAuras.GetUnitFrame = LGF.GetUnitFrame -local function forbidden() - prettyPrint(L["A WeakAura just tried to use a forbidden function but has been blocked from doing so. Please check your auras!"]) -end - local blockedFunctions = { -- Lua functions that may allow breaking out of the environment getfenv = true, @@ -149,7 +136,6 @@ local blockedFunctions = { AcceptTrade = true, SetSendMailMoney = true, EditMacro = true, - SlashCmdList = true, DevTools_DumpCommand = true, hash_SlashCmdList = true, CreateMacro = true, @@ -160,9 +146,8 @@ local blockedFunctions = { DeleteCursorItem = true, } -local overrideFunctions = { - ActionButton_ShowOverlayGlow = WeakAuras.ShowOverlayGlow, - ActionButton_HideOverlayGlow = WeakAuras.HideOverlayGlow, +local blockedTables = { + SlashCmdList = true, } local aura_environments = {} @@ -171,42 +156,50 @@ local aura_environments = {} -- 2 == fully initialized local environment_initialized = {} -function WeakAuras.IsEnvironmentInitialized(id) +function Private.IsEnvironmentInitialized(id) return environment_initialized[id] == 2 end -function WeakAuras.DeleteAuraEnvironment(id) +function Private.DeleteAuraEnvironment(id) aura_environments[id] = nil environment_initialized[id] = nil end -function WeakAuras.RenameAuraEnvironment(oldid, newid) +function Private.RenameAuraEnvironment(oldid, newid) aura_environments[oldid], aura_environments[newid] = nil, aura_environments[oldid] environment_initialized[oldid], environment_initialized[newid] = nil, environment_initialized[oldid] end +local current_uid = nil local current_aura_env = nil -local aura_env_stack = {} -- Stack of of aura environments, allows use of recursive aura activations through calls to WeakAuras.ScanEvents(). +-- Stack of of aura environments/uids, allows use of recursive aura activations through calls to WeakAuras.ScanEvents(). +local aura_env_stack = {} -function WeakAuras.ClearAuraEnvironment(id) +function Private.ClearAuraEnvironment(id) environment_initialized[id] = nil; end -function WeakAuras.ActivateAuraEnvironmentForRegion(region, onlyConfig) - WeakAuras.ActivateAuraEnvironment(region.id, region.cloneId, region.state, region.states, onlyConfig) +function Private.ActivateAuraEnvironmentForRegion(region, onlyConfig) + Private.ActivateAuraEnvironment(region.id, region.cloneId, region.state, region.states, onlyConfig) end -function WeakAuras.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig) +function Private.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfig) local data = WeakAuras.GetData(id) local region = WeakAuras.GetRegion(id, cloneId) if not data then -- Pop the last aura_env from the stack, and update current_aura_env appropriately. tremove(aura_env_stack) - current_aura_env = aura_env_stack[#aura_env_stack] or nil + if aura_env_stack[#aura_env_stack] then + current_aura_env, current_uid = unpack(aura_env_stack[#aura_env_stack]) + else + current_aura_env = nil + current_uid = nil + end else -- Existing config is initialized to a high enough value if environment_initialized[id] == 2 or (onlyConfig and environment_initialized[id] == 1) then -- Point the current environment to the correct table + current_uid = data.uid current_aura_env = aura_environments[id] current_aura_env.id = id current_aura_env.cloneId = cloneId @@ -214,17 +207,18 @@ function WeakAuras.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfi current_aura_env.states = states current_aura_env.region = region -- Push the new environment onto the stack - tinsert(aura_env_stack, current_aura_env) + tinsert(aura_env_stack, {current_aura_env, data.uid}) elseif onlyConfig then environment_initialized[id] = 1 aura_environments[id] = {} + current_uid = data.uid current_aura_env = aura_environments[id] current_aura_env.id = id current_aura_env.cloneId = cloneId current_aura_env.state = state current_aura_env.states = states current_aura_env.region = region - tinsert(aura_env_stack, current_aura_env) + tinsert(aura_env_stack, {current_aura_env, data.uid}) if not data.controlledChildren then current_aura_env.config = CopyTable(data.config) @@ -233,6 +227,7 @@ function WeakAuras.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfi -- Either this aura environment has not yet been initialized, or it was reset via an edit in WeakaurasOptions environment_initialized[id] = 2 aura_environments[id] = aura_environments[id] or {} + current_uid = data.uid current_aura_env = aura_environments[id] current_aura_env.id = id current_aura_env.cloneId = cloneId @@ -240,7 +235,7 @@ function WeakAuras.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfi current_aura_env.states = states current_aura_env.region = region -- push new environment onto the stack - tinsert(aura_env_stack, current_aura_env) + tinsert(aura_env_stack, {current_aura_env, data.uid}) if data.controlledChildren then current_aura_env.child_envs = {} @@ -248,8 +243,8 @@ function WeakAuras.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfi local childData = WeakAuras.GetData(childID) if childData then if not environment_initialized[childID] then - WeakAuras.ActivateAuraEnvironment(childID) - WeakAuras.ActivateAuraEnvironment() + Private.ActivateAuraEnvironment(childID) + Private.ActivateAuraEnvironment() end current_aura_env.child_envs[dataIndex] = aura_environments[childID] end @@ -273,9 +268,68 @@ function WeakAuras.ActivateAuraEnvironment(id, cloneId, state, states, onlyConfi end end +local function blocked() + Private.AuraWarnings.UpdateWarning(current_uid, "SandboxForbidden", "error", + L["Forbidden function or table."]) +end + +local function MakeReadOnly(input, options) + return setmetatable({}, + { + __index = function(t, k) + if options.blockedFunctions[k] then + return options.blocked + elseif options.blockedTables[k] then + return options.blocked() + elseif options.override[k] then + return options.override[k] + else + return input[k] + end + end, + __newindex = options.setBlocked, + __metatable = false + }) +end + +local FakeWeakAurasMixin = { + blockedFunctions = { + Add = true, + Rename = true, + Delete = true + }, + blockedTables = { + AuraWarnings = true + }, + override = { + me = UnitName("player"), + myGUID = UnitGUID("player") + }, + blocked = blocked, + setBlocked = function() + Private.AuraWarnings.UpdateWarning(current_uid, "FakeWeakAurasSet", "error", + L["Writing to the WeakAuras table is not allowed."], true) + end +} + +local FakeWeakAuras = MakeReadOnly(WeakAuras, FakeWeakAurasMixin) + +local overridden = { + WA_GetUnitAura = WA_GetUnitAura, + WA_GetUnitBuff = WA_GetUnitBuff, + WA_GetUnitDebuff = WA_GetUnitDebuff, + WA_IterateGroupMembers = WA_IterateGroupMembers, + WA_ClassColorName = WA_ClassColorName, + WA_Utf8Sub = WA_Utf8Sub, + ActionButton_ShowOverlayGlow = WeakAuras.ShowOverlayGlow, + ActionButton_HideOverlayGlow = WeakAuras.HideOverlayGlow, + WeakAuras = FakeWeakAuras +} + local env_getglobal -local exec_env = setmetatable({}, { __index = - function(t, k) +local exec_env = setmetatable({}, +{ + __index = function(t, k) if k == "_G" then return t elseif k == "getglobal" then @@ -283,15 +337,23 @@ local exec_env = setmetatable({}, { __index = elseif k == "aura_env" then return current_aura_env elseif blockedFunctions[k] then - return forbidden - elseif overrideFunctions[k] then - return overrideFunctions[k] - elseif helperFunctions[k] then - return helperFunctions[k] + return blocked + elseif blockedTables[k] then + return blocked() + elseif overridden[k] then + return overridden[k] else return _G[k] end - end + 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)) + end + rawset(table, key, value) + end, + __metatable = false }) function env_getglobal(k) @@ -317,6 +379,6 @@ function WeakAuras.LoadFunction(string, id, inTrigger) end end -function WeakAuras.GetSanitizedGlobal(key) +function Private.GetSanitizedGlobal(key) return exec_env[key] end diff --git a/WeakAuras/AuraWarnings.lua b/WeakAuras/AuraWarnings.lua new file mode 100644 index 0000000..3a39c9a --- /dev/null +++ b/WeakAuras/AuraWarnings.lua @@ -0,0 +1,113 @@ +if not WeakAuras.IsCorrectVersion() then return end +local AddonName, Private = ... + +local WeakAuras = WeakAuras +local L = WeakAuras.L + +-- keyed on uid, key, { severity, message } +local warnings = {} +local printedWarnings = {} + +local function OnDelete(event, uid) + warnings[uid] = nil +end + +Private:RegisterCallback("Delete", OnDelete) + +local function UpdateWarning(uid, key, severity, message, printOnConsole) + if not uid then + WeakAuras.prettyPrint(L["Warning for unknown aura:"], message) + return + end + if printOnConsole then + printedWarnings[uid] = printedWarnings[uid] or {} + if printedWarnings[uid][key] == nil then + WeakAuras.prettyPrint(string.format(L["Aura '%s': %s"], WeakAuras.UIDtoID(uid), message)) + printedWarnings[uid][key] = true + end + end + + warnings[uid] = warnings[uid] or {} + if severity and message then + warnings[uid][key] = { + severity = severity, + message = message + } + else + warnings[uid][key] = nil + end + + Private.callbacks:Fire("AuraWarningsUpdated", uid) +end + +local severityLevel = { + info = 0, + warning = 1, + error = 2 +} + +-- TODO proper icons +local icons = { + info = [[Interface/friendsframe/informationicon.blp]], + warning = [[Interface/buttons/adventureguidemicrobuttonalert.blp]], + error = [[Interface/DialogFrame/UI-Dialog-Icon-AlertNew]] +} + +local titles = { + info = L["Information"], + warning = L["Warning"], + error = L["Error"] +} + +local function AddMessages(result, messages, icon, mixedSeverity) + if not messages then + return result + end + for index, message in ipairs(messages) do + if result ~= "" then + result = result .. "\n\n" + end + if mixedSeverity then + result = result .. "|T" .. icon .. ":12:12:0:0:64:64:4:60:4:60|t" + end + result = result .. message + end + return result +end + +local function FormatWarnings(uid) + if not warnings[uid] then + return + end + + local maxSeverity + local mixedSeverity = false + + local messagePerSeverity = {} + + for key, warning in pairs(warnings[uid]) do + if not maxSeverity then + maxSeverity = warning.severity + elseif severityLevel[warning.severity] > severityLevel[maxSeverity] then + maxSeverity = warning.severity + elseif severityLevel[warning.severity] < severityLevel[maxSeverity] then + mixedSeverity = true + end + messagePerSeverity[warning.severity] = messagePerSeverity[warning.severity] or {} + tinsert(messagePerSeverity[warning.severity], warning.message) + end + + if not maxSeverity then + return + end + + local result = "" + result = AddMessages(result, messagePerSeverity["error"], icons["error"], mixedSeverity) + result = AddMessages(result, messagePerSeverity["warning"], icons["warning"], mixedSeverity) + result = AddMessages(result, messagePerSeverity["info"], icons["info"], mixedSeverity) + return icons[maxSeverity], titles[maxSeverity], result +end + +Private.AuraWarnings = {} +Private.AuraWarnings.UpdateWarning = UpdateWarning +Private.AuraWarnings.FormatWarnings = FormatWarnings diff --git a/WeakAuras/BuffTrigger.lua b/WeakAuras/BuffTrigger.lua index 6617446..f52f3ee 100644 --- a/WeakAuras/BuffTrigger.lua +++ b/WeakAuras/BuffTrigger.lua @@ -21,7 +21,22 @@ function BuffTrigger.Delete(id) end function BuffTrigger.Rename(oldid, newid) end -function BuffTrigger.Add(data) end +function BuffTrigger.Add(data) + if data.triggers then + local hasLegacyAuraTrigger = false + for index, t in ipairs(data.triggers) do + if t.trigger.type == "aura" then + hasLegacyAuraTrigger = true + break + end + end + if hasLegacyAuraTrigger then + Private.AuraWarnings.UpdateWarning(data.uid, "legacy", "warning", "This aura has legacy aura trigger(s), which are no longer supported.") + else + Private.AuraWarnings.UpdateWarning(data.uid, "legacy") + end + end +end function BuffTrigger.CanHaveDuration(data, triggernum) return false diff --git a/WeakAuras/BuffTrigger2.lua b/WeakAuras/BuffTrigger2.lua index 9cee2cd..44b7f73 100644 --- a/WeakAuras/BuffTrigger2.lua +++ b/WeakAuras/BuffTrigger2.lua @@ -70,8 +70,6 @@ local timer = WeakAuras.timer local BuffTrigger = {} local triggerInfos = {} -local UnitGroupRolesAssigned = function() return "DAMAGER" end - -- keyed on unit, debuffType, spellname, with a scan object value -- scan object: id, triggernum, scanFunc local scanFuncName = {} diff --git a/WeakAuras/Conditions.lua b/WeakAuras/Conditions.lua index 2eedcdb..6dc8c02 100644 --- a/WeakAuras/Conditions.lua +++ b/WeakAuras/Conditions.lua @@ -249,17 +249,19 @@ end local function CreateCheckCondition(uid, ret, condition, conditionNumber, allConditionsTemplate, nextIsLinked, debug) local usedStates = {}; local check, recheckCode = CreateTestForCondition(uid, condition.check, allConditionsTemplate, usedStates); - if (check) then - if condition.linked and conditionNumber > 1 then - ret = ret .. " elseif (" .. check .. ") then\n"; - else - ret = ret .. " if (" .. check .. ") then\n"; - end - ret = ret .. " newActiveConditions[" .. conditionNumber .. "] = true;\n"; - if not nextIsLinked then - ret = ret .. " end\n"; - end + if not check then + check = "false" end + if condition.linked and conditionNumber > 1 then + ret = ret .. " elseif (" .. check .. ") then\n"; + else + ret = ret .. " if (" .. check .. ") then\n"; + end + ret = ret .. " newActiveConditions[" .. conditionNumber .. "] = true;\n"; + if not nextIsLinked then + ret = ret .. " end\n"; + end + if (recheckCode) then ret = ret .. recheckCode; end diff --git a/WeakAuras/GenericTrigger.lua b/WeakAuras/GenericTrigger.lua index 3f69152..d8084b6 100644 --- a/WeakAuras/GenericTrigger.lua +++ b/WeakAuras/GenericTrigger.lua @@ -724,7 +724,7 @@ function WeakAuras.ScanUnitEvents(event, unit, ...) if event_list then for id, triggers in pairs(event_list) do WeakAuras.StartProfileAura(id); - WeakAuras.ActivateAuraEnvironment(id); + Private.ActivateAuraEnvironment(id); local updateTriggerState = false; for triggernum, data in pairs(triggers) do local allStates = WeakAuras.GetTriggerStateForTrigger(id, triggernum); @@ -736,7 +736,7 @@ function WeakAuras.ScanUnitEvents(event, unit, ...) WeakAuras.UpdatedTriggerState(id); end WeakAuras.StopProfileAura(id); - WeakAuras.ActivateAuraEnvironment(nil); + Private.ActivateAuraEnvironment(nil); end end end @@ -746,7 +746,7 @@ end function WeakAuras.ScanEventsInternal(event_list, event, arg1, arg2, ... ) for id, triggers in pairs(event_list) do WeakAuras.StartProfileAura(id); - WeakAuras.ActivateAuraEnvironment(id); + Private.ActivateAuraEnvironment(id); local updateTriggerState = false; for triggernum, data in pairs(triggers) do local allStates = WeakAuras.GetTriggerStateForTrigger(id, triggernum); @@ -758,7 +758,7 @@ function WeakAuras.ScanEventsInternal(event_list, event, arg1, arg2, ... ) WeakAuras.UpdatedTriggerState(id); end WeakAuras.StopProfileAura(id); - WeakAuras.ActivateAuraEnvironment(nil); + Private.ActivateAuraEnvironment(nil); end end @@ -776,7 +776,7 @@ end function GenericTrigger.CreateFakeStates(id, triggernum) local data = WeakAuras.GetData(id) - WeakAuras.ActivateAuraEnvironment(id); + Private.ActivateAuraEnvironment(id); local allStates = WeakAuras.GetTriggerStateForTrigger(id, triggernum); RunTriggerFunc(allStates, events[id][triggernum], id, triggernum, "OPTIONS") @@ -805,12 +805,12 @@ function GenericTrigger.CreateFakeStates(id, triggernum) AddFakeTime(state) end - WeakAuras.ActivateAuraEnvironment(nil); + Private.ActivateAuraEnvironment(nil); end function GenericTrigger.ScanWithFakeEvent(id, fake) local updateTriggerState = false; - WeakAuras.ActivateAuraEnvironment(id); + Private.ActivateAuraEnvironment(id); for triggernum, event in pairs(events[id] or {}) do local allStates = WeakAuras.GetTriggerStateForTrigger(id, triggernum); if (event.force_events) then @@ -839,7 +839,7 @@ function GenericTrigger.ScanWithFakeEvent(id, fake) if (updateTriggerState) then WeakAuras.UpdatedTriggerState(id); end - WeakAuras.ActivateAuraEnvironment(nil); + Private.ActivateAuraEnvironment(nil); end function GenericTrigger.ScanAll() @@ -2431,7 +2431,10 @@ local watchUnitChange -- Nameplates only distinguish between friends and everyone else function WeakAuras.GetPlayerReaction(unit) - return UnitIsEnemy('player', unit) and 'hostile' or 'friendly' + local r = UnitReaction("player", unit) + if r then + return r < 5 and "hostile" or "friendly" + end end function WeakAuras.WatchUnitChange(unit) @@ -3360,9 +3363,9 @@ function GenericTrigger.GetOverlayInfo(data, triggernum) end else local allStates = {}; - WeakAuras.ActivateAuraEnvironment(data.id); + Private.ActivateAuraEnvironment(data.id); RunTriggerFunc(allStates, events[data.id][triggernum], data.id, triggernum, "OPTIONS"); - WeakAuras.ActivateAuraEnvironment(nil); + Private.ActivateAuraEnvironment(nil); local count = 0; for id, state in pairs(allStates) do if (type(state.additionalProgress) == "table") then @@ -3676,9 +3679,9 @@ function GenericTrigger.GetTriggerConditions(data, triggernum) return result; elseif (trigger.custom_type == "stateupdate") then if (events[data.id][triggernum] and events[data.id][triggernum].tsuConditionVariables) then - WeakAuras.ActivateAuraEnvironment(data.id, nil, nil, nil, true) + Private.ActivateAuraEnvironment(data.id, nil, nil, nil, true) local result = events[data.id][triggernum].tsuConditionVariables() - WeakAuras.ActivateAuraEnvironment(nil) + Private.ActivateAuraEnvironment(nil) if (type(result)) ~= "table" then return nil; end @@ -3726,7 +3729,7 @@ function GenericTrigger.CreateFallbackState(data, triggernum, state) state.changed = true; local event = events[data.id][triggernum]; - WeakAuras.ActivateAuraEnvironment(data.id, "", state); + Private.ActivateAuraEnvironment(data.id, "", state); local firstTrigger = data.triggers[1].trigger if (event.nameFunc) then local ok, name = pcall(event.nameFunc, firstTrigger); @@ -3815,7 +3818,7 @@ function GenericTrigger.CreateFallbackState(data, triggernum, state) if (event.overlayFuncs) then RunOverlayFuncs(event, state); end - WeakAuras.ActivateAuraEnvironment(nil); + Private.ActivateAuraEnvironment(nil); end function GenericTrigger.GetName(triggerType) diff --git a/WeakAuras/History.lua b/WeakAuras/History.lua index 17004e9..c11c57a 100644 --- a/WeakAuras/History.lua +++ b/WeakAuras/History.lua @@ -25,7 +25,7 @@ function WeakAuras.CleanArchive(historyCutoff, migrationCutoff) for uid, subStore in pairs(repo.stores) do -- Ideally we would just use Clean and not access the stores list directly, -- but that'd mean having Clean take a predicate which seems like overkill for the moment - if not WeakAuras.GetDataByUID(uid) and subStore.timestamp < cutoffTime then + if not Private.GetDataByUID(uid) and subStore.timestamp < cutoffTime then repo:Drop(uid) end end diff --git a/WeakAuras/Media/Creative Commons - Sampling Plus 1.0.txt b/WeakAuras/Media/Creative Commons - Sampling Plus 1.0.txt index 7a90c03..28735f8 100644 --- a/WeakAuras/Media/Creative Commons - Sampling Plus 1.0.txt +++ b/WeakAuras/Media/Creative Commons - Sampling Plus 1.0.txt @@ -1 +1 @@ -Creative Commons Creative Commons Legal Code sampling plus Sampling Plus 1.0 by CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. License THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. 1. Definitions "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. "Licensor" means the individual or entity that offers the Work under the terms of this License. "Original Author" means the individual or entity who created the Work. "Work" means the copyrightable work of authorship offered under the terms of this License. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. 2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws. 3. License Grant & Restrictions. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below on the conditions as stated below: Re-creativity permitted. You may create and reproduce Derivative Works, provided that: the Derivative Work(s) constitute a good-faith partial or recombined usage employing "sampling," "collage," "mash-up," or other comparable artistic technique, whether now known or hereafter devised, that is highly transformative of the original, as appropriate to the medium, genre, and market niche; and Your Derivative Work(s) must only make a partial use of the original Work, or if You choose to use the original Work as a whole, You must either use the Work as an insubstantial portion of Your Derivative Work(s) or transform it into something substantially different from the original Work. In the case of a musical Work and/or audio recording, the mere synchronization ("synching") of the Work with a moving image shall not be considered a transformation of the Work into something substantially different. You may distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission, any Derivative Work(s) authorized under this License. Prohibition on advertising. All advertising and promotional uses are excluded from the above rights, except for advertisement and promotion of the Derivative Work(s) that You are creating from the Work and Yourself as the author thereof. Noncommercial sharing of verbatim copies permitted. You may reproduce the Work, incorporate the Work into one or more Collective Works, and reproduce the Work as incorporated in the Collective Works. You may distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including or incorporated in Collective Works. You may not exercise any of the rights granted to You in the paragraph immediately above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works. Attribution and Notice. If You distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; to the extent reasonably practicable, provide the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work or a Derivative Work, unless such Uniform Resource Identifier does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, provide a credit identifying the use of the Work in the Derivative Work (e.g., "Remix of the Work by Original Author," or "Inclusion of a portion of the Work by Original Author in collage"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit. You may distribute, publicly display, publicly perform or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work or Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access of use of the Work in a manner inconsistent with the terms of this License. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. Upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work or Collective Work any reference to such Licensor or the Original Author, as requested. The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved. 4. Disclaimer UNLESS SPECIFIED OTHERWISE BY THE PARTIES IN A SEPARATE WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. 5. Limitation on Liability. IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 6. Termination This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 4, 5, 6, and 7 will survive any termination of this License. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. 7. Miscellaneous Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements, or representations with respect to the Work, and with respect to the subject matter hereof, not specified above. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. Disclaimers disclaimer « Back to Commons Deed \ No newline at end of file +Creative Commons Creative Commons Legal Code sampling plus Sampling Plus 1.0 by CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. License THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. 1. Definitions "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. "Licensor" means the individual or entity that offers the Work under the terms of this License. "Original Author" means the individual or entity who created the Work. "Work" means the copyrightable work of authorship offered under the terms of this License. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. 2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws. 3. License Grant & Restrictions. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below on the conditions as stated below: Re-creativity permitted. You may create and reproduce Derivative Works, provided that: the Derivative Work(s) constitute a good-faith partial or recombined usage employing "sampling," "collage," "mash-up," or other comparable artistic technique, whether now known or hereafter devised, that is highly transformative of the original, as appropriate to the medium, genre, and market niche; and Your Derivative Work(s) must only make a partial use of the original Work, or if You choose to use the original Work as a whole, You must either use the Work as an insubstantial portion of Your Derivative Work(s) or transform it into something substantially different from the original Work. In the case of a musical Work and/or audio recording, the mere synchronization ("synching") of the Work with a moving image shall not be considered a transformation of the Work into something substantially different. You may distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission, any Derivative Work(s) authorized under this License. Prohibition on advertising. All advertising and promotional uses are excluded from the above rights, except for advertisement and promotion of the Derivative Work(s) that You are creating from the Work and Yourself as the author thereof. Noncommercial sharing of verbatim copies permitted. You may reproduce the Work, incorporate the Work into one or more Collective Works, and reproduce the Work as incorporated in the Collective Works. You may distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including or incorporated in Collective Works. You may not exercise any of the rights granted to You in the paragraph immediately above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works. Attribution and Notice. If You distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; to the extent reasonably practicable, provide the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work or a Derivative Work, unless such Uniform Resource Identifier does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, provide a credit identifying the use of the Work in the Derivative Work (e.g., "Remix of the Work by Original Author," or "Inclusion of a portion of the Work by Original Author in collage"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit. You may distribute, publicly display, publicly perform or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work or Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients' exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access of use of the Work in a manner inconsistent with the terms of this License. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. Upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work or Collective Work any reference to such Licensor or the Original Author, as requested. The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved. 4. Disclaimer UNLESS SPECIFIED OTHERWISE BY THE PARTIES IN A SEPARATE WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. 5. Limitation on Liability. IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 6. Termination This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 4, 5, 6, and 7 will survive any termination of this License. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. 7. Miscellaneous Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements, or representations with respect to the Work, and with respect to the subject matter hereof, not specified above. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. Disclaimers disclaimer « Back to Commons Deed \ No newline at end of file diff --git a/WeakAuras/Prototypes.lua b/WeakAuras/Prototypes.lua index 9c0f3a4..21c9399 100644 --- a/WeakAuras/Prototypes.lua +++ b/WeakAuras/Prototypes.lua @@ -2471,7 +2471,6 @@ WeakAuras.event_prototypes = { end end, init = function(trigger) - --trigger.itemName = WeakAuras.CorrectItemName(trigger.itemName) or 0; trigger.itemName = trigger.itemName or 0; local itemName = type(trigger.itemName) == "number" and trigger.itemName or "[["..trigger.itemName.."]]"; local ret = [=[ @@ -2780,7 +2779,6 @@ WeakAuras.event_prototypes = { WeakAuras.WatchItemCooldown(trigger.itemName); end, init = function(trigger) - --trigger.itemName = WeakAuras.CorrectItemName(trigger.itemName) or 0; trigger.itemName = trigger.itemName or 0; end, args = { @@ -3880,7 +3878,6 @@ WeakAuras.event_prototypes = { force_events = "BAG_UPDATE", name = L["Item Count"], init = function(trigger) - --trigger.itemName = WeakAuras.CorrectItemName(trigger.itemName) or 0; trigger.itemName = trigger.itemName or 0; local itemName = type(trigger.itemName) == "number" and trigger.itemName or "[["..trigger.itemName.."]]"; local ret = [[ @@ -4459,7 +4456,6 @@ WeakAuras.event_prototypes = { force_events = "UNIT_INVENTORY_CHANGED", name = L["Item Equipped"], init = function(trigger) - --trigger.itemName = WeakAuras.CorrectItemName(trigger.itemName) or 0; trigger.itemName = trigger.itemName or 0; local itemName = type(trigger.itemName) == "number" and trigger.itemName or "[[" .. trigger.itemName .. "]]"; diff --git a/WeakAuras/RegionTypes/DynamicGroup.lua b/WeakAuras/RegionTypes/DynamicGroup.lua index 253d304..4c2ce6b 100644 --- a/WeakAuras/RegionTypes/DynamicGroup.lua +++ b/WeakAuras/RegionTypes/DynamicGroup.lua @@ -311,9 +311,9 @@ local sorters = { local sortStr = data.customSort or "" local sortFunc = WeakAuras.LoadFunction("return " .. sortStr, data.id, "custom sort") or noop return function(a, b) - WeakAuras.ActivateAuraEnvironment(data.id) + Private.ActivateAuraEnvironment(data.id) local ok, result = pcall(sortFunc, a, b) - WeakAuras.ActivateAuraEnvironment() + Private.ActivateAuraEnvironment() if not ok then geterrorhandler()(result) else @@ -370,12 +370,12 @@ local anchorers = { local anchorStr = data.customAnchorPerUnit or "" local anchorFunc = WeakAuras.LoadFunction("return " .. anchorStr, data.id, "custom frame anchor") or noop return function(frames, activeRegions) - WeakAuras.ActivateAuraEnvironment(data.id) + Private.ActivateAuraEnvironment(data.id) local ok, ret = pcall(anchorFunc, frames, activeRegions) if not ok then geterrorhandler()(ret) end - WeakAuras.ActivateAuraEnvironment() + Private.ActivateAuraEnvironment() end end } @@ -735,9 +735,9 @@ local growers = { local growStr = data.customGrow or "" local growFunc = WeakAuras.LoadFunction("return " .. growStr, data.id, "custom grow") or noop return function(newPositions, activeRegions) - WeakAuras.ActivateAuraEnvironment(data.id) + Private.ActivateAuraEnvironment(data.id) local ok, ret = pcall(growFunc, newPositions, activeRegions) - WeakAuras.ActivateAuraEnvironment() + Private.ActivateAuraEnvironment() if not ok then geterrorhandler()(ret) wipe(newPositions) diff --git a/WeakAuras/RegionTypes/ProgressTexture.lua b/WeakAuras/RegionTypes/ProgressTexture.lua index 1cdeaa1..7062252 100644 --- a/WeakAuras/RegionTypes/ProgressTexture.lua +++ b/WeakAuras/RegionTypes/ProgressTexture.lua @@ -886,10 +886,10 @@ local function modify(parent, region, data) function region:SetTexture(texture) region.currentTexture = texture; - region.foreground:SetTexture(texture, region.textureWrapMode, region.textureWrapMode); + region.foreground:SetTexture(texture); foregroundSpinner:SetTexture(texture); if (data.sameTexture) then - background:SetTexture(texture, region.textureWrapMode, region.textureWrapMode); + background:SetTexture(texture); backgroundSpinner:SetTexture(texture); end end diff --git a/WeakAuras/RegionTypes/RegionPrototype.lua b/WeakAuras/RegionTypes/RegionPrototype.lua index d3a8862..22bb8b5 100644 --- a/WeakAuras/RegionTypes/RegionPrototype.lua +++ b/WeakAuras/RegionTypes/RegionPrototype.lua @@ -259,14 +259,15 @@ local function SendChat(self, options) if (not options or WeakAuras.IsOptionsOpen()) then return end + WeakAuras.HandleChatAction(options.message_type, options.message, options.message_dest, options.message_channel, options.r, options.g, options.b, self, options.message_custom, nil, options.message_formaters); end local function RunCode(self, func) if func and not WeakAuras.IsOptionsOpen() then - WeakAuras.ActivateAuraEnvironment(self.id, self.cloneId, self.state, self.states); + Private.ActivateAuraEnvironment(self.id, self.cloneId, self.state, self.states); xpcall(func, geterrorhandler()); - WeakAuras.ActivateAuraEnvironment(nil); + Private.ActivateAuraEnvironment(nil); end end diff --git a/WeakAuras/Transmission.lua b/WeakAuras/Transmission.lua index 193b327..2cc9e72 100644 --- a/WeakAuras/Transmission.lua +++ b/WeakAuras/Transmission.lua @@ -322,7 +322,7 @@ local function install(data, oldData, patch, mode, isParent) return else -- user has chosen to not delete obsolete auras, so do nothing - return WeakAuras.GetDataByUID(oldData.uid) + return Private.GetDataByUID(oldData.uid) end else -- something to update @@ -350,7 +350,7 @@ local function install(data, oldData, patch, mode, isParent) end -- if at this point, then some change has been made in the db. Update History to reflect the change WeakAuras.SetHistory(installedUID, imported, "import") - return WeakAuras.GetDataByUID(installedUID) + return Private.GetDataByUID(installedUID) end local function importPendingData() diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index e5336e6..00b704a 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -245,6 +245,7 @@ WeakAuras.format_types = { min = 1, max = 20, hidden = hidden, + step = 1, disabled = function() return not get(symbol .. "_abbreviate") end @@ -366,7 +367,6 @@ WeakAuras.format_types = { min = 1, max = 20, hidden = hidden, - step = 1, disabled = function() return not get(symbol .. "_abbreviate") end @@ -736,12 +736,6 @@ WeakAuras.blend_types = { BLEND = L["Opaque"] } -WeakAuras.texture_wrap_types = { - CLAMP = L["Clamp"], - MIRROR = L["Mirror"], - REPEAT = L["Repeat"] -} - WeakAuras.slant_mode = { INSIDE = L["Keep Inside"], EXTEND = L["Extend Outside"] @@ -1337,7 +1331,7 @@ WeakAuras.texture_types = { ["Interface\\AddOns\\WeakAuras\\Media\\Textures\\Trapezoid"] = "Trapezoid", ["Interface\\AddOns\\WeakAuras\\Media\\Textures\\triangle-border.tga"] = "Triangle with Border", ["Interface\\AddOns\\WeakAuras\\Media\\Textures\\triangle.tga"] = "Triangle", - ["Interface\\AddOns\\WeakAuras\\Media\\Textures\\Circle_Smooth2.tga"] = "Smoohth Circle Small", + ["Interface\\AddOns\\WeakAuras\\Media\\Textures\\Circle_Smooth2.tga"] = "Smooth Circle Small", ["Interface\\AddOns\\WeakAuras\\Media\\Textures\\circle_border5.tga"] = "Circle Border", ["Interface\\AddOns\\WeakAuras\\Media\\Textures\\ring_glow3.tga"] = "Circle Border Glow", ["Interface\\AddOns\\WeakAuras\\Media\\Textures\\square_mini.tga"] = "Small Square", @@ -1404,8 +1398,8 @@ WeakAuras.texture_types["PowerAuras Icons"] = { [PowerAurasPath.."Aura27"] = "Alert", [PowerAurasPath.."Aura29"] = "Paw", [PowerAurasPath.."Aura30"] = "Bull", - -- [PowerAurasPath.."Aura31"] = "Heiroglyphics Horizontal", - [PowerAurasPath.."Aura32"] = "Heiroglyphics", + -- [PowerAurasPath.."Aura31"] = "Hieroglyphics Horizontal", + [PowerAurasPath.."Aura32"] = "Hieroglyphics", [PowerAurasPath.."Aura34"] = "Circled Arrow", [PowerAurasPath.."Aura35"] = "Short Sword", -- [PowerAurasPath.."Aura36"] = "Short Sword Horizontal", @@ -1447,7 +1441,7 @@ WeakAuras.texture_types["PowerAuras Icons"] = { -- [PowerAurasPath.."Aura111"] = "Hunter's Mark Horizontal", [PowerAurasPath.."Aura112"] = "Kaleidoscope", [PowerAurasPath.."Aura113"] = "Jesus Face", - [PowerAurasPath.."Aura114"] = "Green Mushrrom", + [PowerAurasPath.."Aura114"] = "Green Mushroom", [PowerAurasPath.."Aura115"] = "Red Mushroom", [PowerAurasPath.."Aura116"] = "Fire Flower", [PowerAurasPath.."Aura117"] = "Radioactive", @@ -1520,7 +1514,7 @@ WeakAuras.texture_types["PowerAuras Words"] = { [PowerAurasPath.."Aura39"] = "Silence", [PowerAurasPath.."Aura40"] = "Root", [PowerAurasPath.."Aura41"] = "Disorient", - [PowerAurasPath.."Aura42"] = "Dispell", + [PowerAurasPath.."Aura42"] = "Dispel", [PowerAurasPath.."Aura43"] = "Danger", [PowerAurasPath.."Aura44"] = "Buff", [PowerAurasPath.."Aura44"] = "Buff", @@ -2077,18 +2071,6 @@ WeakAuras.bool_types = { [1] = L["True"] } -WeakAuras.absorb_modes = { - OVERLAY_FROM_START = L["Attach to Start"], - OVERLAY_FROM_END = L["Attach to End"] -} - -WeakAuras.mythic_plus_affixes = {} - -local mythic_plus_blacklist = { - [1] = true, - [15] = true -} - WeakAuras.update_categories = { { name = "anchor", diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index e9902cf..08399a1 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -31,6 +31,8 @@ LibStub("AceTimer-3.0"):Embed(WeakAurasTimers) WeakAuras.maxTimerDuration = 604800; -- A week, in seconds WeakAuras.maxUpTime = 4294967; -- 2^32 / 1000 +Private.callbacks = LibStub("CallbackHandler-1.0"):New(Private) + function WeakAuras:Mixin(object, ...) for i = 1, select("#", ...) do local mixin = select(i, ...); @@ -88,7 +90,7 @@ function WeakAuras.OpenOptions(msg) if WeakAuras.NeedToRepairDatabase() then StaticPopup_Show("WEAKAURAS_CONFIRM_REPAIR", nil, nil, {reason = "downgrade"}) elseif (WeakAuras.IsLoginFinished() and Private.LoadOptions(msg)) then - WeakAuras.ToggleOptions(msg); + WeakAuras.ToggleOptions(msg, Private); end end @@ -1000,6 +1002,7 @@ end local frame = CreateFrame("FRAME", "WeakAurasFrame", UIParent); WeakAuras.frames["WeakAuras Main Frame"] = frame; frame:SetAllPoints(UIParent); + local loadedFrame = CreateFrame("FRAME"); WeakAuras.frames["Addon Initialization Handler"] = loadedFrame; loadedFrame:RegisterEvent("ADDON_LOADED"); @@ -1493,7 +1496,7 @@ end -- this cache is loaded lazily via pAdd() local UIDtoID = {} -function WeakAuras.GetDataByUID(uid) +function Private.GetDataByUID(uid) return WeakAuras.GetData(UIDtoID[uid]) end @@ -1514,7 +1517,7 @@ function WeakAuras.Delete(data) if parentData.sortHybridTable then parentData.sortHybridTable[id] = nil end - WeakAuras.ClearAuraEnvironment(data.parent); + Private.ClearAuraEnvironment(data.parent); end end @@ -1572,7 +1575,7 @@ function WeakAuras.Delete(data) db.displays[id] = nil; - WeakAuras.DeleteAuraEnvironment(id) + Private.DeleteAuraEnvironment(id) triggerState[id] = nil; if (WeakAuras.mouseFrame) then @@ -1588,6 +1591,8 @@ function WeakAuras.Delete(data) WeakAuras.conditionHelpers[data.uid] = nil WeakAuras.DeleteCollapsedData(id) + + Private.callbacks:Fire("Delete", data.uid) end function WeakAuras.Rename(data, newid) @@ -1641,7 +1646,7 @@ function WeakAuras.Rename(data, newid) triggerState[newid] = triggerState[oldid]; triggerState[oldid] = nil; - WeakAuras.RenameAuraEnvironment(oldid, newid) + Private.RenameAuraEnvironment(oldid, newid) db.displays[newid] = db.displays[oldid]; db.displays[oldid] = nil; @@ -2447,9 +2452,9 @@ local function pAdd(data, simpleChange) WeakAuras.UpdatedTriggerState(id) else if (data.controlledChildren) then - WeakAuras.ClearAuraEnvironment(id); + Private.ClearAuraEnvironment(id); if data.parent then - WeakAuras.ClearAuraEnvironment(data.parent); + Private.ClearAuraEnvironment(data.parent); end db.displays[id] = data; WeakAuras.SetRegion(data); @@ -2465,9 +2470,9 @@ local function pAdd(data, simpleChange) end end - WeakAuras.ClearAuraEnvironment(id); + Private.ClearAuraEnvironment(id); if data.parent then - WeakAuras.ClearAuraEnvironment(data.parent); + Private.ClearAuraEnvironment(data.parent); end db.displays[id] = data; @@ -2883,7 +2888,7 @@ function WeakAuras.HandleGlowAction(actions, region) glow_frame = regions[frame_name].region end else - glow_frame = WeakAuras.GetSanitizedGlobal(actions.glow_frame) + glow_frame = Private.GetSanitizedGlobal(actions.glow_frame) end elseif actions.glow_frame_type == "UNITFRAME" and region.state.unit then glow_frame = WeakAuras.GetUnitFrame(region.state.unit) @@ -2958,12 +2963,9 @@ function WeakAuras.PerformActions(data, when, region) if(actions.do_custom and actions.custom) then local func = Private.customActionsFunctions[data.id][when] if func then - WeakAuras.ActivateAuraEnvironment(region.id, region.cloneId, region.state, region.states); - local ok, ret = pcall(func); - if not ok then - geterrorhandler()(ret) - end - WeakAuras.ActivateAuraEnvironment(nil); + Private.ActivateAuraEnvironment(region.id, region.cloneId, region.state, region.states); + xpcall(func, geterrorhandler()); + Private.ActivateAuraEnvironment(nil); end end @@ -3637,7 +3639,7 @@ end local function evaluateTriggerStateTriggers(id) local result = false; - WeakAuras.ActivateAuraEnvironment(id); + Private.ActivateAuraEnvironment(id); if WeakAuras.IsOptionsOpen() then -- While the options are open ignore the combination function @@ -3660,7 +3662,7 @@ local function evaluateTriggerStateTriggers(id) end end - WeakAuras.ActivateAuraEnvironment(nil); + Private.ActivateAuraEnvironment(nil); return result; end @@ -3815,7 +3817,7 @@ function WeakAuras.RunCustomTextFunc(region, customFunc) return nil end local state = region.state - WeakAuras.ActivateAuraEnvironment(region.id, region.cloneId, region.state, region.states); + Private.ActivateAuraEnvironment(region.id, region.cloneId, region.state, region.states); local progress = WeakAuras.dynamic_texts.p.func(WeakAuras.dynamic_texts.p.get(state), state, 1) local dur = WeakAuras.dynamic_texts.t.func( WeakAuras.dynamic_texts.t.get(state), state, 1) @@ -3842,7 +3844,7 @@ function WeakAuras.RunCustomTextFunc(region, customFunc) table.remove(custom, 1) end - WeakAuras.ActivateAuraEnvironment(nil) + Private.ActivateAuraEnvironment(nil) return custom end @@ -4443,8 +4445,8 @@ local function GetAnchorFrame(data, region, parent) end postponeAnchor(id); else - if (WeakAuras.GetSanitizedGlobal(anchorFrameFrame)) then - return WeakAuras.GetSanitizedGlobal(anchorFrameFrame); + if (Private.GetSanitizedGlobal(anchorFrameFrame)) then + return Private.GetSanitizedGlobal(anchorFrameFrame); end postponeAnchor(id); return parent; @@ -4454,14 +4456,12 @@ local function GetAnchorFrame(data, region, parent) if (anchorFrameType == "CUSTOM" and region.customAnchorFunc) then WeakAuras.StartProfileSystem("custom region anchor") WeakAuras.StartProfileAura(region.id) - WeakAuras.ActivateAuraEnvironment(region.id, region.cloneId, region.state) - local ok, frame = pcall(region.customAnchorFunc) - WeakAuras.ActivateAuraEnvironment() + Private.ActivateAuraEnvironment(region.id, region.cloneId, region.state) + local ok, frame = xpcall(region.customAnchorFunc, geterrorhandler()) + Private.ActivateAuraEnvironment() WeakAuras.StopProfileSystem("custom region anchor") WeakAuras.StopProfileAura(region.id) - if not ok then - geterrorhandler()(frame) - elseif ok and frame then + if ok and frame then return frame elseif WeakAuras.IsOptionsOpen() then return parent diff --git a/WeakAuras/WeakAuras.toc b/WeakAuras/WeakAuras.toc index dacf8f8..7d575c2 100644 --- a/WeakAuras/WeakAuras.toc +++ b/WeakAuras/WeakAuras.toc @@ -1,6 +1,6 @@ ## Interface: 30300 -## Title: WeakAuras 2 -## Author: Mirrored and the WeakAuras Team +## Title: WeakAuras +## Author: The WeakAuras Team ## Version: 2.18.0 ## Notes: A powerful, comprehensive utility for displaying graphics and information based on buffs, debuffs, and other triggers. ## Notes-esES: Potente y completa aplicación que te permitirá mostrar por pantalla múltiples diseños, basados en beneficios, perjuicios y otros activadores. @@ -9,7 +9,7 @@ ## Notes-zhTW: 一個強大且全é¢å¯¦ç”¨çš„顯示圖形和訊æ¯åŸºæ–¼å¢žç›Šï¼Œæ¸›ç›Šå’Œå…¶å®ƒè§¸ç™¼ã€‚ ## X-Category: Interface Enhancements ## Globe-Post: WeakAurasOptions, WeakAurasModelPaths, WeakAurasTemplates -## X-Website: https://www.curseforge.com/wow/addons/weakauras-2 +## X-Website: https://www.curseforge.com/wow/addons/weakauras ## X-Curse-Project-ID: 65387 ## X-WoWI-ID: 24910 ## DefaultState: Enabled @@ -42,6 +42,7 @@ Conditions.lua BuffTrigger.lua BuffTrigger2.lua GenericTrigger.lua +AuraWarnings.lua AuraEnvironment.lua # region support @@ -60,5 +61,5 @@ RegionTypes\Model.lua SubRegionTypes\SubText.lua SubRegionTypes\Border.lua SubRegionTypes\Glow.lua -SubRegionTypes\BarModel.lua SubRegionTypes\Tick.lua +SubRegionTypes\BarModel.lua diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua index b536fc4..5e1053c 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua @@ -1,10 +1,11 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local tinsert, tconcat, tremove, wipe = table.insert, table.concat, table.remove, wipe local select, pairs, next, type, unpack = select, pairs, next, type, unpack local tostring, error = tostring, error -local Type, Version = "WeakAurasDisplayButton", 55 +local Type, Version = "WeakAurasDisplayButton", 56 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end @@ -1507,19 +1508,24 @@ local methods = { -- no addon, or no data, or ignore flag return false, false, nil, nil end, - ["RefreshBT2UpgradeIcon"] = function(self) - if not self.data.controlledChildren and self.data.triggers then - for index, t in ipairs(self.data.triggers) do - if t.trigger and t.trigger.type == "aura" then - self.bt2upgrade:SetScript("OnClick", function() - WeakAuras.PickDisplay(self.data.id, "trigger") - end) - self.bt2upgrade:Show() - return - end - end + ["UpdateWarning"] = function(self) + local icon, title, warningText = OptionsPrivate.Private.AuraWarnings.FormatWarnings(self.data.uid) + if warningText then + self.warning:Show() + self.warning:SetNormalTexture(icon) + self.warning:SetScript("OnEnter", function() + Show_Tooltip( + self.frame, + title, + warningText + ) + end) + self.warning:SetScript("OnClick", function() + WeakAuras.PickDisplay(self.data.id, "information") + end) + else + self.warning:Hide() end - self.bt2upgrade:Hide() end, ["RefreshUpdate"] = function(self, actionFunc) if self.data.parent then @@ -2042,23 +2048,13 @@ local function Constructor() groupUpdate:Hide() end - -- TODO: remove this once legacy aura trigger is removed - local bt2upgrade = CreateFrame("BUTTON", nil, button); - button.bt2upgrade = bt2upgrade - bt2upgrade.func = function() end - bt2upgrade:SetNormalTexture([[Interface\DialogFrame\UI-Dialog-Icon-AlertNew]]) - bt2upgrade:SetWidth(16) - bt2upgrade:SetHeight(16) - bt2upgrade:SetPoint("RIGHT", button, "RIGHT", -60, 0) - bt2upgrade:SetScript("OnEnter", function() - Show_Tooltip( - button, - L["Legacy Aura Trigger"], - L["This aura has legacy aura trigger(s). Convert them to the new system to benefit from enhanced performance and features"] - ) - end) - bt2upgrade:SetScript("OnLeave", Hide_Tooltip) - bt2upgrade:Hide() + local warning = CreateFrame("BUTTON", nil, button); + button.warning = warning + warning:SetWidth(16) + warning:SetHeight(16) + warning:SetPoint("RIGHT", button, "RIGHT", -60, 0) + warning:SetScript("OnLeave", Hide_Tooltip) + warning:Hide() local widget = { frame = button, @@ -2074,7 +2070,7 @@ local function Constructor() background = background, expand = expand, update = update, - bt2upgrade = bt2upgrade, + warning = warning, groupUpdate = groupUpdate, updateLogo = updateLogo, type = Type diff --git a/WeakAurasOptions/BuffTrigger.lua b/WeakAurasOptions/BuffTrigger.lua index 7b0dba0..46076a6 100644 --- a/WeakAurasOptions/BuffTrigger.lua +++ b/WeakAurasOptions/BuffTrigger.lua @@ -59,7 +59,9 @@ end local noop = function() end local function GetBuffTriggerOptions(data, triggernum) - local trigger= data.triggers[triggernum].trigger + local trigger = data.triggers[triggernum].trigger + trigger.names = trigger.names or {} + trigger.spellIds = trigger.spellIds or {} local spellCache = WeakAuras.spellCache; local ValidateNumeric = WeakAuras.ValidateNumeric; local aura_options = { diff --git a/WeakAurasOptions/InformationOptions.lua b/WeakAurasOptions/InformationOptions.lua index 4797c94..6499943 100644 --- a/WeakAurasOptions/InformationOptions.lua +++ b/WeakAurasOptions/InformationOptions.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local L = WeakAuras.L @@ -143,5 +144,28 @@ function WeakAuras.GetInformationOptions(data) end end + -- Show warnings onyl for single selection for now + if not isGroup then + local icon, title, message = OptionsPrivate.Private.AuraWarnings.FormatWarnings(data.uid) + if title and message then + args.warningTitle = { + type = "header", + name = title, + width = WeakAuras.doubleWidth, + order = order, + } + order = order + 1 + + args.warnings = { + type = "description", + name = message, + width = WeakAuras.doubleWidth, + order = order, + fontSize = "medium" + } + order = order + 1 + end + end + return options end diff --git a/WeakAurasOptions/OptionsFrames/FrameChooser.lua b/WeakAurasOptions/OptionsFrames/FrameChooser.lua index ed11346..4cdeaa5 100644 --- a/WeakAurasOptions/OptionsFrames/FrameChooser.lua +++ b/WeakAurasOptions/OptionsFrames/FrameChooser.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... -- Lua APIs local pairs = pairs diff --git a/WeakAurasOptions/OptionsFrames/IconPicker.lua b/WeakAurasOptions/OptionsFrames/IconPicker.lua index 0032ece..f8ee213 100644 --- a/WeakAurasOptions/OptionsFrames/IconPicker.lua +++ b/WeakAurasOptions/OptionsFrames/IconPicker.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... -- Lua APIs local pairs = pairs diff --git a/WeakAurasOptions/OptionsFrames/ImportExport.lua b/WeakAurasOptions/OptionsFrames/ImportExport.lua index f7c4b40..5e93668 100644 --- a/WeakAurasOptions/OptionsFrames/ImportExport.lua +++ b/WeakAurasOptions/OptionsFrames/ImportExport.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... -- Lua APIs local strtrim, strsub = strtrim, strsub diff --git a/WeakAurasOptions/OptionsFrames/ModelPicker.lua b/WeakAurasOptions/OptionsFrames/ModelPicker.lua index c3fee51..e605252 100644 --- a/WeakAurasOptions/OptionsFrames/ModelPicker.lua +++ b/WeakAurasOptions/OptionsFrames/ModelPicker.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... -- Lua APIs local pairs, rad = pairs, rad diff --git a/WeakAurasOptions/OptionsFrames/MoverSizer.lua b/WeakAurasOptions/OptionsFrames/MoverSizer.lua index 0058bcc..a660be2 100644 --- a/WeakAurasOptions/OptionsFrames/MoverSizer.lua +++ b/WeakAurasOptions/OptionsFrames/MoverSizer.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... -- Lua APIs local pairs = pairs diff --git a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua index 795d7ef..7ce1d17 100644 --- a/WeakAurasOptions/OptionsFrames/OptionsFrame.lua +++ b/WeakAurasOptions/OptionsFrames/OptionsFrame.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... -- Lua APIs local tinsert, tremove, wipe = table.insert, table.remove, wipe diff --git a/WeakAurasOptions/OptionsFrames/TextEditor.lua b/WeakAurasOptions/OptionsFrames/TextEditor.lua index a895e5a..2a43a74 100644 --- a/WeakAurasOptions/OptionsFrames/TextEditor.lua +++ b/WeakAurasOptions/OptionsFrames/TextEditor.lua @@ -1,6 +1,5 @@ -if not WeakAuras.IsCorrectVersion() then - return -end +if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... -- Lua APIs local pairs, type, ipairs = pairs, type, ipairs diff --git a/WeakAurasOptions/OptionsFrames/TexturePicker.lua b/WeakAurasOptions/OptionsFrames/TexturePicker.lua index 38b0089..22ee4b5 100644 --- a/WeakAurasOptions/OptionsFrames/TexturePicker.lua +++ b/WeakAurasOptions/OptionsFrames/TexturePicker.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... -- Lua APIs local wipe = wipe diff --git a/WeakAurasOptions/RegionOptions/AuraBar.lua b/WeakAurasOptions/RegionOptions/AuraBar.lua index cdcf90b..78b8223 100644 --- a/WeakAurasOptions/RegionOptions/AuraBar.lua +++ b/WeakAurasOptions/RegionOptions/AuraBar.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local SharedMedia = LibStub("LibSharedMedia-3.0"); local L = WeakAuras.L; diff --git a/WeakAurasOptions/RegionOptions/DynamicGroup.lua b/WeakAurasOptions/RegionOptions/DynamicGroup.lua index 8e2dd5d..67580d7 100644 --- a/WeakAurasOptions/RegionOptions/DynamicGroup.lua +++ b/WeakAurasOptions/RegionOptions/DynamicGroup.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local L = WeakAuras.L @@ -203,21 +204,29 @@ local function createOptions(id, data) bigStep = 3, hidden = function() return data.grow ~= "CIRCLE" and data.grow ~= "COUNTERCIRCLE" end }, + fullCircle = { + type = "toggle", + width = WeakAuras.normalWidth, + name = L["Full Circle"], + order = 7, + hidden = function() return data.grow ~= "CIRCLE" and data.grow ~= "COUNTERCIRCLE" end + }, arcLength = { type = "range", width = WeakAuras.normalWidth, - name = L["Arc Length"], - order = 7, + name = L["Total Angle"], + order = 8, min = 0, max = 360, bigStep = 3, + disabled = function() return data.fullCircle end, hidden = function() return data.grow ~= "CIRCLE" and data.grow ~= "COUNTERCIRCLE" end }, radius = { type = "range", width = WeakAuras.normalWidth, name = L["Radius"], - order = 6, + order = 9, softMin = 0, softMax = 500, bigStep = 1, diff --git a/WeakAurasOptions/RegionOptions/Group.lua b/WeakAurasOptions/RegionOptions/Group.lua index a38b78d..f482d25 100644 --- a/WeakAurasOptions/RegionOptions/Group.lua +++ b/WeakAurasOptions/RegionOptions/Group.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local L = WeakAuras.L; diff --git a/WeakAurasOptions/RegionOptions/Icon.lua b/WeakAurasOptions/RegionOptions/Icon.lua index 23a79f9..647fcd6 100644 --- a/WeakAurasOptions/RegionOptions/Icon.lua +++ b/WeakAurasOptions/RegionOptions/Icon.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local Masque = LibStub("Masque", true) local L = WeakAuras.L diff --git a/WeakAurasOptions/RegionOptions/Model.lua b/WeakAurasOptions/RegionOptions/Model.lua index 054239f..67aee09 100644 --- a/WeakAurasOptions/RegionOptions/Model.lua +++ b/WeakAurasOptions/RegionOptions/Model.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local L = WeakAuras.L; diff --git a/WeakAurasOptions/RegionOptions/ProgressTexture.lua b/WeakAurasOptions/RegionOptions/ProgressTexture.lua index 3897afd..bed13a1 100644 --- a/WeakAurasOptions/RegionOptions/ProgressTexture.lua +++ b/WeakAurasOptions/RegionOptions/ProgressTexture.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local L = WeakAuras.L; @@ -219,25 +220,18 @@ local function createOptions(id, data) bigStep = 0.01, isPercent = true }, - textureWrapMode = { - type = "select", - width = WeakAuras.normalWidth, - name = L["Texture Wrap"], - order = 55.2, - values = WeakAuras.texture_wrap_types - }, slanted = { type = "toggle", width = WeakAuras.normalWidth, name = L["Slanted"], - order = 55.3, + order = 55.2, hidden = function() return data.orientation == "CLOCKWISE" or data.orientation == "ANTICLOCKWISE"; end }, slant = { type = "range", width = WeakAuras.normalWidth, name = L["Slant Amount"], - order = 55.4, + order = 55.3, min = 0, max = 1, bigStep = 0.1, @@ -247,14 +241,14 @@ local function createOptions(id, data) type = "toggle", width = WeakAuras.normalWidth, name = L["Inverse Slant"], - order = 55.5, + order = 55.4, hidden = function() return not data.slanted or data.orientation == "CLOCKWISE" or data.orientation == "ANTICLOCKWISE" end }, slantMode = { type = "select", width = WeakAuras.normalWidth, name = L["Slant Mode"], - order = 55.6, + order = 55.5, hidden = function() return not data.slanted or data.orientation == "CLOCKWISE" or data.orientation == "ANTICLOCKWISE" end, values = WeakAuras.slant_mode }, diff --git a/WeakAurasOptions/RegionOptions/StopMotion.lua b/WeakAurasOptions/RegionOptions/StopMotion.lua index f3d6fce..a6b6a91 100644 --- a/WeakAurasOptions/RegionOptions/StopMotion.lua +++ b/WeakAurasOptions/RegionOptions/StopMotion.lua @@ -1,4 +1,5 @@ local L = WeakAuras.L +local AddonName, OptionsPrivate = ... local texture_types = WeakAuras.StopMotion.texture_types; local texture_data = WeakAuras.StopMotion.texture_data; diff --git a/WeakAurasOptions/RegionOptions/Text.lua b/WeakAurasOptions/RegionOptions/Text.lua index 196c99e..67dfcf1 100644 --- a/WeakAurasOptions/RegionOptions/Text.lua +++ b/WeakAurasOptions/RegionOptions/Text.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local SharedMedia = LibStub("LibSharedMedia-3.0"); local L = WeakAuras.L; diff --git a/WeakAurasOptions/RegionOptions/Texture.lua b/WeakAurasOptions/RegionOptions/Texture.lua index f383fd0..3e8281b 100644 --- a/WeakAurasOptions/RegionOptions/Texture.lua +++ b/WeakAurasOptions/RegionOptions/Texture.lua @@ -1,4 +1,5 @@ if not WeakAuras.IsCorrectVersion() then return end +local AddonName, OptionsPrivate = ... local L = WeakAuras.L diff --git a/WeakAurasOptions/WeakAurasOptions.lua b/WeakAurasOptions/WeakAurasOptions.lua index c9a8e49..24cf715 100644 --- a/WeakAurasOptions/WeakAurasOptions.lua +++ b/WeakAurasOptions/WeakAurasOptions.lua @@ -472,7 +472,22 @@ function WeakAuras.OptionsFrame() end end -function WeakAuras.ToggleOptions(msg) +function WeakAuras.ToggleOptions(msg, Private) + if not Private then + return + end + if not OptionsPrivate.Private then + OptionsPrivate.Private = Private + OptionsPrivate.Private:RegisterCallback("AuraWarningsUpdated", function(event, uid) + local id = WeakAuras.UIDtoID(uid) + if displayButtons[id] then + -- The button does not yet exists if a new aura is created + displayButtons[id]:UpdateWarning() + end + end) + end + + if(frame and frame:IsVisible()) then WeakAuras.HideOptions(); elseif (InCombatLockdown()) then @@ -1148,6 +1163,7 @@ function WeakAuras.EnsureDisplayButton(data) if(displayButtons[id]) then displayButtons[id]:SetData(data); displayButtons[id]:Initialize(); + displayButtons[id]:UpdateWarning() else print("|cFF8800FFWeakAuras|r: Error creating button for", id); end @@ -1246,8 +1262,6 @@ function WeakAuras.UpdateDisplayButton(data) if WeakAurasCompanion and button:IsGroup() then button:RefreshUpdate() end - -- TODO: remove this once legacy aura trigger is removed - button:RefreshBT2UpgradeIcon() end end