From 945a19716096a6ef90f0813d2dfc17bc7a41f909 Mon Sep 17 00:00:00 2001 From: Sattva Date: Sun, 31 Dec 2023 01:34:29 +0300 Subject: [PATCH] ManageDebuffs - fixes 2nd and another debuffs sizing. --- Changelog and Notes.txt | 4 ---- Leatrix_Plus.lua | 25 +++++++++++++++++++------ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Changelog and Notes.txt b/Changelog and Notes.txt index 78ae71d..61186af 100644 --- a/Changelog and Notes.txt +++ b/Changelog and Notes.txt @@ -8,13 +8,9 @@ Tooltip - FIX center popup when closed the leatrix window, its still staying FlightTimers - fix report window editbox -Manage Quest Tracker (under minimap) - let user move it. - Enhance Minimap - Combine Addon Buttons - make this frame be movable, size-adjustable and make option to make it be hidden by default, but shown when either: mouse is over minimap or user chooses option to middle click minimap to show it. -Manage Debuffs - add - -------------------------------------------------------------------------------- -- What needs to be tested: diff --git a/Leatrix_Plus.lua b/Leatrix_Plus.lua index 2b8e6d0..78dd4ca 100644 --- a/Leatrix_Plus.lua +++ b/Leatrix_Plus.lua @@ -10886,6 +10886,16 @@ --DebuffButton1:SetPoint(LeaPlusLC["DebuffButton1A"], UIParent, LeaPlusLC["DebuffButton1R"], LeaPlusLC["DebuffButton1X"], LeaPlusLC["DebuffButton1Y"]) --DebuffButton1:SetScale(LeaPlusLC["DebuffButton1Scale"]) + -- Function to update scale for all Debuff Buttons + local function UpdateDebuffButtonScales(scale) + for i = 1, DEBUFF_MAX_DISPLAY do + local debuffButton = _G["DebuffButton"..i] + if debuffButton then + debuffButton:SetScale(scale) + end + end + end + -- Create drag frame local dragframe = CreateFrame("FRAME", nil, nil) @@ -10901,7 +10911,8 @@ -- Set buff frame position at startup d:ClearAllPoints() d:SetPoint(LeaPlusLC["DebuffButton1A"], UIParent, LeaPlusLC["DebuffButton1R"], LeaPlusLC["DebuffButton1X"], LeaPlusLC["DebuffButton1Y"]) - d:SetScale(LeaPlusLC["DebuffButton1Scale"]) + --d:SetScale(LeaPlusLC["DebuffButton1Scale"]) + UpdateDebuffButtonScales(LeaPlusLC["DebuffButton1Scale"]) local isDebuffButton1Moving = false local deBuffFrameSetPoint = DebuffButton1.SetPoint @@ -10961,14 +10972,15 @@ end) -- Create configuration panel - local DeBuffPanel = LeaPlusLC:CreatePanel("Manage buffs", "DeBuffPanel") + local DeBuffPanel = LeaPlusLC:CreatePanel("Manage DeBuffs", "DeBuffPanel") LeaPlusLC:MakeTx(DeBuffPanel, "Scale", 16, -72) LeaPlusLC:MakeSL(DeBuffPanel, "DebuffButton1Scale", "Drag to set the buffs frame scale.", 0.5, 2, 0.05, 16, -92, "%.2f") -- Set scale when slider is changed LeaPlusCB["DebuffButton1Scale"]:HookScript("OnValueChanged", function() - DebuffButton1:SetScale(LeaPlusLC["DebuffButton1Scale"]) + UpdateDebuffButtonScales(LeaPlusLC["DebuffButton1Scale"]) + --DebuffButton1:SetScale(LeaPlusLC["DebuffButton1Scale"]) dragframe:SetScale(LeaPlusLC["DebuffButton1Scale"]) -- Show formatted slider value LeaPlusCB["DebuffButton1Scale"].f:SetFormattedText("%.0f%%", LeaPlusLC["DebuffButton1Scale"] * 100) @@ -11006,7 +11018,7 @@ LeaPlusLC["DebuffButton1A"] = "TOPRIGHT" LeaPlusLC["DebuffButton1R"] = "TOPRIGHT" LeaPlusLC["DebuffButton1X"] = -205 - LeaPlusLC["DebuffButton1Y"] = -13 + LeaPlusLC["DebuffButton1Y"] = -205 LeaPlusLC["DebuffButton1Scale"] = 1 DebuffButton1:ClearAllPoints() DebuffButton1:SetPoint(LeaPlusLC["DebuffButton1A"], UIParent, LeaPlusLC["DebuffButton1R"], LeaPlusLC["DebuffButton1X"], LeaPlusLC["DebuffButton1Y"]) @@ -11027,11 +11039,12 @@ LeaPlusLC["DebuffButton1A"] = "TOPRIGHT" LeaPlusLC["DebuffButton1R"] = "TOPRIGHT" LeaPlusLC["DebuffButton1X"] = -271 - LeaPlusLC["DebuffButton1Y"] = 0 + LeaPlusLC["DebuffButton1Y"] = -205 LeaPlusLC["DebuffButton1Scale"] = 0.80 DebuffButton1:ClearAllPoints() DebuffButton1:SetPoint(LeaPlusLC["DebuffButton1A"], UIParent, LeaPlusLC["DebuffButton1R"], LeaPlusLC["DebuffButton1X"], LeaPlusLC["DebuffButton1Y"]) - DebuffButton1:SetScale(LeaPlusLC["DebuffButton1Scale"]) + --DebuffButton1:SetScale(LeaPlusLC["DebuffButton1Scale"]) + UpdateDebuffButtonScales(LeaPlusLC["DebuffButton1Scale"]) else -- Find out if the UI has a non-standard scale if GetCVar("useuiscale") == "1" then