diff --git a/WeakAuras/DebugLog.lua b/WeakAuras/DebugLog.lua index a90e063..5af1933 100644 --- a/WeakAuras/DebugLog.lua +++ b/WeakAuras/DebugLog.lua @@ -8,11 +8,11 @@ local debugLogs = {} local enabled = {} Private.DebugLog = { - -- Print - -- Clear - -- SetEnabled - -- IsEnabled - -- GetLogs + Print = function(uid, text, ...) end, + Clear = function(uid) end, + SetEnabled = function(uid, enabled) end, + IsEnabled = function(uid) end, + GetLogs = function(uid) end } local function serialize(log, input) diff --git a/WeakAuras/Profiling.lua b/WeakAuras/Profiling.lua index 150588f..649597b 100644 --- a/WeakAuras/Profiling.lua +++ b/WeakAuras/Profiling.lua @@ -311,13 +311,25 @@ local function PrintOneProfile(popup, name, map, total) end local percent = "" if total then - percent = ", " .. string.format("%.2f", 100 * map.elapsed / total) .. "%" + percent = (", %.2f%%"):format(100 * map.elapsed / total) end + local spikeInfo = "" if map.spike then - spikeInfo = string.format("(%.2fms)", map.spike) + local r, g, b + if map.spike < 2 then + r, g, b = WeakAuras.GetHSVTransition(map.spike / 2, 0, 1, 0, 1, 1, 1, 0, 1) + elseif map.spike < 2.5 then + r, g, b = WeakAuras.GetHSVTransition((map.spike - 2) * 2, 1, 1, 0, 1, 1, 0.65, 0, 1) + elseif map.spike < 3 then + r, g, b = WeakAuras.GetHSVTransition((map.spike - 2.5) * 2, 1, 0.65, 0, 1, 1, 0, 0, 1) + else + r, g, b = 1, 0, 0 + end + spikeInfo = ("|cff%02x%02x%02x(%.2fms)|r"):format(r * 255, g * 255, b * 255, map.spike) end - popup:AddText(string.format("%s |cff999999%.2fms%s %s|r", name, map.elapsed, percent, spikeInfo)) + + popup:AddText(("%s |cff999999%.2fms%s %s|r"):format(name, map.elapsed, percent, spikeInfo)) end local function SortProfileMap(map) @@ -327,6 +339,9 @@ local function SortProfileMap(map) end sort(result, function(a, b) + if map[a].spike and map[b].spike then + return map[a].spike > map[b].spike + end return map[a].elapsed > map[b].elapsed end) diff --git a/WeakAuras/RegionTypes/DynamicGroup.lua b/WeakAuras/RegionTypes/DynamicGroup.lua index 961752b..3e66f6b 100644 --- a/WeakAuras/RegionTypes/DynamicGroup.lua +++ b/WeakAuras/RegionTypes/DynamicGroup.lua @@ -43,6 +43,8 @@ local default = { columnSpace = 1 } +Private.regionPrototype.AddAlphaToDefault(default); + local controlPointFunctions = { ["SetAnchorPoint"] = function(self, point, relativeFrame, relativePoint, offsetX, offsetY) self:ClearAllPoints(); diff --git a/WeakAuras/RegionTypes/Group.lua b/WeakAuras/RegionTypes/Group.lua index 2fc0738..ae79799 100644 --- a/WeakAuras/RegionTypes/Group.lua +++ b/WeakAuras/RegionTypes/Group.lua @@ -22,6 +22,8 @@ local default = { scale = 1, }; +Private.regionPrototype.AddAlphaToDefault(default); + -- Called when first creating a new region/display local function create(parent) -- Main region diff --git a/WeakAuras/SubscribableObject.lua b/WeakAuras/SubscribableObject.lua index c677286..614e334 100644 --- a/WeakAuras/SubscribableObject.lua +++ b/WeakAuras/SubscribableObject.lua @@ -4,8 +4,7 @@ local AddonName, Private = ... local WeakAuras = WeakAuras local L = WeakAuras.L -local SubscribableObject = -{ +local SubscribableObject ={ ClearSubscribers = function(self) self.events = {} self.subscribers = {} diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 5a28e13..ffb6d92 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -1034,6 +1034,9 @@ do -- Archive stuff error(string.format(L["Could not load WeakAuras Archive, the addon is %s"], reason)) end end + if type(WeakAurasArchive) ~= "table" then + WeakAurasArchive = {} + end Archivist:Initialize(WeakAurasArchive) end return Archivist @@ -1164,6 +1167,8 @@ loadedFrame:SetScript("OnEvent", function(self, event, addon) db.displays = db.displays or {}; db.registered = db.registered or {}; + db.migrationCutoff = db.migrationCutoff or 730 + db.historyCutoff = db.historyCutoff or 730 Private.SyncParentChildRelationships(); local isFirstUIDValidation = db.dbVersion == nil or db.dbVersion < 26; diff --git a/WeakAurasArchive/WeakAurasArchive.lua b/WeakAurasArchive/WeakAurasArchive.lua deleted file mode 100644 index 2d26ee0..0000000 --- a/WeakAurasArchive/WeakAurasArchive.lua +++ /dev/null @@ -1,12 +0,0 @@ --- all this is is a frame that ensures that the SV is a table type -local addonName = ... -local loader = CreateFrame("FRAME") -loader:RegisterEvent("ADDON_LOADED") -loader:SetScript("OnEvent", function(self, _, addon) - if addon == addonName then - if type(WeakAurasArchive) ~= "table" then - WeakAurasArchive = {} - end - self:UnregisterEvent("ADDON_LOADED") - end -end) diff --git a/WeakAurasArchive/WeakAurasArchive.toc b/WeakAurasArchive/WeakAurasArchive.toc index 76d38d2..40f81e2 100644 --- a/WeakAurasArchive/WeakAurasArchive.toc +++ b/WeakAurasArchive/WeakAurasArchive.toc @@ -2,6 +2,4 @@ ## Title: WeakAuras Archive ## LoadOnDemand: 1 ## SavedVariables: WeakAurasArchive -## Dependencies: WeakAuras - -WeakAurasArchive.lua +## Dependencies: WeakAuras \ No newline at end of file diff --git a/WeakAurasOptions/RegionOptions/DynamicGroup.lua b/WeakAurasOptions/RegionOptions/DynamicGroup.lua index d93dcdc..63dd083 100644 --- a/WeakAurasOptions/RegionOptions/DynamicGroup.lua +++ b/WeakAurasOptions/RegionOptions/DynamicGroup.lua @@ -516,6 +516,12 @@ local function createOptions(id, data) name = L["Animated Expand and Collapse"], order = 27 }, + spacer = { + type = "description", + width = WeakAuras.normalWidth, + name = "", + order = 27.5 + }, scale = { type = "range", control = "WeakAurasSpinBox", @@ -539,6 +545,17 @@ local function createOptions(id, data) OptionsPrivate.ResetMoverSizer(); end }, + alpha = { + type = "range", + control = "WeakAurasSpinBox", + width = WeakAuras.normalWidth, + name = L["Group Alpha"], + order = 29, + min = 0, + max = 1, + bigStep = 0.01, + isPercent = true + }, endHeader = { type = "header", order = 100, diff --git a/WeakAurasOptions/RegionOptions/Group.lua b/WeakAurasOptions/RegionOptions/Group.lua index 525f88b..d581c51 100644 --- a/WeakAurasOptions/RegionOptions/Group.lua +++ b/WeakAurasOptions/RegionOptions/Group.lua @@ -585,6 +585,17 @@ local function createOptions(id, data) OptionsPrivate.ResetMoverSizer(); end }, + alpha = { + type = "range", + control = "WeakAurasSpinBox", + width = WeakAuras.normalWidth, + name = L["Group Alpha"], + order = 46, + min = 0, + max = 1, + bigStep = 0.01, + isPercent = true + }, endHeader = { type = "header", order = 100,