from retail

This commit is contained in:
NoM0Re
2025-01-19 14:54:14 +01:00
parent dccd22b610
commit 87c681b2f3
10 changed files with 62 additions and 25 deletions
+5 -5
View File
@@ -8,11 +8,11 @@ local debugLogs = {}
local enabled = {} local enabled = {}
Private.DebugLog = { Private.DebugLog = {
-- Print Print = function(uid, text, ...) end,
-- Clear Clear = function(uid) end,
-- SetEnabled SetEnabled = function(uid, enabled) end,
-- IsEnabled IsEnabled = function(uid) end,
-- GetLogs GetLogs = function(uid) end
} }
local function serialize(log, input) local function serialize(log, input)
+18 -3
View File
@@ -311,13 +311,25 @@ local function PrintOneProfile(popup, name, map, total)
end end
local percent = "" local percent = ""
if total then if total then
percent = ", " .. string.format("%.2f", 100 * map.elapsed / total) .. "%" percent = (", %.2f%%"):format(100 * map.elapsed / total)
end end
local spikeInfo = "" local spikeInfo = ""
if map.spike then 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 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 end
local function SortProfileMap(map) local function SortProfileMap(map)
@@ -327,6 +339,9 @@ local function SortProfileMap(map)
end end
sort(result, function(a, b) 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 return map[a].elapsed > map[b].elapsed
end) end)
+2
View File
@@ -43,6 +43,8 @@ local default = {
columnSpace = 1 columnSpace = 1
} }
Private.regionPrototype.AddAlphaToDefault(default);
local controlPointFunctions = { local controlPointFunctions = {
["SetAnchorPoint"] = function(self, point, relativeFrame, relativePoint, offsetX, offsetY) ["SetAnchorPoint"] = function(self, point, relativeFrame, relativePoint, offsetX, offsetY)
self:ClearAllPoints(); self:ClearAllPoints();
+2
View File
@@ -22,6 +22,8 @@ local default = {
scale = 1, scale = 1,
}; };
Private.regionPrototype.AddAlphaToDefault(default);
-- Called when first creating a new region/display -- Called when first creating a new region/display
local function create(parent) local function create(parent)
-- Main region -- Main region
+1 -2
View File
@@ -4,8 +4,7 @@ local AddonName, Private = ...
local WeakAuras = WeakAuras local WeakAuras = WeakAuras
local L = WeakAuras.L local L = WeakAuras.L
local SubscribableObject = local SubscribableObject ={
{
ClearSubscribers = function(self) ClearSubscribers = function(self)
self.events = {} self.events = {}
self.subscribers = {} self.subscribers = {}
+5
View File
@@ -1034,6 +1034,9 @@ do -- Archive stuff
error(string.format(L["Could not load WeakAuras Archive, the addon is %s"], reason)) error(string.format(L["Could not load WeakAuras Archive, the addon is %s"], reason))
end end
end end
if type(WeakAurasArchive) ~= "table" then
WeakAurasArchive = {}
end
Archivist:Initialize(WeakAurasArchive) Archivist:Initialize(WeakAurasArchive)
end end
return Archivist return Archivist
@@ -1164,6 +1167,8 @@ loadedFrame:SetScript("OnEvent", function(self, event, addon)
db.displays = db.displays or {}; db.displays = db.displays or {};
db.registered = db.registered or {}; db.registered = db.registered or {};
db.migrationCutoff = db.migrationCutoff or 730
db.historyCutoff = db.historyCutoff or 730
Private.SyncParentChildRelationships(); Private.SyncParentChildRelationships();
local isFirstUIDValidation = db.dbVersion == nil or db.dbVersion < 26; local isFirstUIDValidation = db.dbVersion == nil or db.dbVersion < 26;
-12
View File
@@ -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)
+1 -3
View File
@@ -2,6 +2,4 @@
## Title: WeakAuras Archive ## Title: WeakAuras Archive
## LoadOnDemand: 1 ## LoadOnDemand: 1
## SavedVariables: WeakAurasArchive ## SavedVariables: WeakAurasArchive
## Dependencies: WeakAuras ## Dependencies: WeakAuras
WeakAurasArchive.lua
@@ -516,6 +516,12 @@ local function createOptions(id, data)
name = L["Animated Expand and Collapse"], name = L["Animated Expand and Collapse"],
order = 27 order = 27
}, },
spacer = {
type = "description",
width = WeakAuras.normalWidth,
name = "",
order = 27.5
},
scale = { scale = {
type = "range", type = "range",
control = "WeakAurasSpinBox", control = "WeakAurasSpinBox",
@@ -539,6 +545,17 @@ local function createOptions(id, data)
OptionsPrivate.ResetMoverSizer(); OptionsPrivate.ResetMoverSizer();
end 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 = { endHeader = {
type = "header", type = "header",
order = 100, order = 100,
+11
View File
@@ -585,6 +585,17 @@ local function createOptions(id, data)
OptionsPrivate.ResetMoverSizer(); OptionsPrivate.ResetMoverSizer();
end 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 = { endHeader = {
type = "header", type = "header",
order = 100, order = 100,