from retail

This commit is contained in:
NoM0Re
2025-01-10 14:15:01 +01:00
parent 9e2bffcd20
commit b89c221c34
12 changed files with 113 additions and 69 deletions
@@ -33,6 +33,7 @@ local methods = {
self.texture:SetTexture(texturePath);
self.texture.path = texturePath;
self.texture.name = name;
self.texture:SetSize(120, 120);
end,
["ChangeTexture"] = function(self, r, g, b, a, rotate, discrete_rotation, rotation, mirror, blendMode)
local ulx,uly , llx,lly , urx,ury , lrx,lry;
@@ -107,8 +108,8 @@ local function Constructor()
button:SetHighlightTexture(highlighttexture);
local texture = button:CreateTexture(nil, "OVERLAY");
texture:SetPoint("BOTTOMLEFT", button, 4, 4);
texture:SetPoint("TOPRIGHT", button, -4, -4);
texture:SetPoint("CENTER")
texture:SetSize(120, 120)
button:SetScript("OnEnter", function() Show_Tooltip(button, texture.name, texture.path:gsub("\\", "\n")) end);
button:SetScript("OnLeave", Hide_Tooltip);
+47 -17
View File
@@ -313,13 +313,20 @@ function OptionsPrivate.GetInformationOptions(data)
local sameDebugLog = true
local commonDebugLog
local debugLogDesc = ""
for child in OptionsPrivate.Private.TraverseLeafsOrAura(data) do
local effectiveDebugLog = child.information.debugLog and true or false
debugLogDesc = debugLogDesc .. "|cFFE0E000"..child.id..": |r".. (effectiveDebugLog and "true" or "false") .. "\n"
if commonDebugLog == nil then
commonDebugLog = effectiveDebugLog
elseif effectiveDebugLog ~= commonDebugLog then
sameDebugLog = false
if isGroup and not isTmpGroup then
sameDebugLog = true
commonDebugLog = data.information.debugLog and true or false
else
for child in OptionsPrivate.Private.TraverseLeafsOrAura(data) do
--- @type boolean
local effectiveDebugLog = child.information.debugLog and true or false
debugLogDesc = debugLogDesc .. "|cFFE0E000"..child.id..": |r".. (effectiveDebugLog and "true" or "false") .. "\n"
if commonDebugLog == nil then
commonDebugLog = effectiveDebugLog
elseif effectiveDebugLog ~= commonDebugLog then
sameDebugLog = false
end
end
end
args.debugLogToggle = {
@@ -332,10 +339,15 @@ function OptionsPrivate.GetInformationOptions(data)
return sameDebugLog and commonDebugLog
end,
set = function(info, v)
for child in OptionsPrivate.Private.TraverseLeafsOrAura(data) do
child.information.debugLog = v
WeakAuras.Add(child)
OptionsPrivate.ClearOptions(child.id)
if isGroup and not isTmpGroup then
data.information.debugLog = v
WeakAuras.Add(data)
else
for child in OptionsPrivate.Private.TraverseLeafsOrAura(data) do
child.information.debugLog = v
WeakAuras.Add(child)
OptionsPrivate.ClearOptions(child.id)
end
end
WeakAuras.ClearAndUpdateOptions(data.id)
end
@@ -350,18 +362,32 @@ function OptionsPrivate.GetInformationOptions(data)
func = function()
local fullMessage = L["WeakAuras %s on WoW %s"]:format(WeakAuras.versionString, WeakAuras.BuildInfo) .. "\n\n"
local haveLogs = false
for child in OptionsPrivate.Private.TraverseLeafsOrAura(data) do
local auraLog = OptionsPrivate.Private.DebugLog.GetLogs(child.uid)
if isGroup and not isTmpGroup then
local auraLog = OptionsPrivate.Private.DebugLog.GetLogs(data.uid)
if auraLog then
haveLogs = true
fullMessage = fullMessage .. L["Aura: '%s'"]:format(child.id)
local version = child.semver or child.version
fullMessage = fullMessage .. L["Aura: '%s'"]:format(data.id)
local version = data.semver or data.version
if (version) then
fullMessage = fullMessage .. "\n" .. L["Version: %s"]:format(version)
end
fullMessage = fullMessage .. "\n" .. L["Debug Log:"] .. "\n" .. auraLog .. "\n\n"
end
else
for child in OptionsPrivate.Private.TraverseLeafsOrAura(data) do
local auraLog = OptionsPrivate.Private.DebugLog.GetLogs(child.uid)
if auraLog then
haveLogs = true
fullMessage = fullMessage .. L["Aura: '%s'"]:format(child.id)
local version = child.semver or child.version
if (version) then
fullMessage = fullMessage .. "\n" .. L["Version: %s"]:format(version)
end
fullMessage = fullMessage .. "\n" .. L["Debug Log:"] .. "\n" .. auraLog .. "\n\n"
end
end
end
if haveLogs then
OptionsPrivate.OpenDebugLog(fullMessage)
else
@@ -376,8 +402,12 @@ function OptionsPrivate.GetInformationOptions(data)
width = WeakAuras.normalWidth,
order = order,
func = function()
for child in OptionsPrivate.Private.TraverseLeafsOrAura(data) do
OptionsPrivate.Private.DebugLog.Clear(child.uid)
if isGroup and not isTmpGroup then
OptionsPrivate.Private.DebugLog.Clear(data.uid)
else
for child in OptionsPrivate.Private.TraverseLeafsOrAura(data) do
OptionsPrivate.Private.DebugLog.Clear(child.uid)
end
end
end
}
@@ -51,7 +51,7 @@ function OptionsPrivate.StartFrameChooser(data, path)
focusName = nil;
local focusIsGroup = false;
for id, regionData in pairs(OptionsPrivate.Private.regions) do
if(regionData.region:IsVisible() and MouseIsOver(regionData.region)) then
if(regionData.region and regionData.region:IsVisible() and MouseIsOver(regionData.region)) then
local isGroup = regionData.regionType == "group" or regionData.regionType == "dynamicgroup";
if (not focusName or (not isGroup and focusIsGroup)) then
focus = regionData.region;
@@ -634,7 +634,7 @@ local function ConstructMoverSizer(parent)
data.yOffset = dY / scale
end
region:ResetPosition()
WeakAuras.Add(data, nil, true)
WeakAuras.Add(data)
WeakAuras.UpdateThumbnail(data)
local xOff, yOff
mover.selfPoint, mover.anchor, mover.anchorPoint, xOff, yOff = region:GetPoint(1)
@@ -138,12 +138,14 @@ function OptionsPrivate.CreateFrame()
for id, data in pairs(OptionsPrivate.Private.regions) do
data.region:Collapse()
data.region:OptionsClosed()
if OptionsPrivate.Private.clones[id] then
for _, cloneRegion in pairs(OptionsPrivate.Private.clones[id]) do
cloneRegion:Collapse()
cloneRegion:OptionsClosed()
if data.region then
data.region:Collapse()
data.region:OptionsClosed()
if OptionsPrivate.Private.clones[id] then
for _, cloneRegion in pairs(OptionsPrivate.Private.clones[id]) do
cloneRegion:Collapse()
cloneRegion:OptionsClosed()
end
end
end
end
+8 -10
View File
@@ -182,15 +182,15 @@ local function recurseUpdate(data, chunk)
end
end
local ignoredForDiffChecking -- Needs to be created lazily
local function RecurseDiff(ours, theirs)
local function RecurseDiff(ours, theirs, ignoredForDiffChecking)
local diff, seen, same = {}, {}, true
for key, ourVal in pairs(ours) do
if not ignoredForDiffChecking[key] then
if type(ignoredForDiffChecking) ~= table or ignoredForDiffChecking[key] ~= true then
seen[key] = true
local theirVal = theirs[key]
if type(ourVal) == "table" and type(theirVal) == "table" then
local diffVal = RecurseDiff(ourVal, theirVal)
local diffVal = RecurseDiff(ourVal, theirVal,
type(ignoredForDiffChecking) == table and ignoredForDiffChecking[key] or nil)
if diffVal then
diff[key] = diffVal
same = false
@@ -207,7 +207,7 @@ local function RecurseDiff(ours, theirs)
end
end
for key, theirVal in pairs(theirs) do
if not seen[key] and not ignoredForDiffChecking[key] then
if not seen[key] and (type(ignoredForDiffChecking) ~= table or ignoredForDiffChecking[key] ~= true) then
diff[key] = theirVal
same = false
end
@@ -243,15 +243,13 @@ local function DebugPrintDiff(diff)
end
local function Diff(ours, theirs)
if not ignoredForDiffChecking then
ignoredForDiffChecking = WeakAuras.Mixin({}, OptionsPrivate.Private.internal_fields,
OptionsPrivate.Private.non_transmissable_fields)
end
local ignoredForDiffChecking = WeakAuras.Mixin({}, OptionsPrivate.Private.internal_fields,
OptionsPrivate.Private.non_transmissable_fields)
-- generates a diff which WeakAuras.Update can use
local debug = false
if not ours or not theirs then return end
local diff = RecurseDiff(ours, theirs)
local diff = RecurseDiff(ours, theirs, ignoredForDiffChecking)
if diff then
if debug then
DebugPrintDiff(diff, ours.id, theirs.id)
+1 -1
View File
@@ -906,7 +906,7 @@ function OptionsPrivate.ConvertDisplay(data, newType)
local visibility = displayButtons[id]:GetVisibility();
displayButtons[id]:PriorityHide(2);
if OptionsPrivate.Private.regions[id] then
if OptionsPrivate.Private.regions[id] and OptionsPrivate.Private.regions[id].region then
OptionsPrivate.Private.regions[id].region:Collapse()
end
OptionsPrivate.Private.CollapseAllClones(id);