From b831fb40093a731e285830993e2773cdb30c7f5f Mon Sep 17 00:00:00 2001 From: NoM0Re Date: Fri, 24 Jan 2025 20:50:23 +0100 Subject: [PATCH] from retail --- WeakAuras/RegionTypes/AuraBar.lua | 2 ++ WeakAuras/RegionTypes/Icon.lua | 2 ++ WeakAuras/RegionTypes/ProgressTexture.lua | 2 ++ WeakAuras/RegionTypes/StopMotion.lua | 2 ++ WeakAuras/WeakAuras.lua | 11 ++++++++++- WeakAurasOptions/CommonOptions.lua | 18 ++++++++++++++++-- 6 files changed, 34 insertions(+), 3 deletions(-) diff --git a/WeakAuras/RegionTypes/AuraBar.lua b/WeakAuras/RegionTypes/AuraBar.lua index 725896b..50de218 100644 --- a/WeakAuras/RegionTypes/AuraBar.lua +++ b/WeakAuras/RegionTypes/AuraBar.lua @@ -10,6 +10,8 @@ local default = { desaturate = false, iconSource = -1, progressSource = {-1, "" }, + adjustedMax = "", + adjustedMin = "", texture = "Blizzard", textureSource = "LSM", width = 200, diff --git a/WeakAuras/RegionTypes/Icon.lua b/WeakAuras/RegionTypes/Icon.lua index 34b3b12..24cd933 100644 --- a/WeakAuras/RegionTypes/Icon.lua +++ b/WeakAuras/RegionTypes/Icon.lua @@ -20,6 +20,8 @@ local default = { desaturate = false, iconSource = -1, progressSource = {-1, "" }, + adjustedMax = "", + adjustedMin = "", inverse = false, width = 64, height = 64, diff --git a/WeakAuras/RegionTypes/ProgressTexture.lua b/WeakAuras/RegionTypes/ProgressTexture.lua index 196f184..f22d671 100644 --- a/WeakAuras/RegionTypes/ProgressTexture.lua +++ b/WeakAuras/RegionTypes/ProgressTexture.lua @@ -81,6 +81,8 @@ end local default = { progressSource = {-1, "" }, + adjustedMax = "", + adjustedMin = "", foregroundTexture = "Interface\\Addons\\WeakAuras\\PowerAurasMedia\\Auras\\Aura3", backgroundTexture = "Interface\\Addons\\WeakAuras\\PowerAurasMedia\\Auras\\Aura3", desaturateBackground = false, diff --git a/WeakAuras/RegionTypes/StopMotion.lua b/WeakAuras/RegionTypes/StopMotion.lua index df1e60c..13d435b 100644 --- a/WeakAuras/RegionTypes/StopMotion.lua +++ b/WeakAuras/RegionTypes/StopMotion.lua @@ -6,6 +6,8 @@ local L = WeakAuras.L; local default = { progressSource = {-1, "" }, + adjustedMax = "", + adjustedMin = "", foregroundTexture = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\StopMotion", backgroundTexture = "Interface\\AddOns\\WeakAuras\\Media\\Textures\\StopMotion", desaturateBackground = false, diff --git a/WeakAuras/WeakAuras.lua b/WeakAuras/WeakAuras.lua index 613d6dd..83ad10d 100644 --- a/WeakAuras/WeakAuras.lua +++ b/WeakAuras/WeakAuras.lua @@ -3104,7 +3104,7 @@ do if type(glow_frame_monitor) == "table" then for region, data in pairs(glow_frame_monitor) do - if region.state and region.state.unit == unit + if region.state and UnitIsUnit(region.state.unit, unit) and (data.frame ~= frame) == update_frame then if not new_frame then @@ -3879,6 +3879,15 @@ do end end end); + dynFrame.frame:RegisterEvent("PLAYER_REGEN_ENABLED") + dynFrame.frame:RegisterEvent("PLAYER_REGEN_DISABLED") + dynFrame.frame:SetScript("OnEvent", function(self, event) + if event == "PLAYER_REGEN_ENABLED" and self:IsShown() then + self:Hide() + elseif event == "PLAYER_REGEN_DISABLED" and not self:IsShown() and dynFrame.size > 0 then + self:Show() + end + end) end Private.dynFrame = dynFrame; diff --git a/WeakAurasOptions/CommonOptions.lua b/WeakAurasOptions/CommonOptions.lua index cb59f9d..6997445 100644 --- a/WeakAurasOptions/CommonOptions.lua +++ b/WeakAurasOptions/CommonOptions.lua @@ -1135,7 +1135,14 @@ local function ProgressOptions(data) width = WeakAuras.normalWidth, name = L["Set Minimum Progress"], desc = L["Values/Remaining Time below this value are displayed as zero progress."], - order = order + 1 + order = order + 1, + set = function(info, value) + data.useAdjustededMin = value + if not value then + data.adjustedMin = "" + end + WeakAuras.Add(data) + end }; options.adjustedMin = { @@ -1161,7 +1168,14 @@ local function ProgressOptions(data) width = WeakAuras.normalWidth, name = L["Set Maximum Progress"], desc = L["Values/Remaining Time above this value are displayed as full progress."], - order = order + 4 + order = order + 4, + set = function(info, value) + data.useAdjustededMax = value + if not value then + data.adjustedMax = "" + end + WeakAuras.Add(data) + end } options.adjustedMax = {