From 436041dd928809710f223f7e3ee51a8b5c9ff4f5 Mon Sep 17 00:00:00 2001 From: NoM0Re Date: Thu, 13 Feb 2025 18:59:41 +0100 Subject: [PATCH] from retail diffchecked --- .../AceGUIContainer-WeakAurasTreeGroup.lua | 2 +- .../AceGUIWidget-WeakAurasDisplayButton.lua | 10 ++++--- ...UIWidget-WeakAurasDropDownItemCurrency.lua | 27 +++++++++++++++---- .../AceGUIWidget-WeakAurasExpandSmall.lua | 2 +- ...AceGUIWidget-WeakAurasMultiLineEditBox.lua | 4 ++- .../AceGUIWidget-WeakAurasNewButton.lua | 2 +- .../AceGUIWidget-WeakAurasSnippetButton.lua | 3 +-- .../AceGUIWidget-WeakAurasSpacer.lua | 3 +-- .../AceGUIWidget-WeakAurasSpinBox.lua | 2 +- .../AceGUIWidget-WeakAurasToolbarButton.lua | 5 ++-- 10 files changed, 39 insertions(+), 21 deletions(-) diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIContainer-WeakAurasTreeGroup.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIContainer-WeakAurasTreeGroup.lua index bb9ff11..00a640f 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIContainer-WeakAurasTreeGroup.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIContainer-WeakAurasTreeGroup.lua @@ -574,7 +574,7 @@ local methods = { if maxtreewidth > 100 and status.treewidth > maxtreewidth then self:SetTreeWidth(maxtreewidth, status.treesizable) end - treeframe:SetMaxResize(maxtreewidth, 1600) + -- treeframe:SetMaxResize(maxtreewidth, 1600) end, ["OnHeightSet"] = function(self, height) diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua index f6ba80b..e527b4e 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDisplayButton.lua @@ -1,7 +1,7 @@ if not WeakAuras.IsLibsOK() then return end local AddonName, OptionsPrivate = ... -local tinsert, tremove, wipe = table.insert, table.remove, wipe +local tinsert, tremove = table.insert, table.remove local select, pairs, type, unpack = select, pairs, type, unpack local error = error @@ -1139,12 +1139,12 @@ local methods = { -- mark as being dragged, attach to mouse and raise frame strata self.dragging = true self.frame:StartMoving() - --self.frame:ClearAllPoints() + self.frame:ClearAllPoints() self.frame.temp = { parent = self.frame:GetParent(), strata = self.frame:GetFrameStrata(), } - --self.frame:SetParent(UIParent) + self.frame:SetParent(UIParent) self.frame:SetFrameStrata("FULLSCREEN_DIALOG") if self.data.id == mainAura.id then self.frame:SetPoint("Center", UIParent, "BOTTOMLEFT", (x+w/2)*scale/uiscale, y/uiscale) @@ -1916,7 +1916,9 @@ local function Constructor() downgrouptexture:SetAllPoints(downgroup); downgroup:SetNormalTexture(downgrouptexture); downgroup:SetHighlightTexture("Interface\\BUTTONS\\UI-Panel-MinimizeButton-Highlight.blp"); - downgroup:SetScript("OnEnter", function() Show_Tooltip(button, L["Move Down"], L["Move this display down in its group's order"]) end); + downgroup:SetScript("OnEnter", function() + Show_Tooltip(button, L["Move Down"], L["Move this display down in its group's order"]) + end) downgroup:SetScript("OnLeave", Hide_Tooltip); downgroup:Hide(); diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDropDownItemCurrency.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDropDownItemCurrency.lua index 6eced1a..83becb2 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDropDownItemCurrency.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasDropDownItemCurrency.lua @@ -50,15 +50,29 @@ local function Frame_OnShow(self) if isHeader then self:SetScript("OnClick", nil) self.obj.text:SetTextColor(1, 1, 0) - self.obj.text:SetPoint("TOPLEFT", self, "TOPLEFT", 7, 0) - self.obj.icon:Hide() self.obj.useHighlight = false + + self.obj.text:ClearAllPoints() + self.obj.text:SetPoint("TOPLEFT", self, "TOPLEFT", 7, 0) + self.obj.text:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -8, 0) + self.obj.icon:Hide() else self:SetScript("OnClick", Frame_OnClick) self.obj.text:SetTextColor(1, 1, 1) - self.obj.text:SetPoint("TOPLEFT", self, "TOPLEFT", 34, 0) - self.obj.icon:Show() self.obj.useHighlight = true + + if self.obj.hasIcon then + self.obj.icon:Show() + self.obj.text:ClearAllPoints() + self.obj.text:SetPoint("TOPLEFT", self, "TOPLEFT", 34, 0) + self.obj.text:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -8, 0) + else + self.obj.icon:Hide() + self.obj.text:ClearAllPoints() + self.obj.text:SetPoint("TOPLEFT", self, "TOPLEFT", 18, 0) + self.obj.text:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -8, 0) + end + end UpdateToggle(self.obj) end @@ -77,14 +91,17 @@ end local function SetText(self, text) text = text or "" local pos = text:find("|t", 1, true) + if pos then ItemBase.SetText(self, text:sub(pos + 2)) local firstColon = text:find(":", 1, true) local icon = text:sub(3, firstColon - 1) self.icon:SetTexture(icon) + self.hasIcon = true else ItemBase.SetText(self, text) + self.hasIcon = false end self.fullText = text end @@ -93,7 +110,7 @@ end local function Constructor() local self = ItemBase.Create(widgetType) - self.text:SetPoint("TOPLEFT", self.frame, "TOPLEFT", 34) + self.text:SetPoint("TOPLEFT", self.frame, "TOPLEFT", 34, 0) self.icon = self.frame:CreateTexture(nil, "OVERLAY") self.icon:SetPoint("TOPLEFT", self.frame, "TOPLEFT", 18, -2) diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasExpandSmall.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasExpandSmall.lua index ced766b..334c1e7 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasExpandSmall.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasExpandSmall.lua @@ -4,7 +4,7 @@ Button Widget for our Expand button if not WeakAuras.IsLibsOK() then return end local AddonName, OptionsPrivate = ... -local Type, Version = "WeakAurasExpandSmall", 3 +local Type, Version = "WeakAurasExpandSmall", 4 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasMultiLineEditBox.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasMultiLineEditBox.lua index 4223c92..0c57b16 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasMultiLineEditBox.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasMultiLineEditBox.lua @@ -79,6 +79,7 @@ local function OnEditFocusLost(frame) frame:HighlightText(0, 0) self:Fire("OnEditFocusLost") self.scrollFrame:EnableMouseWheel(false); + local option = self.userdata.option if option and option.callbacks and option.callbacks.OnEditFocusLost then option.callbacks.OnEditFocusLost(self) @@ -337,7 +338,8 @@ local function Constructor() scrollBG:SetBackdropColor(0, 0, 0) scrollBG:SetBackdropBorderColor(0.4, 0.4, 0.4) - local scrollFrame = CreateFrame("ScrollFrame", ("%s%dScrollFrame"):format(Type, widgetNum), frame, "UIPanelScrollFrameTemplate") + local scrollFrame = CreateFrame("ScrollFrame", ("%s%dScrollFrame"):format(Type, widgetNum), + frame, "UIPanelScrollFrameTemplate") scrollFrame:EnableMouseWheel(false); local scrollBar = _G[scrollFrame:GetName() .. "ScrollBar"] diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasNewButton.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasNewButton.lua index a017d03..9d762b7 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasNewButton.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasNewButton.lua @@ -1,7 +1,7 @@ if not WeakAuras.IsLibsOK() then return end local AddonName, OptionsPrivate = ... -local Type, Version = "WeakAurasNewButton", 25 +local Type, Version = "WeakAurasNewButton", 27 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasSnippetButton.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasSnippetButton.lua index 45ee972..ccc9601 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasSnippetButton.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasSnippetButton.lua @@ -1,9 +1,8 @@ +if not WeakAuras.IsLibsOK() then return end --[[----------------------------------------------------------------------------- SnippetButton Widget, based on AceGUI Button (and WA ToolbarButton) Graphical Button. -------------------------------------------------------------------------------]] -if not WeakAuras.IsLibsOK() then return end - local Type, Version = "WeakAurasSnippetButton", 3 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasSpacer.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasSpacer.lua index 031522c..769b2eb 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasSpacer.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasSpacer.lua @@ -1,9 +1,8 @@ +if not WeakAuras.IsLibsOK() then return end --[[----------------------------------------------------------------------------- Spacer Widget Just uses up a bit of horizontal space -------------------------------------------------------------------------------]] -if not WeakAuras.IsLibsOK() then return end - local Type, Version = "WeakAurasSpacer", 2 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasSpinBox.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasSpinBox.lua index 92e119a..a8173b7 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasSpinBox.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasSpinBox.lua @@ -362,8 +362,8 @@ local function Constructor() progressBar = progressBar, progressBarHandle = progressBarHandle, progressBarHandleTexture = progressBarHandleTexture, - type = Type, frame = frame, + type = Type, } for method, func in pairs(methods) do widget[method] = func diff --git a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasToolbarButton.lua b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasToolbarButton.lua index 11c8c55..7a7ba35 100644 --- a/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasToolbarButton.lua +++ b/WeakAurasOptions/AceGUI-Widgets/AceGUIWidget-WeakAurasToolbarButton.lua @@ -1,9 +1,8 @@ +if not WeakAuras.IsLibsOK() then return end --[[----------------------------------------------------------------------------- ToolbarButton Widget, based on AceGUI Button Graphical Button. -------------------------------------------------------------------------------]] -if not WeakAuras.IsLibsOK() then return end - local Type, Version = "WeakAurasToolbarButton", 6 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end @@ -58,7 +57,7 @@ local methods = { ["SetText"] = function(self, text) self.text:SetText(text) if text ~= "" then - self:SetWidth(self.text:GetStringWidth() + 28) + self:SetWidth(self.text:GetStringWidth() + 24) else self:SetWidth(16) end