From f85bfa39ddb54f392353e2ccf50cc38aee2726d6 Mon Sep 17 00:00:00 2001 From: bitdruid Date: Sun, 25 Jan 2026 12:23:19 +0100 Subject: [PATCH 1/2] out-of-combat-fading --- .gitignore | 44 + Core/Config/GUI.lua | 2060 +++++++++++++++++++++++++++++++++++-------- Core/Core.lua | 21 +- Core/Defaults.lua | 580 ++++++------ Core/Globals.lua | 147 ++- 5 files changed, 2163 insertions(+), 689 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9a86f24 --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +# Compiled Lua sources +luac.out + +# luarocks build files +*.src.rock +*.zip +*.tar.gz + +# Object files +*.o +*.os +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo +*.def +*.exp + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + +# custom +*.vscode + diff --git a/Core/Config/GUI.lua b/Core/Config/GUI.lua index b0f448d..39a1396 100755 --- a/Core/Config/GUI.lua +++ b/Core/Config/GUI.lua @@ -14,7 +14,8 @@ local function SaveSubTab(unit, tabName, subTabValue) end local function GetSavedSubTab(unit, tabName, defaultValue) - return lastSelectedUnitTabs[unit] and lastSelectedUnitTabs[unit].subTabs and lastSelectedUnitTabs[unit].subTabs[tabName] or defaultValue + return lastSelectedUnitTabs[unit] and lastSelectedUnitTabs[unit].subTabs and + lastSelectedUnitTabs[unit].subTabs[tabName] or defaultValue end local function GetSavedMainTab(unit, defaultValue) @@ -32,7 +33,7 @@ local UnitDBToUnitPrettyName = { } local AnchorPoints = { { ["TOPLEFT"] = "Top Left", ["TOP"] = "Top", ["TOPRIGHT"] = "Top Right", ["LEFT"] = "Left", ["CENTER"] = "Center", ["RIGHT"] = "Right", ["BOTTOMLEFT"] = "Bottom Left", ["BOTTOM"] = "Bottom", ["BOTTOMRIGHT"] = "Bottom Right" }, { "TOPLEFT", "TOP", "TOPRIGHT", "LEFT", "CENTER", "RIGHT", "BOTTOMLEFT", "BOTTOM", "BOTTOMRIGHT", } } -local FrameStrataList = {{ ["BACKGROUND"] = "Background", ["LOW"] = "Low", ["MEDIUM"] = "Medium", ["HIGH"] = "High", ["DIALOG"] = "Dialog", ["FULLSCREEN"] = "Fullscreen", ["FULLSCREEN_DIALOG"] = "Fullscreen Dialog", ["TOOLTIP"] = "Tooltip" }, { "BACKGROUND", "LOW", "MEDIUM", "HIGH", "DIALOG", "FULLSCREEN", "FULLSCREEN_DIALOG", "TOOLTIP" }} +local FrameStrataList = { { ["BACKGROUND"] = "Background", ["LOW"] = "Low", ["MEDIUM"] = "Medium", ["HIGH"] = "High", ["DIALOG"] = "Dialog", ["FULLSCREEN"] = "Fullscreen", ["FULLSCREEN_DIALOG"] = "Fullscreen Dialog", ["TOOLTIP"] = "Tooltip" }, { "BACKGROUND", "LOW", "MEDIUM", "HIGH", "DIALOG", "FULLSCREEN", "FULLSCREEN_DIALOG", "TOOLTIP" } } local Power = { [0] = "Mana", @@ -135,26 +136,33 @@ end local function GenerateSupportText(parentFrame) local SupportOptions = { - -- "Support Me on |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:13:18|t |cFF8080FFKo-Fi|r!", - -- "Support Me on |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:14:14|t |cFF8080FFPatreon|r!", - -- "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:20:18|t |cFF8080FFPayPal Donations|r are appreciated!", + "Support Me on |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:13:18|t |cFF8080FFKo-Fi|r!", + "Support Me on |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:14:14|t |cFF8080FFPatreon|r!", + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:20:18|t |cFF8080FFPayPal Donations|r are appreciated!", "Join the |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:18:18|t |cFF8080FFDiscord|r Community!", "Report Issues / Feedback on |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\GitHub.png:18:18|t |cFF8080FFGitHub|r!", "Follow Me on |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:18:14|t |cFF8080FFTwitch|r!", - "|cFF8080FFSupport|r is truly appreciated |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Emotes\\peepoLove.png:18:18|t " .. "|cFF8080FFDevelopment|r takes time & effort." + "|cFF8080FFSupport|r is truly appreciated |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Emotes\\peepoLove.png:18:18|t " .. + "|cFF8080FFDevelopment|r takes time & effort." } parentFrame.statustext:SetText(SupportOptions[math.random(1, #SupportOptions)]) end local function CreateUIScaleSettings(containerParent) local Container = GUIWidgets.CreateInlineGroup(containerParent, "UI Scale") - GUIWidgets.CreateInformationTag(Container,"These options allow you to adjust the UI Scale beyond the means that |cFF00B0F7Blizzard|r provides. If you encounter issues, please |cFFFF4040disable|r this feature.") + GUIWidgets.CreateInformationTag(Container, + "These options allow you to adjust the UI Scale beyond the means that |cFF00B0F7Blizzard|r provides. If you encounter issues, please |cFFFF4040disable|r this feature.") local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable UI Scale") Toggle:SetValue(UUF.db.profile.General.UIScale.Enabled) Toggle:SetFullWidth(true) - Toggle:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.UIScale.Enabled = value UUF:SetUIScale() GUIWidgets.DeepDisable(Container, not value, Toggle) end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db.profile.General.UIScale.Enabled = value + UUF:SetUIScale() + GUIWidgets.DeepDisable(Container, not value, Toggle) + end) Toggle:SetRelativeWidth(0.5) Container:AddChild(Toggle) @@ -163,7 +171,11 @@ local function CreateUIScaleSettings(containerParent) Slider:SetValue(UUF.db.profile.General.UIScale.Scale) Slider:SetSliderValues(0.3, 1.5, 0.01) Slider:SetFullWidth(true) - Slider:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.UIScale.Scale = value UUF:SetUIScale() end) + Slider:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db.profile.General.UIScale.Scale = value + UUF:SetUIScale() + end) Slider:SetRelativeWidth(0.5) Container:AddChild(Slider) @@ -172,24 +184,55 @@ local function CreateUIScaleSettings(containerParent) local PixelPerfectButton = AG:Create("Button") PixelPerfectButton:SetText("Pixel Perfect Scale") PixelPerfectButton:SetRelativeWidth(0.33) - PixelPerfectButton:SetCallback("OnClick", function() local pixelScale = UUF:GetPixelPerfectScale() UUF.db.profile.General.UIScale.Scale = pixelScale UUF:SetUIScale() Slider:SetValue(pixelScale) end) - PixelPerfectButton:SetCallback("OnEnter", function() GameTooltip:SetOwner(PixelPerfectButton.frame, "ANCHOR_CURSOR") GameTooltip:AddLine("Recommended UI Scale: |cFF8080FF" .. UUF:GetPixelPerfectScale() .. "|r", 1, 1, 1, false) GameTooltip:Show() end) + PixelPerfectButton:SetCallback("OnClick", + function() + local pixelScale = UUF:GetPixelPerfectScale() + UUF.db.profile.General.UIScale.Scale = pixelScale + UUF:SetUIScale() + Slider:SetValue(pixelScale) + end) + PixelPerfectButton:SetCallback("OnEnter", + function() + GameTooltip:SetOwner(PixelPerfectButton.frame, "ANCHOR_CURSOR") + GameTooltip:AddLine("Recommended UI Scale: |cFF8080FF" .. UUF:GetPixelPerfectScale() .. "|r", 1, 1, 1, false) + GameTooltip:Show() + end) PixelPerfectButton:SetCallback("OnLeave", function() GameTooltip:Hide() end) Container:AddChild(PixelPerfectButton) local TenEighytyPButton = AG:Create("Button") TenEighytyPButton:SetText("1080p Scale") TenEighytyPButton:SetRelativeWidth(0.33) - TenEighytyPButton:SetCallback("OnClick", function() UUF.db.profile.General.UIScale.Scale = 0.7111111111111 UUF:SetUIScale() Slider:SetValue(0.7111111111111) end) - TenEighytyPButton:SetCallback("OnEnter", function() GameTooltip:SetOwner(TenEighytyPButton.frame, "ANCHOR_CURSOR") GameTooltip:AddLine("UI Scale: |cFF8080FF0.7111111111111|r", 1, 1, 1, false) GameTooltip:Show() end) + TenEighytyPButton:SetCallback("OnClick", + function() + UUF.db.profile.General.UIScale.Scale = 0.7111111111111 + UUF:SetUIScale() + Slider:SetValue(0.7111111111111) + end) + TenEighytyPButton:SetCallback("OnEnter", + function() + GameTooltip:SetOwner(TenEighytyPButton.frame, "ANCHOR_CURSOR") + GameTooltip:AddLine("UI Scale: |cFF8080FF0.7111111111111|r", 1, 1, 1, false) + GameTooltip:Show() + end) TenEighytyPButton:SetCallback("OnLeave", function() GameTooltip:Hide() end) Container:AddChild(TenEighytyPButton) local FourteenFortyPButton = AG:Create("Button") FourteenFortyPButton:SetText("1440p Scale") FourteenFortyPButton:SetRelativeWidth(0.33) - FourteenFortyPButton:SetCallback("OnClick", function() UUF.db.profile.General.UIScale.Scale = 0.5333333333333 UUF:SetUIScale() Slider:SetValue(0.5333333333333) end) - FourteenFortyPButton:SetCallback("OnEnter", function() GameTooltip:SetOwner(FourteenFortyPButton.frame, "ANCHOR_CURSOR") GameTooltip:AddLine("UI Scale: |cFF8080FF0.5333333333333|r", 1, 1, 1, false) GameTooltip:Show() end) + FourteenFortyPButton:SetCallback("OnClick", + function() + UUF.db.profile.General.UIScale.Scale = 0.5333333333333 + UUF:SetUIScale() + Slider:SetValue(0.5333333333333) + end) + FourteenFortyPButton:SetCallback("OnEnter", + function() + GameTooltip:SetOwner(FourteenFortyPButton.frame, "ANCHOR_CURSOR") + GameTooltip:AddLine("UI Scale: |cFF8080FF0.5333333333333|r", 1, 1, 1, false) + GameTooltip:Show() + end) FourteenFortyPButton:SetCallback("OnLeave", function() GameTooltip:Hide() end) Container:AddChild(FourteenFortyPButton) @@ -199,22 +242,43 @@ end local function CreateFontSettings(containerParent) local Container = GUIWidgets.CreateInlineGroup(containerParent, "Fonts") - GUIWidgets.CreateInformationTag(Container,"Fonts are applied to all Unit Frames & Elements where appropriate. More fonts can be added via |cFFFFCC00SharedMedia|r.") + GUIWidgets.CreateInformationTag(Container, + "Fonts are applied to all Unit Frames & Elements where appropriate. More fonts can be added via |cFFFFCC00SharedMedia|r.") local FontDropdown = AG:Create("LSM30_Font") FontDropdown:SetList(LSM:HashTable("font")) FontDropdown:SetLabel("Font") FontDropdown:SetValue(UUF.db.profile.General.Fonts.Font) FontDropdown:SetRelativeWidth(0.5) - FontDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) UUF.db.profile.General.Fonts.Font = value UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) + FontDropdown:SetCallback("OnValueChanged", + function(widget, _, value) + widget:SetValue(value) + UUF.db.profile.General.Fonts.Font = value + UUF:ResolveLSM() + UUF:UpdateAllUnitFrames() + end) Container:AddChild(FontDropdown) local FontFlagDropdown = AG:Create("Dropdown") - FontFlagDropdown:SetList({["NONE"] = "None", ["OUTLINE"] = "Outline", ["THICKOUTLINE"] = "Thick Outline", ["MONOCHROME"] = "Monochrome", ["MONOCHROMEOUTLINE"] = "Monochrome Outline", ["MONOCHROMETHICKOUTLINE"] = "Monochrome Thick Outline"}) + FontFlagDropdown:SetList({ + ["NONE"] = "None", + ["OUTLINE"] = "Outline", + ["THICKOUTLINE"] = "Thick Outline", + ["MONOCHROME"] = "Monochrome", + ["MONOCHROMEOUTLINE"] = "Monochrome Outline", + ["MONOCHROMETHICKOUTLINE"] = + "Monochrome Thick Outline" + }) FontFlagDropdown:SetLabel("Font Flag") FontFlagDropdown:SetValue(UUF.db.profile.General.Fonts.FontFlag) FontFlagDropdown:SetRelativeWidth(0.5) - FontFlagDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) UUF.db.profile.General.Fonts.FontFlag = value UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) + FontFlagDropdown:SetCallback("OnValueChanged", + function(widget, _, value) + widget:SetValue(value) + UUF.db.profile.General.Fonts.FontFlag = value + UUF:ResolveLSM() + UUF:UpdateAllUnitFrames() + end) Container:AddChild(FontFlagDropdown) local SimpleGroup = AG:Create("SimpleGroup") @@ -228,7 +292,13 @@ local function CreateFontSettings(containerParent) Toggle:SetLabel("Enable Font Shadows") Toggle:SetValue(UUF.db.profile.General.Fonts.Shadow.Enabled) Toggle:SetFullWidth(true) - Toggle:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.Fonts.Shadow.Enabled = value UUF:ResolveLSM() GUIWidgets.DeepDisable(SimpleGroup, not UUF.db.profile.General.Fonts.Shadow.Enabled, Toggle) UUF:UpdateAllUnitFrames() end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db.profile.General.Fonts.Shadow.Enabled = value + UUF:ResolveLSM() + GUIWidgets.DeepDisable(SimpleGroup, not UUF.db.profile.General.Fonts.Shadow.Enabled, Toggle) + UUF:UpdateAllUnitFrames() + end) Toggle:SetRelativeWidth(0.5) SimpleGroup:AddChild(Toggle) @@ -236,7 +306,12 @@ local function CreateFontSettings(containerParent) ColorPicker:SetLabel("Colour") ColorPicker:SetColor(unpack(UUF.db.profile.General.Fonts.Shadow.Colour)) ColorPicker:SetFullWidth(true) - ColorPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) UUF.db.profile.General.Fonts.Shadow.Colour = {r, g, b, a} UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) + ColorPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b, a) + UUF.db.profile.General.Fonts.Shadow.Colour = { r, g, b, a } + UUF:ResolveLSM() + UUF:UpdateAllUnitFrames() + end) ColorPicker:SetRelativeWidth(0.5) SimpleGroup:AddChild(ColorPicker) @@ -245,7 +320,12 @@ local function CreateFontSettings(containerParent) XSlider:SetValue(UUF.db.profile.General.Fonts.Shadow.XPos) XSlider:SetSliderValues(-5, 5, 1) XSlider:SetFullWidth(true) - XSlider:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.Fonts.Shadow.XPos = value UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) + XSlider:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db.profile.General.Fonts.Shadow.XPos = value + UUF:ResolveLSM() + UUF:UpdateAllUnitFrames() + end) XSlider:SetRelativeWidth(0.5) SimpleGroup:AddChild(XSlider) @@ -254,7 +334,12 @@ local function CreateFontSettings(containerParent) YSlider:SetValue(UUF.db.profile.General.Fonts.Shadow.YPos) YSlider:SetSliderValues(-5, 5, 1) YSlider:SetFullWidth(true) - YSlider:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.Fonts.Shadow.YPos = value UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) + YSlider:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db.profile.General.Fonts.Shadow.YPos = value + UUF:ResolveLSM() + UUF:UpdateAllUnitFrames() + end) YSlider:SetRelativeWidth(0.5) SimpleGroup:AddChild(YSlider) @@ -264,14 +349,21 @@ end local function CreateTextureSettings(containerParent) local Container = GUIWidgets.CreateInlineGroup(containerParent, "Textures") - GUIWidgets.CreateInformationTag(Container,"Textures are applied to all Unit Frames & Elements where appropriate. More textures can be added via |cFFFFCC00SharedMedia|r.") + GUIWidgets.CreateInformationTag(Container, + "Textures are applied to all Unit Frames & Elements where appropriate. More textures can be added via |cFFFFCC00SharedMedia|r.") local ForegroundTextureDropdown = AG:Create("LSM30_Statusbar") ForegroundTextureDropdown:SetList(LSM:HashTable("statusbar")) ForegroundTextureDropdown:SetLabel("Foreground Texture") ForegroundTextureDropdown:SetValue(UUF.db.profile.General.Textures.Foreground) ForegroundTextureDropdown:SetRelativeWidth(0.5) - ForegroundTextureDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) UUF.db.profile.General.Textures.Foreground = value UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) + ForegroundTextureDropdown:SetCallback("OnValueChanged", + function(widget, _, value) + widget:SetValue(value) + UUF.db.profile.General.Textures.Foreground = value + UUF:ResolveLSM() + UUF:UpdateAllUnitFrames() + end) Container:AddChild(ForegroundTextureDropdown) local BackgroundTextureDropdown = AG:Create("LSM30_Statusbar") @@ -279,16 +371,45 @@ local function CreateTextureSettings(containerParent) BackgroundTextureDropdown:SetLabel("Background Texture") BackgroundTextureDropdown:SetValue(UUF.db.profile.General.Textures.Background) BackgroundTextureDropdown:SetRelativeWidth(0.5) - BackgroundTextureDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) UUF.db.profile.General.Textures.Background = value UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) + BackgroundTextureDropdown:SetCallback("OnValueChanged", + function(widget, _, value) + widget:SetValue(value) + UUF.db.profile.General.Textures.Background = value + UUF:ResolveLSM() + UUF:UpdateAllUnitFrames() + end) Container:AddChild(BackgroundTextureDropdown) local MouseoverStyleDropdown = AG:Create("Dropdown") - MouseoverStyleDropdown:SetList({["SELECT"] = "Set a Highlight Texture...", ["BORDER"] = "Border", ["OVERLAY"] = "Overlay", ["GRADIENT"] = "Gradient" }) + MouseoverStyleDropdown:SetList({ + ["SELECT"] = "Set a Highlight Texture...", + ["BORDER"] = "Border", + ["OVERLAY"] = + "Overlay", + ["GRADIENT"] = "Gradient" + }) MouseoverStyleDropdown:SetLabel("Highlight Style") MouseoverStyleDropdown:SetValue("SELECT") MouseoverStyleDropdown:SetRelativeWidth(0.5) - MouseoverStyleDropdown:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do if unitDB.Indicators.Mouseover and unitDB.Indicators.Mouseover.Enabled then unitDB.Indicators.Mouseover.Style = value end end UUF:UpdateAllUnitFrames() MouseoverStyleDropdown:SetValue("SELECT") end) - MouseoverStyleDropdown:SetCallback("OnEnter", function() GameTooltip:SetOwner(MouseoverStyleDropdown.frame, "ANCHOR_BOTTOM") GameTooltip:AddLine("Set |cFF8080FFMouseover Highlight Style|r for all units. |cFF8080FFColour|r & |cFF8080FFAlpha|r can be adjusted per unit.", 1, 1, 1) GameTooltip:Show() end) + MouseoverStyleDropdown:SetCallback("OnValueChanged", + function(_, _, value) + for _, unitDB in pairs(UUF.db.profile.Units) do + if unitDB.Indicators.Mouseover and unitDB.Indicators.Mouseover.Enabled then + unitDB.Indicators.Mouseover.Style = + value + end + end + UUF:UpdateAllUnitFrames() + MouseoverStyleDropdown:SetValue("SELECT") + end) + MouseoverStyleDropdown:SetCallback("OnEnter", + function() + GameTooltip:SetOwner(MouseoverStyleDropdown.frame, "ANCHOR_BOTTOM") + GameTooltip:AddLine( + "Set |cFF8080FFMouseover Highlight Style|r for all units. |cFF8080FFColour|r & |cFF8080FFAlpha|r can be adjusted per unit.", + 1, 1, 1) + GameTooltip:Show() + end) MouseoverStyleDropdown:SetCallback("OnLeave", function() GameTooltip:Hide() end) Container:AddChild(MouseoverStyleDropdown) @@ -298,15 +419,28 @@ local function CreateTextureSettings(containerParent) MouseoverHighlightSlider:SetSliderValues(0.0, 1.0, 0.01) MouseoverHighlightSlider:SetRelativeWidth(0.5) MouseoverHighlightSlider:SetIsPercent(true) - MouseoverHighlightSlider:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do if unitDB.Indicators.Mouseover and unitDB.Indicators.Mouseover.Enabled then unitDB.Indicators.Mouseover.HighlightOpacity = value end end UUF:UpdateAllUnitFrames() end) + MouseoverHighlightSlider:SetCallback("OnValueChanged", + function(_, _, value) + for _, unitDB in pairs(UUF.db.profile.Units) do + if unitDB.Indicators.Mouseover and unitDB.Indicators.Mouseover.Enabled then + unitDB.Indicators.Mouseover.HighlightOpacity = + value + end + end + UUF:UpdateAllUnitFrames() + end) Container:AddChild(MouseoverHighlightSlider) local ForegroundColourPicker = AG:Create("ColorPicker") ForegroundColourPicker:SetLabel("Foreground Colour") - local R, G, B = 8/255, 8/255, 8/255 + local R, G, B = 8 / 255, 8 / 255, 8 / 255 ForegroundColourPicker:SetColor(R, G, B) ForegroundColourPicker:SetRelativeWidth(0.5) - ForegroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.ForegroundColour = {r, g, b} end UUF:UpdateAllUnitFrames() end) + ForegroundColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b, a) + for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.ForegroundColour = { r, g, b } end + UUF:UpdateAllUnitFrames() + end) Container:AddChild(ForegroundColourPicker) local ForegroundOpacitySlider = AG:Create("Slider") @@ -315,15 +449,23 @@ local function CreateTextureSettings(containerParent) ForegroundOpacitySlider:SetSliderValues(0.0, 1.0, 0.01) ForegroundOpacitySlider:SetRelativeWidth(0.5) ForegroundOpacitySlider:SetIsPercent(true) - ForegroundOpacitySlider:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.ForegroundOpacity = value end UUF:UpdateAllUnitFrames() end) + ForegroundOpacitySlider:SetCallback("OnValueChanged", + function(_, _, value) + for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.ForegroundOpacity = value end + UUF:UpdateAllUnitFrames() + end) Container:AddChild(ForegroundOpacitySlider) local BackgroundColourPicker = AG:Create("ColorPicker") BackgroundColourPicker:SetLabel("Background Colour") - local R2, G2, B2 = 8/255, 8/255, 8/255 + local R2, G2, B2 = 8 / 255, 8 / 255, 8 / 255 BackgroundColourPicker:SetColor(R2, G2, B2) BackgroundColourPicker:SetRelativeWidth(0.5) - BackgroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.BackgroundColour = {r, g, b} end UUF:UpdateAllUnitFrames() end) + BackgroundColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b, a) + for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.BackgroundColour = { r, g, b } end + UUF:UpdateAllUnitFrames() + end) Container:AddChild(BackgroundColourPicker) local BackgroundOpacitySlider = AG:Create("Slider") @@ -332,7 +474,11 @@ local function CreateTextureSettings(containerParent) BackgroundOpacitySlider:SetSliderValues(0.0, 1.0, 0.01) BackgroundOpacitySlider:SetRelativeWidth(0.5) BackgroundOpacitySlider:SetIsPercent(true) - BackgroundOpacitySlider:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.BackgroundOpacity = value end UUF:UpdateAllUnitFrames() end) + BackgroundOpacitySlider:SetCallback("OnValueChanged", + function(_, _, value) + for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.BackgroundOpacity = value end + UUF:UpdateAllUnitFrames() + end) Container:AddChild(BackgroundOpacitySlider) end @@ -344,7 +490,12 @@ local function CreateRangeSettings(containerParent) Toggle:SetLabel("Enable Range Fading") Toggle:SetValue(RangeDB.Enabled) Toggle:SetFullWidth(true) - Toggle:SetCallback("OnValueChanged", function(_, _, value) RangeDB.Enabled = value UUF:UpdateAllUnitFrames() GUIWidgets.DeepDisable(Container, not value, Toggle) end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + RangeDB.Enabled = value + UUF:UpdateAllUnitFrames() + GUIWidgets.DeepDisable(Container, not value, Toggle) + end) Toggle:SetRelativeWidth(0.33) Container:AddChild(Toggle) @@ -353,7 +504,11 @@ local function CreateRangeSettings(containerParent) InAlphaSlider:SetValue(RangeDB.InRange) InAlphaSlider:SetSliderValues(0.0, 1.0, 0.01) InAlphaSlider:SetFullWidth(true) - InAlphaSlider:SetCallback("OnValueChanged", function(_, _, value) RangeDB.InRange = value UUF:UpdateAllUnitFrames() end) + InAlphaSlider:SetCallback("OnValueChanged", + function(_, _, value) + RangeDB.InRange = value + UUF:UpdateAllUnitFrames() + end) InAlphaSlider:SetRelativeWidth(0.33) InAlphaSlider:SetIsPercent(true) Container:AddChild(InAlphaSlider) @@ -363,7 +518,11 @@ local function CreateRangeSettings(containerParent) OutAlphaSlider:SetValue(RangeDB.OutOfRange) OutAlphaSlider:SetSliderValues(0.0, 1.0, 0.01) OutAlphaSlider:SetFullWidth(true) - OutAlphaSlider:SetCallback("OnValueChanged", function(_, _, value) RangeDB.OutOfRange = value UUF:UpdateAllUnitFrames() end) + OutAlphaSlider:SetCallback("OnValueChanged", + function(_, _, value) + RangeDB.OutOfRange = value + UUF:UpdateAllUnitFrames() + end) OutAlphaSlider:SetRelativeWidth(0.33) OutAlphaSlider:SetIsPercent(true) Container:AddChild(OutAlphaSlider) @@ -371,32 +530,106 @@ local function CreateRangeSettings(containerParent) GUIWidgets.DeepDisable(Container, not RangeDB.Enabled, Toggle) end +local function CreateGlobalOutOfCombatFadeSettings(containerParent) + local FadeDB = UUF.db.profile.General.OutOfCombatFade + local Container = GUIWidgets.CreateInlineGroup(containerParent, "Out of Combat Fade") + + GUIWidgets.CreateInformationTag(Container, + "Fade unit frames when out of combat. Per-frame settings can override this global setting.") + + local UseGlobalToggle = AG:Create("CheckBox") + UseGlobalToggle:SetLabel("Use Global Out of Combat Fade") + UseGlobalToggle:SetValue(FadeDB.UseGlobal) + UseGlobalToggle:SetFullWidth(true) + UseGlobalToggle:SetCallback("OnValueChanged", + function(_, _, value) + FadeDB.UseGlobal = value + UUF:UpdateOutOfCombatFade() + GUIWidgets.DeepDisable(Container, not value, UseGlobalToggle) + end) + UseGlobalToggle:SetRelativeWidth(0.5) + Container:AddChild(UseGlobalToggle) + + local GlobalOpacitySlider = AG:Create("Slider") + GlobalOpacitySlider:SetLabel("Global Out of Combat Opacity") + GlobalOpacitySlider:SetValue(FadeDB.GlobalOpacity) + GlobalOpacitySlider:SetSliderValues(0.0, 1.0, 0.01) + GlobalOpacitySlider:SetFullWidth(true) + GlobalOpacitySlider:SetCallback("OnValueChanged", + function(_, _, value) + FadeDB.GlobalOpacity = value + UUF:UpdateOutOfCombatFade() + end) + GlobalOpacitySlider:SetRelativeWidth(0.5) + GlobalOpacitySlider:SetIsPercent(true) + Container:AddChild(GlobalOpacitySlider) + + local FadeInWithTargetToggle = AG:Create("CheckBox") + FadeInWithTargetToggle:SetLabel("Fade In When Target Is Set") + FadeInWithTargetToggle:SetValue(FadeDB.FadeInWithTarget) + FadeInWithTargetToggle:SetFullWidth(true) + FadeInWithTargetToggle:SetCallback("OnValueChanged", + function(_, _, value) + FadeDB.FadeInWithTarget = value + UUF:UpdateOutOfCombatFade() + end) + FadeInWithTargetToggle:SetRelativeWidth(0.5) + Container:AddChild(FadeInWithTargetToggle) + + GUIWidgets.CreateInformationTag(Container, + "When enabled, frames will fade to full opacity if you have a target, even while out of combat.") + + GUIWidgets.DeepDisable(Container, not FadeDB.UseGlobal, UseGlobalToggle) +end + local function CreateColourSettings(containerParent) local Container = GUIWidgets.CreateInlineGroup(containerParent, "Colours") - GUIWidgets.CreateInformationTag(Container,"Buttons below will reset the colours to their default values as defined by " .. UUF.PRETTY_ADDON_NAME .. ".") + GUIWidgets.CreateInformationTag(Container, + "Buttons below will reset the colours to their default values as defined by " .. UUF.PRETTY_ADDON_NAME .. ".") local ResetAllColoursButton = AG:Create("Button") ResetAllColoursButton:SetText("All Colours") - ResetAllColoursButton:SetCallback("OnClick", function() UUF:CopyTabe(UUF:GetDefaultDB().profile.General.Colours, UUF.db.profile.General.Colours) Container:ReleaseChildren() CreateColourSettings(containerParent) Container:DoLayout() containerParent:DoLayout() end) + ResetAllColoursButton:SetCallback("OnClick", + function() + UUF:CopyTabe(UUF:GetDefaultDB().profile.General.Colours, UUF.db.profile.General.Colours) + Container:ReleaseChildren() + CreateColourSettings(containerParent) + Container:DoLayout() + containerParent:DoLayout() + end) ResetAllColoursButton:SetRelativeWidth(0.33) Container:AddChild(ResetAllColoursButton) local ResetPowerColoursButton = AG:Create("Button") ResetPowerColoursButton:SetText("Power Colours") - ResetPowerColoursButton:SetCallback("OnClick", function() UUF:CopyTabe(UUF:GetDefaultDB().profile.General.Colours.Power, UUF.db.profile.General.Colours.Power) Container:ReleaseChildren() CreateColourSettings(containerParent) Container:DoLayout() containerParent:DoLayout() end) + ResetPowerColoursButton:SetCallback("OnClick", + function() + UUF:CopyTabe(UUF:GetDefaultDB().profile.General.Colours.Power, UUF.db.profile.General.Colours.Power) + Container:ReleaseChildren() + CreateColourSettings(containerParent) + Container:DoLayout() + containerParent:DoLayout() + end) ResetPowerColoursButton:SetRelativeWidth(0.33) Container:AddChild(ResetPowerColoursButton) local ResetReactionColoursButton = AG:Create("Button") ResetReactionColoursButton:SetText("Reaction Colours") - ResetReactionColoursButton:SetCallback("OnClick", function() UUF:CopyTabe(UUF:GetDefaultDB().profile.General.Colours.Reaction, UUF.db.profile.General.Colours.Reaction) Container:ReleaseChildren() CreateColourSettings(containerParent) Container:DoLayout() containerParent:DoLayout() end) + ResetReactionColoursButton:SetCallback("OnClick", + function() + UUF:CopyTabe(UUF:GetDefaultDB().profile.General.Colours.Reaction, UUF.db.profile.General.Colours.Reaction) + Container:ReleaseChildren() + CreateColourSettings(containerParent) + Container:DoLayout() + containerParent:DoLayout() + end) ResetReactionColoursButton:SetRelativeWidth(0.33) Container:AddChild(ResetReactionColoursButton) GUIWidgets.CreateHeader(Container, "Power") - local PowerOrder = {0, 1, 2, 3, 6, 8, 11, 13, 17, 18} + local PowerOrder = { 0, 1, 2, 3, 6, 8, 11, 13, 17, 18 } for _, powerType in ipairs(PowerOrder) do local powerColour = UUF.db.profile.General.Colours.Power[powerType] @@ -404,7 +637,12 @@ local function CreateColourSettings(containerParent) PowerColourPicker:SetLabel(Power[powerType]) local R, G, B = unpack(powerColour) PowerColourPicker:SetColor(R, G, B) - PowerColourPicker:SetCallback("OnValueChanged", function(widget, _, r, g, b) UUF.db.profile.General.Colours.Power[powerType] = {r, g, b} UUF:LoadCustomColours() UUF:UpdateAllUnitFrames() end) + PowerColourPicker:SetCallback("OnValueChanged", + function(widget, _, r, g, b) + UUF.db.profile.General.Colours.Power[powerType] = { r, g, b } + UUF:LoadCustomColours() + UUF:UpdateAllUnitFrames() + end) PowerColourPicker:SetHasAlpha(false) PowerColourPicker:SetRelativeWidth(0.19) Container:AddChild(PowerColourPicker) @@ -412,14 +650,19 @@ local function CreateColourSettings(containerParent) GUIWidgets.CreateHeader(Container, "Reaction") - local ReactionOrder = {1, 2, 3, 4, 5, 6, 7, 8} + local ReactionOrder = { 1, 2, 3, 4, 5, 6, 7, 8 } for _, reactionType in ipairs(ReactionOrder) do local ReactionColourPicker = AG:Create("ColorPicker") ReactionColourPicker:SetLabel(Reaction[reactionType]) local R, G, B = unpack(UUF.db.profile.General.Colours.Reaction[reactionType]) ReactionColourPicker:SetColor(R, G, B) - ReactionColourPicker:SetCallback("OnValueChanged", function(widget, _, r, g, b) UUF.db.profile.General.Colours.Reaction[reactionType] = {r, g, b} UUF:LoadCustomColours() UUF:UpdateAllUnitFrames() end) + ReactionColourPicker:SetCallback("OnValueChanged", + function(widget, _, r, g, b) + UUF.db.profile.General.Colours.Reaction[reactionType] = { r, g, b } + UUF:LoadCustomColours() + UUF:UpdateAllUnitFrames() + end) ReactionColourPicker:SetHasAlpha(false) ReactionColourPicker:SetRelativeWidth(0.25) Container:AddChild(ReactionColourPicker) @@ -437,7 +680,10 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC WidthSlider:SetValue(FrameDB.Width) WidthSlider:SetSliderValues(1, 1000, 0.1) WidthSlider:SetRelativeWidth(0.5) - WidthSlider:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Width = value updateCallback() end) + WidthSlider:SetCallback("OnValueChanged", function(_, _, value) + FrameDB.Width = value + updateCallback() + end) LayoutContainer:AddChild(WidthSlider) local HeightSlider = AG:Create("Slider") @@ -445,7 +691,10 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC HeightSlider:SetValue(FrameDB.Height) HeightSlider:SetSliderValues(1, 1000, 0.1) HeightSlider:SetRelativeWidth(0.5) - HeightSlider:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Height = value updateCallback() end) + HeightSlider:SetCallback("OnValueChanged", function(_, _, value) + FrameDB.Height = value + updateCallback() + end) LayoutContainer:AddChild(HeightSlider) local AnchorFromDropdown = AG:Create("Dropdown") @@ -453,7 +702,10 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(FrameDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth((unitHasParent or unit == "boss") and 0.33 or 0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Layout[1] = value updateCallback() end) + AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) + FrameDB.Layout[1] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorFromDropdown) if unitHasParent then @@ -462,7 +714,12 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC AnchorParentEditBox:SetText(FrameDB.AnchorParent or "") AnchorParentEditBox:SetRelativeWidth(0.33) AnchorParentEditBox:DisableButton(true) - AnchorParentEditBox:SetCallback("OnEnterPressed", function(_, _, value) FrameDB.AnchorParent = value ~= "" and value or nil AnchorParentEditBox:SetText(FrameDB.AnchorParent or "") updateCallback() end) + AnchorParentEditBox:SetCallback("OnEnterPressed", + function(_, _, value) + FrameDB.AnchorParent = value ~= "" and value or nil + AnchorParentEditBox:SetText(FrameDB.AnchorParent or "") + updateCallback() + end) LayoutContainer:AddChild(AnchorParentEditBox) end @@ -471,16 +728,23 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(FrameDB.Layout[2]) AnchorToDropdown:SetRelativeWidth((unitHasParent or unit == "boss") and 0.33 or 0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Layout[2] = value updateCallback() end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) + FrameDB.Layout[2] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorToDropdown) if unit == "boss" then local GrowthDirectionDropdown = AG:Create("Dropdown") - GrowthDirectionDropdown:SetList({["UP"] = "Up", ["DOWN"] = "Down"}) + GrowthDirectionDropdown:SetList({ ["UP"] = "Up", ["DOWN"] = "Down" }) GrowthDirectionDropdown:SetLabel("Growth Direction") GrowthDirectionDropdown:SetValue(FrameDB.GrowthDirection) GrowthDirectionDropdown:SetRelativeWidth(0.33) - GrowthDirectionDropdown:SetCallback("OnValueChanged", function(_, _, value) FrameDB.GrowthDirection = value updateCallback() end) + GrowthDirectionDropdown:SetCallback("OnValueChanged", + function(_, _, value) + FrameDB.GrowthDirection = value + updateCallback() + end) LayoutContainer:AddChild(GrowthDirectionDropdown) end @@ -489,7 +753,10 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC XPosSlider:SetValue(FrameDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(unit == "boss" and 0.25 or 0.33) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Layout[3] = value updateCallback() end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) + FrameDB.Layout[3] = value + updateCallback() + end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -497,7 +764,10 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC YPosSlider:SetValue(FrameDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(unit == "boss" and 0.25 or 0.33) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Layout[4] = value updateCallback() end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) + FrameDB.Layout[4] = value + updateCallback() + end) LayoutContainer:AddChild(YPosSlider) if unit == "boss" then @@ -506,7 +776,10 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC SpacingSlider:SetValue(FrameDB.Layout[5]) SpacingSlider:SetSliderValues(-1, 100, 0.1) SpacingSlider:SetRelativeWidth(0.33) - SpacingSlider:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Layout[5] = value updateCallback() end) + SpacingSlider:SetCallback("OnValueChanged", function(_, _, value) + FrameDB.Layout[5] = value + updateCallback() + end) LayoutContainer:AddChild(SpacingSlider) end @@ -515,7 +788,11 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC FrameStrataDropdown:SetLabel("Frame Strata") FrameStrataDropdown:SetValue(FrameDB.FrameStrata) FrameStrataDropdown:SetRelativeWidth(unit == "boss" and 0.25 or 0.33) - FrameStrataDropdown:SetCallback("OnValueChanged", function(_, _, value) FrameDB.FrameStrata = value updateCallback() end) + FrameStrataDropdown:SetCallback("OnValueChanged", + function(_, _, value) + FrameDB.FrameStrata = value + updateCallback() + end) LayoutContainer:AddChild(FrameStrataDropdown) local ColourContainer = GUIWidgets.CreateInlineGroup(containerParent, "Colours & Toggles") @@ -523,14 +800,22 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC local ColourWhenTappedToggle = AG:Create("CheckBox") ColourWhenTappedToggle:SetLabel("Colour When Tapped") ColourWhenTappedToggle:SetValue(HealthBarDB.ColourWhenTapped) - ColourWhenTappedToggle:SetCallback("OnValueChanged", function(_, _, value) HealthBarDB.ColourWhenTapped = value updateCallback() end) + ColourWhenTappedToggle:SetCallback("OnValueChanged", + function(_, _, value) + HealthBarDB.ColourWhenTapped = value + updateCallback() + end) ColourWhenTappedToggle:SetRelativeWidth((unit == "player" or unit == "target") and 0.33 or 0.5) ColourContainer:AddChild(ColourWhenTappedToggle) local InverseGrowthDirectionToggle = AG:Create("CheckBox") InverseGrowthDirectionToggle:SetLabel("Inverse Growth Direction") InverseGrowthDirectionToggle:SetValue(HealthBarDB.Inverse) - InverseGrowthDirectionToggle:SetCallback("OnValueChanged", function(_, _, value) HealthBarDB.Inverse = value updateCallback() end) + InverseGrowthDirectionToggle:SetCallback("OnValueChanged", + function(_, _, value) + HealthBarDB.Inverse = value + updateCallback() + end) InverseGrowthDirectionToggle:SetRelativeWidth((unit == "player" or unit == "target") and 0.33 or 0.5) ColourContainer:AddChild(InverseGrowthDirectionToggle) @@ -539,41 +824,48 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC AnchorToCooldownViewerToggle:SetLabel("Anchor To Cooldown Viewer") AnchorToCooldownViewerToggle:SetValue(HealthBarDB.AnchorToCooldownViewer) AnchorToCooldownViewerToggle:SetCallback("OnValueChanged", - function(_, _, value) - HealthBarDB.AnchorToCooldownViewer = value - if not value then - FrameDB.Layout[1] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[1] - FrameDB.Layout[2] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[2] - FrameDB.Layout[3] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[3] - FrameDB.Layout[4] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[4] - AnchorFromDropdown:SetValue(FrameDB.Layout[1]) - AnchorToDropdown:SetValue(FrameDB.Layout[2]) - XPosSlider:SetValue(FrameDB.Layout[3]) - YPosSlider:SetValue(FrameDB.Layout[4]) - else - if unit == "player" then - FrameDB.Layout[1] = "RIGHT" - FrameDB.Layout[2] = "LEFT" - FrameDB.Layout[3] = 0 - FrameDB.Layout[4] = 0 - AnchorFromDropdown:SetValue(FrameDB.Layout[1]) - AnchorToDropdown:SetValue(FrameDB.Layout[2]) - XPosSlider:SetValue(FrameDB.Layout[3]) - YPosSlider:SetValue(FrameDB.Layout[4]) - elseif unit == "target" then - FrameDB.Layout[1] = "LEFT" - FrameDB.Layout[2] = "RIGHT" - FrameDB.Layout[3] = 0 - FrameDB.Layout[4] = 0 + function(_, _, value) + HealthBarDB.AnchorToCooldownViewer = value + if not value then + FrameDB.Layout[1] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[1] + FrameDB.Layout[2] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[2] + FrameDB.Layout[3] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[3] + FrameDB.Layout[4] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[4] AnchorFromDropdown:SetValue(FrameDB.Layout[1]) AnchorToDropdown:SetValue(FrameDB.Layout[2]) XPosSlider:SetValue(FrameDB.Layout[3]) YPosSlider:SetValue(FrameDB.Layout[4]) + else + if unit == "player" then + FrameDB.Layout[1] = "RIGHT" + FrameDB.Layout[2] = "LEFT" + FrameDB.Layout[3] = 0 + FrameDB.Layout[4] = 0 + AnchorFromDropdown:SetValue(FrameDB.Layout[1]) + AnchorToDropdown:SetValue(FrameDB.Layout[2]) + XPosSlider:SetValue(FrameDB.Layout[3]) + YPosSlider:SetValue(FrameDB.Layout[4]) + elseif unit == "target" then + FrameDB.Layout[1] = "LEFT" + FrameDB.Layout[2] = "RIGHT" + FrameDB.Layout[3] = 0 + FrameDB.Layout[4] = 0 + AnchorFromDropdown:SetValue(FrameDB.Layout[1]) + AnchorToDropdown:SetValue(FrameDB.Layout[2]) + XPosSlider:SetValue(FrameDB.Layout[3]) + YPosSlider:SetValue(FrameDB.Layout[4]) + end end - end - updateCallback() - end) - AnchorToCooldownViewerToggle:SetCallback("OnEnter", function() GameTooltip:SetOwner(AnchorToCooldownViewerToggle.frame, "ANCHOR_CURSOR") GameTooltip:AddLine("Anchor To |cFF8080FFEssential|r Cooldown Viewer. Toggling this will overwrite existing |cFF8080FFLayout|r Settings.", 1, 1, 1, false) GameTooltip:Show() end) + updateCallback() + end) + AnchorToCooldownViewerToggle:SetCallback("OnEnter", + function() + GameTooltip:SetOwner(AnchorToCooldownViewerToggle.frame, "ANCHOR_CURSOR") + GameTooltip:AddLine( + "Anchor To |cFF8080FFEssential|r Cooldown Viewer. Toggling this will overwrite existing |cFF8080FFLayout|r Settings.", + 1, 1, 1, false) + GameTooltip:Show() + end) AnchorToCooldownViewerToggle:SetCallback("OnLeave", function() GameTooltip:Hide() end) AnchorToCooldownViewerToggle:SetRelativeWidth(0.33) ColourContainer:AddChild(AnchorToCooldownViewerToggle) @@ -585,7 +877,11 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC ForegroundColourPicker:SetLabel("Foreground Colour") local R, G, B = unpack(HealthBarDB.Foreground) ForegroundColourPicker:SetColor(R, G, B) - ForegroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) HealthBarDB.Foreground = {r, g, b} updateCallback() end) + ForegroundColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b) + HealthBarDB.Foreground = { r, g, b } + updateCallback() + end) ForegroundColourPicker:SetHasAlpha(false) ForegroundColourPicker:SetRelativeWidth(0.25) ForegroundColourPicker:SetDisabled(HealthBarDB.ColourByClass) @@ -595,7 +891,12 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC local ForegroundColourByClassToggle = AG:Create("CheckBox") ForegroundColourByClassToggle:SetLabel("Colour by Class / Reaction") ForegroundColourByClassToggle:SetValue(HealthBarDB.ColourByClass) - ForegroundColourByClassToggle:SetCallback("OnValueChanged", function(_, _, value) HealthBarDB.ColourByClass = value UUFGUI.FrameFGColourPicker:SetDisabled(HealthBarDB.ColourByClass) updateCallback() end) + ForegroundColourByClassToggle:SetCallback("OnValueChanged", + function(_, _, value) + HealthBarDB.ColourByClass = value + UUFGUI.FrameFGColourPicker:SetDisabled(HealthBarDB.ColourByClass) + updateCallback() + end) ForegroundColourByClassToggle:SetRelativeWidth(0.25) ColourContainer:AddChild(ForegroundColourByClassToggle) @@ -604,7 +905,11 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC ForegroundOpacitySlider:SetValue(HealthBarDB.ForegroundOpacity) ForegroundOpacitySlider:SetSliderValues(0, 1, 0.01) ForegroundOpacitySlider:SetRelativeWidth(0.5) - ForegroundOpacitySlider:SetCallback("OnValueChanged", function(_, _, value) HealthBarDB.ForegroundOpacity = value updateCallback() end) + ForegroundOpacitySlider:SetCallback("OnValueChanged", + function(_, _, value) + HealthBarDB.ForegroundOpacity = value + updateCallback() + end) ForegroundOpacitySlider:SetIsPercent(true) ColourContainer:AddChild(ForegroundOpacitySlider) @@ -612,7 +917,11 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC BackgroundColourPicker:SetLabel("Background Colour") local R2, G2, B2 = unpack(HealthBarDB.Background) BackgroundColourPicker:SetColor(R2, G2, B2) - BackgroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) HealthBarDB.Background = {r, g, b} updateCallback() end) + BackgroundColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b) + HealthBarDB.Background = { r, g, b } + updateCallback() + end) BackgroundColourPicker:SetHasAlpha(false) BackgroundColourPicker:SetRelativeWidth(0.25) BackgroundColourPicker:SetDisabled(HealthBarDB.ColourBackgroundByClass) @@ -622,7 +931,12 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC local BackgroundColourByClassToggle = AG:Create("CheckBox") BackgroundColourByClassToggle:SetLabel("Colour by Class / Reaction") BackgroundColourByClassToggle:SetValue(HealthBarDB.ColourBackgroundByClass) - BackgroundColourByClassToggle:SetCallback("OnValueChanged", function(_, _, value) HealthBarDB.ColourBackgroundByClass = value UUFGUI.FrameBGColourPicker:SetDisabled(HealthBarDB.ColourBackgroundByClass) updateCallback() end) + BackgroundColourByClassToggle:SetCallback("OnValueChanged", + function(_, _, value) + HealthBarDB.ColourBackgroundByClass = value + UUFGUI.FrameBGColourPicker:SetDisabled(HealthBarDB.ColourBackgroundByClass) + updateCallback() + end) BackgroundColourByClassToggle:SetRelativeWidth(0.25) ColourContainer:AddChild(BackgroundColourByClassToggle) @@ -631,9 +945,60 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC BackgroundOpacitySlider:SetValue(HealthBarDB.BackgroundOpacity) BackgroundOpacitySlider:SetSliderValues(0, 1, 0.01) BackgroundOpacitySlider:SetRelativeWidth(0.5) - BackgroundOpacitySlider:SetCallback("OnValueChanged", function(_, _, value) HealthBarDB.BackgroundOpacity = value updateCallback() end) + BackgroundOpacitySlider:SetCallback("OnValueChanged", + function(_, _, value) + HealthBarDB.BackgroundOpacity = value + updateCallback() + end) BackgroundOpacitySlider:SetIsPercent(true) ColourContainer:AddChild(BackgroundOpacitySlider) + + -- Out of Combat Fade Settings + local OutOfCombatFadeContainer = GUIWidgets.CreateInlineGroup(containerParent, "Out of Combat Fade") + + local OutOfCombatFadeEnabled = AG:Create("CheckBox") + OutOfCombatFadeEnabled:SetLabel("Enable Out of Combat Fade (Per-Frame)") + OutOfCombatFadeEnabled:SetValue(FrameDB.OutOfCombatFade.Enabled) + OutOfCombatFadeEnabled:SetCallback("OnValueChanged", + function(_, _, value) + FrameDB.OutOfCombatFade.Enabled = value + updateCallback() + UUF:UpdateOutOfCombatFade() + end) + OutOfCombatFadeEnabled:SetRelativeWidth(0.5) + OutOfCombatFadeContainer:AddChild(OutOfCombatFadeEnabled) + + GUIWidgets.CreateInformationTag(OutOfCombatFadeContainer, + "Enable this to override the Global Out of Combat Fade setting for this specific frame.") + + local OutOfCombatFadeOpacitySlider = AG:Create("Slider") + OutOfCombatFadeOpacitySlider:SetLabel("Out of Combat Opacity") + OutOfCombatFadeOpacitySlider:SetValue(FrameDB.OutOfCombatFade.Opacity) + OutOfCombatFadeOpacitySlider:SetSliderValues(0.0, 1.0, 0.01) + OutOfCombatFadeOpacitySlider:SetRelativeWidth(0.5) + OutOfCombatFadeOpacitySlider:SetCallback("OnValueChanged", + function(_, _, value) + FrameDB.OutOfCombatFade.Opacity = value + updateCallback() + UUF:UpdateOutOfCombatFade() + end) + OutOfCombatFadeOpacitySlider:SetIsPercent(true) + OutOfCombatFadeContainer:AddChild(OutOfCombatFadeOpacitySlider) + + local OutOfCombatFadeFadeInWithTargetToggle = AG:Create("CheckBox") + OutOfCombatFadeFadeInWithTargetToggle:SetLabel("Fade In When Target Is Set") + OutOfCombatFadeFadeInWithTargetToggle:SetValue(FrameDB.OutOfCombatFade.FadeInWithTarget) + OutOfCombatFadeFadeInWithTargetToggle:SetCallback("OnValueChanged", + function(_, _, value) + FrameDB.OutOfCombatFade.FadeInWithTarget = value + updateCallback() + UUF:UpdateOutOfCombatFade() + end) + OutOfCombatFadeFadeInWithTargetToggle:SetRelativeWidth(0.5) + OutOfCombatFadeContainer:AddChild(OutOfCombatFadeFadeInWithTargetToggle) + + GUIWidgets.CreateInformationTag(OutOfCombatFadeContainer, + "When enabled, this frame will fade to full opacity if you have a target, even while out of combat.") end local function CreateHealPredictionSettings(containerParent, unit, updateCallback) @@ -644,14 +1009,23 @@ local function CreateHealPredictionSettings(containerParent, unit, updateCallbac local ShowAbsorbToggle = AG:Create("CheckBox") ShowAbsorbToggle:SetLabel("Show Absorbs") ShowAbsorbToggle:SetValue(HealPredictionDB.Absorbs.Enabled) - ShowAbsorbToggle:SetCallback("OnValueChanged", function(_, _, value) HealPredictionDB.Absorbs.Enabled = value updateCallback() RefreshHealPredictionSettings() end) + ShowAbsorbToggle:SetCallback("OnValueChanged", + function(_, _, value) + HealPredictionDB.Absorbs.Enabled = value + updateCallback() + RefreshHealPredictionSettings() + end) ShowAbsorbToggle:SetRelativeWidth(0.5) AbsorbSettings:AddChild(ShowAbsorbToggle) local UseStripedTextureAbsorbToggle = AG:Create("CheckBox") UseStripedTextureAbsorbToggle:SetLabel("Use Striped Texture") UseStripedTextureAbsorbToggle:SetValue(HealPredictionDB.Absorbs.UseStripedTexture) - UseStripedTextureAbsorbToggle:SetCallback("OnValueChanged", function(_, _, value) HealPredictionDB.Absorbs.UseStripedTexture = value updateCallback() end) + UseStripedTextureAbsorbToggle:SetCallback("OnValueChanged", + function(_, _, value) + HealPredictionDB.Absorbs.UseStripedTexture = value + updateCallback() + end) UseStripedTextureAbsorbToggle:SetRelativeWidth(0.5) AbsorbSettings:AddChild(UseStripedTextureAbsorbToggle) @@ -659,31 +1033,48 @@ local function CreateHealPredictionSettings(containerParent, unit, updateCallbac AbsorbColourPicker:SetLabel("Absorb Colour") local R, G, B, A = unpack(HealPredictionDB.Absorbs.Colour) AbsorbColourPicker:SetColor(R, G, B, A) - AbsorbColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) HealPredictionDB.Absorbs.Colour = {r, g, b, a} updateCallback() end) + AbsorbColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b, a) + HealPredictionDB.Absorbs.Colour = { r, g, b, a } + updateCallback() + end) AbsorbColourPicker:SetHasAlpha(true) AbsorbColourPicker:SetRelativeWidth(0.5) AbsorbSettings:AddChild(AbsorbColourPicker) local AbsorbPositionDropdown = AG:Create("Dropdown") - AbsorbPositionDropdown:SetList({["LEFT"] = "Left", ["RIGHT"] = "Right"}) + AbsorbPositionDropdown:SetList({ ["LEFT"] = "Left", ["RIGHT"] = "Right" }) AbsorbPositionDropdown:SetLabel("Position") AbsorbPositionDropdown:SetValue(HealPredictionDB.Absorbs.Position) AbsorbPositionDropdown:SetRelativeWidth(0.5) - AbsorbPositionDropdown:SetCallback("OnValueChanged", function(_, _, value) HealPredictionDB.Absorbs.Position = value updateCallback() end) + AbsorbPositionDropdown:SetCallback("OnValueChanged", + function(_, _, value) + HealPredictionDB.Absorbs.Position = value + updateCallback() + end) AbsorbSettings:AddChild(AbsorbPositionDropdown) local HealAbsorbSettings = GUIWidgets.CreateInlineGroup(containerParent, "Heal Absorb Settings") local ShowHealAbsorbToggle = AG:Create("CheckBox") ShowHealAbsorbToggle:SetLabel("Show Heal Absorbs") ShowHealAbsorbToggle:SetValue(HealPredictionDB.HealAbsorbs.Enabled) - ShowHealAbsorbToggle:SetCallback("OnValueChanged", function(_, _, value) HealPredictionDB.HealAbsorbs.Enabled = value updateCallback() RefreshHealPredictionSettings() end) + ShowHealAbsorbToggle:SetCallback("OnValueChanged", + function(_, _, value) + HealPredictionDB.HealAbsorbs.Enabled = value + updateCallback() + RefreshHealPredictionSettings() + end) ShowHealAbsorbToggle:SetRelativeWidth(0.5) HealAbsorbSettings:AddChild(ShowHealAbsorbToggle) local UseStripedTextureHealAbsorbToggle = AG:Create("CheckBox") UseStripedTextureHealAbsorbToggle:SetLabel("Use Striped Texture") UseStripedTextureHealAbsorbToggle:SetValue(HealPredictionDB.HealAbsorbs.UseStripedTexture) - UseStripedTextureHealAbsorbToggle:SetCallback("OnValueChanged", function(_, _, value) HealPredictionDB.HealAbsorbs.UseStripedTexture = value updateCallback() end) + UseStripedTextureHealAbsorbToggle:SetCallback("OnValueChanged", + function(_, _, value) + HealPredictionDB.HealAbsorbs.UseStripedTexture = value + updateCallback() + end) UseStripedTextureHealAbsorbToggle:SetRelativeWidth(0.5) HealAbsorbSettings:AddChild(UseStripedTextureHealAbsorbToggle) @@ -691,17 +1082,25 @@ local function CreateHealPredictionSettings(containerParent, unit, updateCallbac HealAbsorbColourPicker:SetLabel("Heal Absorb Colour") local R2, G2, B2, A2 = unpack(HealPredictionDB.HealAbsorbs.Colour) HealAbsorbColourPicker:SetColor(R2, G2, B2, A2) - HealAbsorbColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) HealPredictionDB.HealAbsorbs.Colour = {r, g, b, a} updateCallback() end) + HealAbsorbColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b, a) + HealPredictionDB.HealAbsorbs.Colour = { r, g, b, a } + updateCallback() + end) HealAbsorbColourPicker:SetHasAlpha(true) HealAbsorbColourPicker:SetRelativeWidth(0.5) HealAbsorbSettings:AddChild(HealAbsorbColourPicker) local HealAbsorbPositionDropdown = AG:Create("Dropdown") - HealAbsorbPositionDropdown:SetList({["LEFT"] = "Left", ["RIGHT"] = "Right"}) + HealAbsorbPositionDropdown:SetList({ ["LEFT"] = "Left", ["RIGHT"] = "Right" }) HealAbsorbPositionDropdown:SetLabel("Position") HealAbsorbPositionDropdown:SetValue(HealPredictionDB.HealAbsorbs.Position) HealAbsorbPositionDropdown:SetRelativeWidth(0.5) - HealAbsorbPositionDropdown:SetCallback("OnValueChanged", function(_, _, value) HealPredictionDB.HealAbsorbs.Position = value updateCallback() end) + HealAbsorbPositionDropdown:SetCallback("OnValueChanged", + function(_, _, value) + HealPredictionDB.HealAbsorbs.Position = value + updateCallback() + end) HealAbsorbSettings:AddChild(HealAbsorbPositionDropdown) function RefreshHealPredictionSettings() @@ -721,21 +1120,35 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFCast Bar|r") Toggle:SetValue(CastBarDB.Enabled) - Toggle:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Enabled = value updateCallback() RefreshCastBarBarSettings() end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + CastBarDB.Enabled = value + updateCallback() + RefreshCastBarBarSettings() + end) Toggle:SetRelativeWidth(0.33) LayoutContainer:AddChild(Toggle) local MatchParentWidthToggle = AG:Create("CheckBox") MatchParentWidthToggle:SetLabel("Match Frame Width") MatchParentWidthToggle:SetValue(CastBarDB.MatchParentWidth) - MatchParentWidthToggle:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.MatchParentWidth = value updateCallback() RefreshCastBarBarSettings() end) + MatchParentWidthToggle:SetCallback("OnValueChanged", + function(_, _, value) + CastBarDB.MatchParentWidth = value + updateCallback() + RefreshCastBarBarSettings() + end) MatchParentWidthToggle:SetRelativeWidth(0.33) LayoutContainer:AddChild(MatchParentWidthToggle) local InverseGrowthDirectionToggle = AG:Create("CheckBox") InverseGrowthDirectionToggle:SetLabel("Inverse Growth Direction") InverseGrowthDirectionToggle:SetValue(CastBarDB.Inverse) - InverseGrowthDirectionToggle:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Inverse = value updateCallback() end) + InverseGrowthDirectionToggle:SetCallback("OnValueChanged", + function(_, _, value) + CastBarDB.Inverse = value + updateCallback() + end) InverseGrowthDirectionToggle:SetRelativeWidth(0.33) LayoutContainer:AddChild(InverseGrowthDirectionToggle) @@ -744,7 +1157,10 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) WidthSlider:SetValue(CastBarDB.Width) WidthSlider:SetSliderValues(1, 1000, 0.1) WidthSlider:SetRelativeWidth(0.5) - WidthSlider:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Width = value updateCallback() end) + WidthSlider:SetCallback("OnValueChanged", function(_, _, value) + CastBarDB.Width = value + updateCallback() + end) LayoutContainer:AddChild(WidthSlider) local HeightSlider = AG:Create("Slider") @@ -752,7 +1168,10 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) HeightSlider:SetValue(CastBarDB.Height) HeightSlider:SetSliderValues(1, 1000, 0.1) HeightSlider:SetRelativeWidth(0.5) - HeightSlider:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Height = value updateCallback() end) + HeightSlider:SetCallback("OnValueChanged", function(_, _, value) + CastBarDB.Height = value + updateCallback() + end) LayoutContainer:AddChild(HeightSlider) local AnchorFromDropdown = AG:Create("Dropdown") @@ -760,7 +1179,11 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(CastBarDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Layout[1] = value updateCallback() end) + AnchorFromDropdown:SetCallback("OnValueChanged", + function(_, _, value) + CastBarDB.Layout[1] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -768,7 +1191,10 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(CastBarDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Layout[2] = value updateCallback() end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) + CastBarDB.Layout[2] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -776,7 +1202,10 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) XPosSlider:SetValue(CastBarDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Layout[3] = value updateCallback() end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) + CastBarDB.Layout[3] = value + updateCallback() + end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -784,7 +1213,10 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) YPosSlider:SetValue(CastBarDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Layout[4] = value updateCallback() end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) + CastBarDB.Layout[4] = value + updateCallback() + end) LayoutContainer:AddChild(YPosSlider) local FrameStrataDropdown = AG:Create("Dropdown") @@ -792,7 +1224,11 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) FrameStrataDropdown:SetLabel("Frame Strata") FrameStrataDropdown:SetValue(CastBarDB.FrameStrata) FrameStrataDropdown:SetRelativeWidth(0.33) - FrameStrataDropdown:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.FrameStrata = value updateCallback() end) + FrameStrataDropdown:SetCallback("OnValueChanged", + function(_, _, value) + CastBarDB.FrameStrata = value + updateCallback() + end) LayoutContainer:AddChild(FrameStrataDropdown) local ColourContainer = GUIWidgets.CreateInlineGroup(containerParent, "Colours & Toggles") @@ -801,7 +1237,11 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) ForegroundColourPicker:SetLabel("Foreground") local R, G, B, A = unpack(CastBarDB.Foreground) ForegroundColourPicker:SetColor(R, G, B, A) - ForegroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) CastBarDB.Foreground = {r, g, b, a} updateCallback() end) + ForegroundColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b, a) + CastBarDB.Foreground = { r, g, b, a } + updateCallback() + end) ForegroundColourPicker:SetHasAlpha(true) ForegroundColourPicker:SetRelativeWidth(0.33) ColourContainer:AddChild(ForegroundColourPicker) @@ -810,7 +1250,11 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) BackgroundColourPicker:SetLabel("Background") local R2, G2, B2, A2 = unpack(CastBarDB.Background) BackgroundColourPicker:SetColor(R2, G2, B2, A2) - BackgroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) CastBarDB.Background = {r, g, b, a} updateCallback() end) + BackgroundColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b, a) + CastBarDB.Background = { r, g, b, a } + updateCallback() + end) BackgroundColourPicker:SetHasAlpha(true) BackgroundColourPicker:SetRelativeWidth(0.33) ColourContainer:AddChild(BackgroundColourPicker) @@ -819,7 +1263,11 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) NotInterruptibleColourPicker:SetLabel("Not Interruptible") local R3, G3, B3 = unpack(CastBarDB.NotInterruptibleColour) NotInterruptibleColourPicker:SetColor(R3, G3, B3) - NotInterruptibleColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) CastBarDB.NotInterruptibleColour = {r, g, b, a} updateCallback() end) + NotInterruptibleColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b, a) + CastBarDB.NotInterruptibleColour = { r, g, b, a } + updateCallback() + end) NotInterruptibleColourPicker:SetHasAlpha(true) NotInterruptibleColourPicker:SetRelativeWidth(0.33) ColourContainer:AddChild(NotInterruptibleColourPicker) @@ -860,16 +1308,25 @@ local function CreateCastBarIconSettings(containerParent, unit, updateCallback) local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFCast Bar Icon|r") Toggle:SetValue(CastBarIconDB.Enabled) - Toggle:SetCallback("OnValueChanged", function(_, _, value) CastBarIconDB.Enabled = value updateCallback() RefreshCastBarIconSettings() end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + CastBarIconDB.Enabled = value + updateCallback() + RefreshCastBarIconSettings() + end) Toggle:SetRelativeWidth(0.5) LayoutContainer:AddChild(Toggle) local PositionDropdown = AG:Create("Dropdown") - PositionDropdown:SetList({["LEFT"] = "Left", ["RIGHT"] = "Right"}) + PositionDropdown:SetList({ ["LEFT"] = "Left", ["RIGHT"] = "Right" }) PositionDropdown:SetLabel("Position") PositionDropdown:SetValue(CastBarIconDB.Position) PositionDropdown:SetRelativeWidth(0.5) - PositionDropdown:SetCallback("OnValueChanged", function(_, _, value) CastBarIconDB.Position = value updateCallback() end) + PositionDropdown:SetCallback("OnValueChanged", + function(_, _, value) + CastBarIconDB.Position = value + updateCallback() + end) LayoutContainer:AddChild(PositionDropdown) function RefreshCastBarIconSettings() @@ -892,7 +1349,12 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC local SpellNameToggle = AG:Create("CheckBox") SpellNameToggle:SetLabel("Enable |cFF8080FFSpell Name Text|r") SpellNameToggle:SetValue(SpellNameTextDB.Enabled) - SpellNameToggle:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.Enabled = value updateCallback() RefreshCastBarSpellNameSettings() end) + SpellNameToggle:SetCallback("OnValueChanged", + function(_, _, value) + SpellNameTextDB.Enabled = value + updateCallback() + RefreshCastBarSpellNameSettings() + end) SpellNameToggle:SetRelativeWidth(0.5) SpellNameContainer:AddChild(SpellNameToggle) @@ -900,7 +1362,11 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC SpellNameColourPicker:SetLabel("Colour") local R, G, B = unpack(SpellNameTextDB.Colour) SpellNameColourPicker:SetColor(R, G, B) - SpellNameColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) SpellNameTextDB.Colour = {r, g, b} updateCallback() end) + SpellNameColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b) + SpellNameTextDB.Colour = { r, g, b } + updateCallback() + end) SpellNameColourPicker:SetHasAlpha(false) SpellNameColourPicker:SetRelativeWidth(0.5) SpellNameContainer:AddChild(SpellNameColourPicker) @@ -911,7 +1377,11 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC SpellNameAnchorFromDropdown:SetLabel("Anchor From") SpellNameAnchorFromDropdown:SetValue(SpellNameTextDB.Layout[1]) SpellNameAnchorFromDropdown:SetRelativeWidth(0.5) - SpellNameAnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.Layout[1] = value updateCallback() end) + SpellNameAnchorFromDropdown:SetCallback("OnValueChanged", + function(_, _, value) + SpellNameTextDB.Layout[1] = value + updateCallback() + end) SpellNameLayoutContainer:AddChild(SpellNameAnchorFromDropdown) local SpellNameAnchorToDropdown = AG:Create("Dropdown") @@ -919,7 +1389,11 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC SpellNameAnchorToDropdown:SetLabel("Anchor To") SpellNameAnchorToDropdown:SetValue(SpellNameTextDB.Layout[2]) SpellNameAnchorToDropdown:SetRelativeWidth(0.5) - SpellNameAnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.Layout[2] = value updateCallback() end) + SpellNameAnchorToDropdown:SetCallback("OnValueChanged", + function(_, _, value) + SpellNameTextDB.Layout[2] = value + updateCallback() + end) SpellNameLayoutContainer:AddChild(SpellNameAnchorToDropdown) local SpellNameXPosSlider = AG:Create("Slider") @@ -927,7 +1401,11 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC SpellNameXPosSlider:SetValue(SpellNameTextDB.Layout[3]) SpellNameXPosSlider:SetSliderValues(-1000, 1000, 0.1) SpellNameXPosSlider:SetRelativeWidth(0.25) - SpellNameXPosSlider:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.Layout[3] = value updateCallback() end) + SpellNameXPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + SpellNameTextDB.Layout[3] = value + updateCallback() + end) SpellNameLayoutContainer:AddChild(SpellNameXPosSlider) local SpellNameYPosSlider = AG:Create("Slider") @@ -935,7 +1413,11 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC SpellNameYPosSlider:SetValue(SpellNameTextDB.Layout[4]) SpellNameYPosSlider:SetSliderValues(-1000, 1000, 0.1) SpellNameYPosSlider:SetRelativeWidth(0.25) - SpellNameYPosSlider:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.Layout[4] = value updateCallback() end) + SpellNameYPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + SpellNameTextDB.Layout[4] = value + updateCallback() + end) SpellNameLayoutContainer:AddChild(SpellNameYPosSlider) local SpellNameFontSizeSlider = AG:Create("Slider") @@ -943,7 +1425,11 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC SpellNameFontSizeSlider:SetValue(SpellNameTextDB.FontSize) SpellNameFontSizeSlider:SetSliderValues(8, 64, 1) SpellNameFontSizeSlider:SetRelativeWidth(0.25) - SpellNameFontSizeSlider:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.FontSize = value updateCallback() end) + SpellNameFontSizeSlider:SetCallback("OnValueChanged", + function(_, _, value) + SpellNameTextDB.FontSize = value + updateCallback() + end) SpellNameLayoutContainer:AddChild(SpellNameFontSizeSlider) local MaxCharsSlider = AG:Create("Slider") @@ -951,7 +1437,11 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC MaxCharsSlider:SetValue(SpellNameTextDB.MaxChars) MaxCharsSlider:SetSliderValues(1, 64, 1) MaxCharsSlider:SetRelativeWidth(0.25) - MaxCharsSlider:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.MaxChars = value updateCallback() end) + MaxCharsSlider:SetCallback("OnValueChanged", + function(_, _, value) + SpellNameTextDB.MaxChars = value + updateCallback() + end) SpellNameLayoutContainer:AddChild(MaxCharsSlider) function RefreshCastBarSpellNameSettings() @@ -981,12 +1471,17 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa local CastBarTextDB = UUF.db.profile.Units[unit].CastBar.Text local DurationTextDB = CastBarTextDB.Duration - local DurationContainer = GUIWidgets.CreateInlineGroup(containerParent, "Duration Settings") + local DurationContainer = GUIWidgets.CreateInlineGroup(containerParent, "Duration Settings") local DurationToggle = AG:Create("CheckBox") DurationToggle:SetLabel("Enable |cFF8080FFDuration Text|r") DurationToggle:SetValue(DurationTextDB.Enabled) - DurationToggle:SetCallback("OnValueChanged", function(_, _, value) DurationTextDB.Enabled = value updateCallback() RefreshCastBarDurationSettings() end) + DurationToggle:SetCallback("OnValueChanged", + function(_, _, value) + DurationTextDB.Enabled = value + updateCallback() + RefreshCastBarDurationSettings() + end) DurationToggle:SetRelativeWidth(0.5) DurationContainer:AddChild(DurationToggle) @@ -994,7 +1489,11 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa DurationColourPicker:SetLabel("Colour") local R, G, B = unpack(DurationTextDB.Colour) DurationColourPicker:SetColor(R, G, B) - DurationColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) DurationTextDB.Colour = {r, g, b} updateCallback() end) + DurationColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b) + DurationTextDB.Colour = { r, g, b } + updateCallback() + end) DurationColourPicker:SetHasAlpha(false) DurationColourPicker:SetRelativeWidth(0.5) DurationContainer:AddChild(DurationColourPicker) @@ -1005,7 +1504,11 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa DurationAnchorFromDropdown:SetLabel("Anchor From") DurationAnchorFromDropdown:SetValue(DurationTextDB.Layout[1]) DurationAnchorFromDropdown:SetRelativeWidth(0.5) - DurationAnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) DurationTextDB.Layout[1] = value updateCallback() end) + DurationAnchorFromDropdown:SetCallback("OnValueChanged", + function(_, _, value) + DurationTextDB.Layout[1] = value + updateCallback() + end) DurationLayoutContainer:AddChild(DurationAnchorFromDropdown) local DurationAnchorToDropdown = AG:Create("Dropdown") @@ -1013,7 +1516,11 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa DurationAnchorToDropdown:SetLabel("Anchor To") DurationAnchorToDropdown:SetValue(DurationTextDB.Layout[2]) DurationAnchorToDropdown:SetRelativeWidth(0.5) - DurationAnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) DurationTextDB.Layout[2] = value updateCallback() end) + DurationAnchorToDropdown:SetCallback("OnValueChanged", + function(_, _, value) + DurationTextDB.Layout[2] = value + updateCallback() + end) DurationLayoutContainer:AddChild(DurationAnchorToDropdown) local DurationXPosSlider = AG:Create("Slider") @@ -1021,7 +1528,11 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa DurationXPosSlider:SetValue(DurationTextDB.Layout[3]) DurationXPosSlider:SetSliderValues(-1000, 1000, 0.1) DurationXPosSlider:SetRelativeWidth(0.33) - DurationXPosSlider:SetCallback("OnValueChanged", function(_, _, value) DurationTextDB.Layout[3] = value updateCallback() end) + DurationXPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + DurationTextDB.Layout[3] = value + updateCallback() + end) DurationLayoutContainer:AddChild(DurationXPosSlider) local DurationYPosSlider = AG:Create("Slider") @@ -1029,7 +1540,11 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa DurationYPosSlider:SetValue(DurationTextDB.Layout[4]) DurationYPosSlider:SetSliderValues(-1000, 1000, 0.1) DurationYPosSlider:SetRelativeWidth(0.33) - DurationYPosSlider:SetCallback("OnValueChanged", function(_, _, value) DurationTextDB.Layout[4] = value updateCallback() end) + DurationYPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + DurationTextDB.Layout[4] = value + updateCallback() + end) DurationLayoutContainer:AddChild(DurationYPosSlider) local DurationFontSizeSlider = AG:Create("Slider") @@ -1037,7 +1552,11 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa DurationFontSizeSlider:SetValue(DurationTextDB.FontSize) DurationFontSizeSlider:SetSliderValues(8, 64, 1) DurationFontSizeSlider:SetRelativeWidth(0.33) - DurationFontSizeSlider:SetCallback("OnValueChanged", function(_, _, value) DurationTextDB.FontSize = value updateCallback() end) + DurationFontSizeSlider:SetCallback("OnValueChanged", + function(_, _, value) + DurationTextDB.FontSize = value + updateCallback() + end) DurationLayoutContainer:AddChild(DurationFontSizeSlider) function RefreshCastBarDurationSettings() @@ -1062,18 +1581,49 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa end local function CreateCastBarSettings(containerParent, unit) - local function SelectCastBarTab(CastBarContainer, _, CastBarTab) SaveSubTab(unit, "CastBar", CastBarTab) CastBarContainer:ReleaseChildren() if CastBarTab == "Bar" then - CreateCastBarBarSettings(CastBarContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitCastBar(UUF[unit:upper()], unit) end end) + CreateCastBarBarSettings(CastBarContainer, unit, + function() + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitCastBar(UUF[unit:upper()], + unit) + end + end) elseif CastBarTab == "Icon" then - CreateCastBarIconSettings(CastBarContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitCastBar(UUF[unit:upper()], unit) end end) + CreateCastBarIconSettings(CastBarContainer, unit, + function() + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitCastBar(UUF[unit:upper()], + unit) + end + end) elseif CastBarTab == "SpellName" then - CreateCastBarSpellNameTextSettings(CastBarContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitCastBar(UUF[unit:upper()], unit) end end) + CreateCastBarSpellNameTextSettings(CastBarContainer, unit, + function() + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitCastBar(UUF[unit:upper()], + unit) + end + end) elseif CastBarTab == "Duration" then - CreateCastBarDurationTextSettings(CastBarContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitCastBar(UUF[unit:upper()], unit) end end) + CreateCastBarDurationTextSettings(CastBarContainer, unit, + function() + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitCastBar(UUF[unit:upper()], + unit) + end + end) end end @@ -1081,10 +1631,10 @@ local function CreateCastBarSettings(containerParent, unit) CastBarTabGroup:SetLayout("Flow") CastBarTabGroup:SetFullWidth(true) CastBarTabGroup:SetTabs({ - {text = "Bar", value = "Bar"}, - {text = "Icon" , value = "Icon"}, - {text = "Text: |cFFFFFFFFSpell Name|r", value = "SpellName"}, - {text = "Text: |cFFFFFFFFDuration|r", value = "Duration"}, + { text = "Bar", value = "Bar" }, + { text = "Icon", value = "Icon" }, + { text = "Text: |cFFFFFFFFSpell Name|r", value = "SpellName" }, + { text = "Text: |cFFFFFFFFDuration|r", value = "Duration" }, }) CastBarTabGroup:SetCallback("OnGroupSelected", SelectCastBarTab) CastBarTabGroup:SelectTab(GetSavedSubTab(unit, "CastBar", "Bar")) @@ -1100,14 +1650,23 @@ local function CreatePowerBarSettings(containerParent, unit, updateCallback) local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFPower Bar|r") Toggle:SetValue(PowerBarDB.Enabled) - Toggle:SetCallback("OnValueChanged", function(_, _, value) PowerBarDB.Enabled = value updateCallback() RefreshPowerBarGUI() end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + PowerBarDB.Enabled = value + updateCallback() + RefreshPowerBarGUI() + end) Toggle:SetRelativeWidth(0.33) LayoutContainer:AddChild(Toggle) local InverseGrowthDirectionToggle = AG:Create("CheckBox") InverseGrowthDirectionToggle:SetLabel("Inverse Growth Direction") InverseGrowthDirectionToggle:SetValue(PowerBarDB.Inverse) - InverseGrowthDirectionToggle:SetCallback("OnValueChanged", function(_, _, value) PowerBarDB.Inverse = value updateCallback() end) + InverseGrowthDirectionToggle:SetCallback("OnValueChanged", + function(_, _, value) + PowerBarDB.Inverse = value + updateCallback() + end) InverseGrowthDirectionToggle:SetRelativeWidth(0.33) LayoutContainer:AddChild(InverseGrowthDirectionToggle) @@ -1116,7 +1675,10 @@ local function CreatePowerBarSettings(containerParent, unit, updateCallback) HeightSlider:SetValue(PowerBarDB.Height) HeightSlider:SetSliderValues(1, FrameDB.Height - 2, 0.1) HeightSlider:SetRelativeWidth(0.33) - HeightSlider:SetCallback("OnValueChanged", function(_, _, value) PowerBarDB.Height = value updateCallback() end) + HeightSlider:SetCallback("OnValueChanged", function(_, _, value) + PowerBarDB.Height = value + updateCallback() + end) LayoutContainer:AddChild(HeightSlider) local ColourContainer = GUIWidgets.CreateInlineGroup(containerParent, "Colours & Toggles") @@ -1124,21 +1686,35 @@ local function CreatePowerBarSettings(containerParent, unit, updateCallback) local SmoothUpdatesToggle = AG:Create("CheckBox") SmoothUpdatesToggle:SetLabel("Smooth Updates") SmoothUpdatesToggle:SetValue(PowerBarDB.Smooth) - SmoothUpdatesToggle:SetCallback("OnValueChanged", function(_, _, value) PowerBarDB.Smooth = value updateCallback() end) + SmoothUpdatesToggle:SetCallback("OnValueChanged", + function(_, _, value) + PowerBarDB.Smooth = value + updateCallback() + end) SmoothUpdatesToggle:SetRelativeWidth(0.33) ColourContainer:AddChild(SmoothUpdatesToggle) local ColourByTypeToggle = AG:Create("CheckBox") ColourByTypeToggle:SetLabel("Colour By Type") ColourByTypeToggle:SetValue(PowerBarDB.ColourByType) - ColourByTypeToggle:SetCallback("OnValueChanged", function(_, _, value) PowerBarDB.ColourByType = value updateCallback() RefreshPowerBarGUI() end) + ColourByTypeToggle:SetCallback("OnValueChanged", + function(_, _, value) + PowerBarDB.ColourByType = value + updateCallback() + RefreshPowerBarGUI() + end) ColourByTypeToggle:SetRelativeWidth(0.33) ColourContainer:AddChild(ColourByTypeToggle) local ColourByClassToggle = AG:Create("CheckBox") ColourByClassToggle:SetLabel("Colour By Class") ColourByClassToggle:SetValue(PowerBarDB.ColourByClass) - ColourByClassToggle:SetCallback("OnValueChanged", function(_, _, value) PowerBarDB.ColourByClass = value updateCallback() RefreshPowerBarGUI() end) + ColourByClassToggle:SetCallback("OnValueChanged", + function(_, _, value) + PowerBarDB.ColourByClass = value + updateCallback() + RefreshPowerBarGUI() + end) ColourByClassToggle:SetRelativeWidth(0.33) ColourContainer:AddChild(ColourByClassToggle) @@ -1154,7 +1730,11 @@ local function CreatePowerBarSettings(containerParent, unit, updateCallback) ForegroundColourPicker:SetLabel("Foreground Colour") local R, G, B, A = unpack(PowerBarDB.Foreground) ForegroundColourPicker:SetColor(R, G, B, A) - ForegroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) PowerBarDB.Foreground = {r, g, b, a} updateCallback() end) + ForegroundColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b, a) + PowerBarDB.Foreground = { r, g, b, a } + updateCallback() + end) ForegroundColourPicker:SetHasAlpha(true) ForegroundColourPicker:SetRelativeWidth(0.5) ForegroundColourPicker:SetDisabled(PowerBarDB.ColourByClass or PowerBarDB.ColourByType) @@ -1164,7 +1744,11 @@ local function CreatePowerBarSettings(containerParent, unit, updateCallback) BackgroundColourPicker:SetLabel("Background Colour") local R2, G2, B2, A2 = unpack(PowerBarDB.Background) BackgroundColourPicker:SetColor(R2, G2, B2, A2) - BackgroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) PowerBarDB.Background = {r, g, b, a} updateCallback() end) + BackgroundColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b, a) + PowerBarDB.Background = { r, g, b, a } + updateCallback() + end) BackgroundColourPicker:SetHasAlpha(true) BackgroundColourPicker:SetRelativeWidth(0.5) BackgroundColourPicker:SetDisabled(PowerBarDB.ColourBackgroundByType) @@ -1203,21 +1787,31 @@ end local function CreateAlternativePowerBarSettings(containerParent, unit, updateCallback) local AlternativePowerBarDB = UUF.db.profile.Units[unit].AlternativePowerBar - GUIWidgets.CreateInformationTag(containerParent, "The |cFF8080FFAlternative Power Bar|r will display |cFF4080FFMana|r for classes that have an alternative resource.") + GUIWidgets.CreateInformationTag(containerParent, + "The |cFF8080FFAlternative Power Bar|r will display |cFF4080FFMana|r for classes that have an alternative resource.") local AlternativePowerBarSettings = GUIWidgets.CreateInlineGroup(containerParent, "Alternative Power Bar Settings") local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFAlternative Power Bar|r") Toggle:SetValue(AlternativePowerBarDB.Enabled) - Toggle:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Enabled = value updateCallback() RefreshAlternativePowerBarGUI() end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + AlternativePowerBarDB.Enabled = value + updateCallback() + RefreshAlternativePowerBarGUI() + end) Toggle:SetRelativeWidth(0.5) AlternativePowerBarSettings:AddChild(Toggle) local InverseGrowthDirectionToggle = AG:Create("CheckBox") InverseGrowthDirectionToggle:SetLabel("Inverse Growth Direction") InverseGrowthDirectionToggle:SetValue(AlternativePowerBarDB.Inverse) - InverseGrowthDirectionToggle:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Inverse = value updateCallback() end) + InverseGrowthDirectionToggle:SetCallback("OnValueChanged", + function(_, _, value) + AlternativePowerBarDB.Inverse = value + updateCallback() + end) InverseGrowthDirectionToggle:SetRelativeWidth(0.5) AlternativePowerBarSettings:AddChild(InverseGrowthDirectionToggle) @@ -1228,7 +1822,11 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa WidthSlider:SetValue(AlternativePowerBarDB.Width) WidthSlider:SetSliderValues(1, 1000, 0.1) WidthSlider:SetRelativeWidth(0.5) - WidthSlider:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Width = value updateCallback() end) + WidthSlider:SetCallback("OnValueChanged", + function(_, _, value) + AlternativePowerBarDB.Width = value + updateCallback() + end) LayoutContainer:AddChild(WidthSlider) local HeightSlider = AG:Create("Slider") @@ -1236,7 +1834,11 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa HeightSlider:SetValue(AlternativePowerBarDB.Height) HeightSlider:SetSliderValues(1, 64, 0.1) HeightSlider:SetRelativeWidth(0.5) - HeightSlider:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Height = value updateCallback() end) + HeightSlider:SetCallback("OnValueChanged", + function(_, _, value) + AlternativePowerBarDB.Height = value + updateCallback() + end) LayoutContainer:AddChild(HeightSlider) local AnchorFromDropdown = AG:Create("Dropdown") @@ -1244,7 +1846,11 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(AlternativePowerBarDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Layout[1] = value updateCallback() end) + AnchorFromDropdown:SetCallback("OnValueChanged", + function(_, _, value) + AlternativePowerBarDB.Layout[1] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -1252,7 +1858,11 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(AlternativePowerBarDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Layout[2] = value updateCallback() end) + AnchorToDropdown:SetCallback("OnValueChanged", + function(_, _, value) + AlternativePowerBarDB.Layout[2] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -1260,7 +1870,11 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa XPosSlider:SetValue(AlternativePowerBarDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.5) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Layout[3] = value updateCallback() end) + XPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + AlternativePowerBarDB.Layout[3] = value + updateCallback() + end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -1268,7 +1882,11 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa YPosSlider:SetValue(AlternativePowerBarDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.5) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Layout[4] = value updateCallback() end) + YPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + AlternativePowerBarDB.Layout[4] = value + updateCallback() + end) LayoutContainer:AddChild(YPosSlider) local ColourContainer = GUIWidgets.CreateInlineGroup(containerParent, "Colours & Toggles") @@ -1276,7 +1894,12 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa local ColourByTypeToggle = AG:Create("CheckBox") ColourByTypeToggle:SetLabel("Colour By Type") ColourByTypeToggle:SetValue(AlternativePowerBarDB.ColourByType) - ColourByTypeToggle:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.ColourByType = value updateCallback() RefreshAlternativePowerBarGUI() end) + ColourByTypeToggle:SetCallback("OnValueChanged", + function(_, _, value) + AlternativePowerBarDB.ColourByType = value + updateCallback() + RefreshAlternativePowerBarGUI() + end) ColourByTypeToggle:SetRelativeWidth(0.33) ColourContainer:AddChild(ColourByTypeToggle) @@ -1284,7 +1907,11 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa ForegroundColourPicker:SetLabel("Foreground Colour") local R, G, B, A = unpack(AlternativePowerBarDB.Foreground) ForegroundColourPicker:SetColor(R, G, B, A) - ForegroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) AlternativePowerBarDB.Foreground = {r, g, b, a} updateCallback() end) + ForegroundColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b, a) + AlternativePowerBarDB.Foreground = { r, g, b, a } + updateCallback() + end) ForegroundColourPicker:SetHasAlpha(true) ForegroundColourPicker:SetRelativeWidth(0.33) ForegroundColourPicker:SetDisabled(AlternativePowerBarDB.ColourByType) @@ -1294,7 +1921,11 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa BackgroundColourPicker:SetLabel("Background Colour") local R2, G2, B2, A2 = unpack(AlternativePowerBarDB.Background) BackgroundColourPicker:SetColor(R2, G2, B2, A2) - BackgroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) AlternativePowerBarDB.Background = {r, g, b, a} updateCallback() end) + BackgroundColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b, a) + AlternativePowerBarDB.Background = { r, g, b, a } + updateCallback() + end) BackgroundColourPicker:SetHasAlpha(true) BackgroundColourPicker:SetRelativeWidth(0.33) ColourContainer:AddChild(BackgroundColourPicker) @@ -1325,14 +1956,23 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFPortrait|r") Toggle:SetValue(PortraitDB.Enabled) - Toggle:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Enabled = value updateCallback() RefreshPortraitGUI() end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + PortraitDB.Enabled = value + updateCallback() + RefreshPortraitGUI() + end) Toggle:SetRelativeWidth(0.5) ToggleContainer:AddChild(Toggle) local UseClassPortraitToggle = AG:Create("CheckBox") UseClassPortraitToggle:SetLabel("Use Class Portrait") UseClassPortraitToggle:SetValue(PortraitDB.UseClassPortrait) - UseClassPortraitToggle:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.UseClassPortrait = value updateCallback() end) + UseClassPortraitToggle:SetCallback("OnValueChanged", + function(_, _, value) + PortraitDB.UseClassPortrait = value + updateCallback() + end) UseClassPortraitToggle:SetRelativeWidth(0.5) ToggleContainer:AddChild(UseClassPortraitToggle) @@ -1343,7 +1983,11 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(PortraitDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Layout[1] = value updateCallback() end) + AnchorFromDropdown:SetCallback("OnValueChanged", + function(_, _, value) + PortraitDB.Layout[1] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -1351,7 +1995,11 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(PortraitDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Layout[2] = value updateCallback() end) + AnchorToDropdown:SetCallback("OnValueChanged", + function(_, _, value) + PortraitDB.Layout[2] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -1359,7 +2007,10 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) XPosSlider:SetValue(PortraitDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Layout[3] = value updateCallback() end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) + PortraitDB.Layout[3] = value + updateCallback() + end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -1367,7 +2018,10 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) YPosSlider:SetValue(PortraitDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Layout[4] = value updateCallback() end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) + PortraitDB.Layout[4] = value + updateCallback() + end) LayoutContainer:AddChild(YPosSlider) local ZoomSlider = AG:Create("Slider") @@ -1375,7 +2029,10 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) ZoomSlider:SetValue(PortraitDB.Zoom) ZoomSlider:SetSliderValues(0, 1, 0.01) ZoomSlider:SetRelativeWidth(0.33) - ZoomSlider:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Zoom = value updateCallback() end) + ZoomSlider:SetCallback("OnValueChanged", function(_, _, value) + PortraitDB.Zoom = value + updateCallback() + end) ZoomSlider:SetIsPercent(true) LayoutContainer:AddChild(ZoomSlider) @@ -1384,7 +2041,10 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) WidthSlider:SetValue(PortraitDB.Width) WidthSlider:SetSliderValues(8, 64, 0.1) WidthSlider:SetRelativeWidth(0.5) - WidthSlider:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Width = value updateCallback() end) + WidthSlider:SetCallback("OnValueChanged", function(_, _, value) + PortraitDB.Width = value + updateCallback() + end) LayoutContainer:AddChild(WidthSlider) local HeightSlider = AG:Create("Slider") @@ -1392,7 +2052,10 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) HeightSlider:SetValue(PortraitDB.Height) HeightSlider:SetSliderValues(8, 64, 0.1) HeightSlider:SetRelativeWidth(0.5) - HeightSlider:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Height = value updateCallback() end) + HeightSlider:SetCallback("OnValueChanged", function(_, _, value) + PortraitDB.Height = value + updateCallback() + end) LayoutContainer:AddChild(HeightSlider) function RefreshPortraitGUI() @@ -1416,7 +2079,12 @@ local function CreateRaidTargetMarkerSettings(containerParent, unit, updateCallb local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFRaid Target Marker|r Indicator") Toggle:SetValue(RaidTargetMarkerDB.Enabled) - Toggle:SetCallback("OnValueChanged", function(_, _, value) RaidTargetMarkerDB.Enabled = value updateCallback() RefreshStatusGUI() end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + RaidTargetMarkerDB.Enabled = value + updateCallback() + RefreshStatusGUI() + end) Toggle:SetRelativeWidth(1) ToggleContainer:AddChild(Toggle) @@ -1427,7 +2095,11 @@ local function CreateRaidTargetMarkerSettings(containerParent, unit, updateCallb AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(RaidTargetMarkerDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) RaidTargetMarkerDB.Layout[1] = value updateCallback() end) + AnchorFromDropdown:SetCallback("OnValueChanged", + function(_, _, value) + RaidTargetMarkerDB.Layout[1] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -1435,7 +2107,11 @@ local function CreateRaidTargetMarkerSettings(containerParent, unit, updateCallb AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(RaidTargetMarkerDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) RaidTargetMarkerDB.Layout[2] = value updateCallback() end) + AnchorToDropdown:SetCallback("OnValueChanged", + function(_, _, value) + RaidTargetMarkerDB.Layout[2] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -1443,7 +2119,11 @@ local function CreateRaidTargetMarkerSettings(containerParent, unit, updateCallb XPosSlider:SetValue(RaidTargetMarkerDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) RaidTargetMarkerDB.Layout[3] = value updateCallback() end) + XPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + RaidTargetMarkerDB.Layout[3] = value + updateCallback() + end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -1451,7 +2131,11 @@ local function CreateRaidTargetMarkerSettings(containerParent, unit, updateCallb YPosSlider:SetValue(RaidTargetMarkerDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) RaidTargetMarkerDB.Layout[4] = value updateCallback() end) + YPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + RaidTargetMarkerDB.Layout[4] = value + updateCallback() + end) LayoutContainer:AddChild(YPosSlider) local SizeSlider = AG:Create("Slider") @@ -1459,7 +2143,10 @@ local function CreateRaidTargetMarkerSettings(containerParent, unit, updateCallb SizeSlider:SetValue(RaidTargetMarkerDB.Size) SizeSlider:SetSliderValues(8, 64, 1) SizeSlider:SetRelativeWidth(0.33) - SizeSlider:SetCallback("OnValueChanged", function(_, _, value) RaidTargetMarkerDB.Size = value updateCallback() end) + SizeSlider:SetCallback("OnValueChanged", function(_, _, value) + RaidTargetMarkerDB.Size = value + updateCallback() + end) LayoutContainer:AddChild(SizeSlider) function RefreshStatusGUI() @@ -1483,7 +2170,12 @@ local function CreateLeaderAssistaintSettings(containerParent, unit, updateCallb local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFLeader|r & |cFF8080FFAssistant|r Indicator") Toggle:SetValue(LeaderAssistantDB.Enabled) - Toggle:SetCallback("OnValueChanged", function(_, _, value) LeaderAssistantDB.Enabled = value updateCallback() RefreshStatusGUI() end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + LeaderAssistantDB.Enabled = value + updateCallback() + RefreshStatusGUI() + end) Toggle:SetRelativeWidth(1) ToggleContainer:AddChild(Toggle) @@ -1494,7 +2186,11 @@ local function CreateLeaderAssistaintSettings(containerParent, unit, updateCallb AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(LeaderAssistantDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) LeaderAssistantDB.Layout[1] = value updateCallback() end) + AnchorFromDropdown:SetCallback("OnValueChanged", + function(_, _, value) + LeaderAssistantDB.Layout[1] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -1502,7 +2198,11 @@ local function CreateLeaderAssistaintSettings(containerParent, unit, updateCallb AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(LeaderAssistantDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) LeaderAssistantDB.Layout[2] = value updateCallback() end) + AnchorToDropdown:SetCallback("OnValueChanged", + function(_, _, value) + LeaderAssistantDB.Layout[2] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -1510,7 +2210,11 @@ local function CreateLeaderAssistaintSettings(containerParent, unit, updateCallb XPosSlider:SetValue(LeaderAssistantDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) LeaderAssistantDB.Layout[3] = value updateCallback() end) + XPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + LeaderAssistantDB.Layout[3] = value + updateCallback() + end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -1518,7 +2222,11 @@ local function CreateLeaderAssistaintSettings(containerParent, unit, updateCallb YPosSlider:SetValue(LeaderAssistantDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) LeaderAssistantDB.Layout[4] = value updateCallback() end) + YPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + LeaderAssistantDB.Layout[4] = value + updateCallback() + end) LayoutContainer:AddChild(YPosSlider) local SizeSlider = AG:Create("Slider") @@ -1526,7 +2234,10 @@ local function CreateLeaderAssistaintSettings(containerParent, unit, updateCallb SizeSlider:SetValue(LeaderAssistantDB.Size) SizeSlider:SetSliderValues(8, 64, 1) SizeSlider:SetRelativeWidth(0.33) - SizeSlider:SetCallback("OnValueChanged", function(_, _, value) LeaderAssistantDB.Size = value updateCallback() end) + SizeSlider:SetCallback("OnValueChanged", function(_, _, value) + LeaderAssistantDB.Size = value + updateCallback() + end) LayoutContainer:AddChild(SizeSlider) function RefreshStatusGUI() @@ -1553,9 +2264,14 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb end local Toggle = AG:Create("CheckBox") - Toggle:SetLabel("Enable |cFF8080FF"..statusDB.."|r Indicator") + Toggle:SetLabel("Enable |cFF8080FF" .. statusDB .. "|r Indicator") Toggle:SetValue(StatusDB.Enabled) - Toggle:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Enabled = value updateCallback() RefreshStatusGUI() end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + StatusDB.Enabled = value + updateCallback() + RefreshStatusGUI() + end) Toggle:SetRelativeWidth(0.5) ToggleContainer:AddChild(Toggle) @@ -1564,7 +2280,11 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb StatusTextureDropdown:SetLabel(statusDB .. " Texture") StatusTextureDropdown:SetValue(StatusDB.Texture) StatusTextureDropdown:SetRelativeWidth(0.5) - StatusTextureDropdown:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Texture = value updateCallback() end) + StatusTextureDropdown:SetCallback("OnValueChanged", + function(_, _, value) + StatusDB.Texture = value + updateCallback() + end) ToggleContainer:AddChild(StatusTextureDropdown) local LayoutContainer = GUIWidgets.CreateInlineGroup(containerParent, "Layout & Positioning") @@ -1574,7 +2294,11 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(StatusDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Layout[1] = value updateCallback() end) + AnchorFromDropdown:SetCallback("OnValueChanged", + function(_, _, value) + StatusDB.Layout[1] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -1582,7 +2306,10 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(StatusDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Layout[2] = value updateCallback() end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) + StatusDB.Layout[2] = value + updateCallback() + end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -1590,7 +2317,10 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb XPosSlider:SetValue(StatusDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Layout[3] = value updateCallback() end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) + StatusDB.Layout[3] = value + updateCallback() + end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -1598,7 +2328,10 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb YPosSlider:SetValue(StatusDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Layout[4] = value updateCallback() end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) + StatusDB.Layout[4] = value + updateCallback() + end) LayoutContainer:AddChild(YPosSlider) local SizeSlider = AG:Create("Slider") @@ -1606,7 +2339,10 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb SizeSlider:SetValue(StatusDB.Size) SizeSlider:SetSliderValues(8, 64, 1) SizeSlider:SetRelativeWidth(0.33) - SizeSlider:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Size = value updateCallback() end) + SizeSlider:SetCallback("OnValueChanged", function(_, _, value) + StatusDB.Size = value + updateCallback() + end) LayoutContainer:AddChild(SizeSlider) function RefreshStatusGUI() @@ -1630,14 +2366,23 @@ local function CreateMouseoverSettings(containerParent, unit, updateCallback) local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFMouseover|r Highlight") Toggle:SetValue(MouseoverDB.Enabled) - Toggle:SetCallback("OnValueChanged", function(_, _, value) MouseoverDB.Enabled = value updateCallback() RefreshMouseoverGUI() end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + MouseoverDB.Enabled = value + updateCallback() + RefreshMouseoverGUI() + end) Toggle:SetRelativeWidth(1) ToggleContainer:AddChild(Toggle) local ColourPicker = AG:Create("ColorPicker") ColourPicker:SetLabel("Highlight Colour") ColourPicker:SetColor(MouseoverDB.Colour[1], MouseoverDB.Colour[2], MouseoverDB.Colour[3]) - ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) MouseoverDB.Colour = {r, g, b} updateCallback() end) + ColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b) + MouseoverDB.Colour = { r, g, b } + updateCallback() + end) ColourPicker:SetHasAlpha(false) ColourPicker:SetRelativeWidth(0.33) ToggleContainer:AddChild(ColourPicker) @@ -1647,16 +2392,23 @@ local function CreateMouseoverSettings(containerParent, unit, updateCallback) OpacitySlider:SetValue(MouseoverDB.HighlightOpacity) OpacitySlider:SetSliderValues(0, 1, 0.01) OpacitySlider:SetRelativeWidth(0.33) - OpacitySlider:SetCallback("OnValueChanged", function(_, _, value) MouseoverDB.HighlightOpacity = value updateCallback() end) + OpacitySlider:SetCallback("OnValueChanged", + function(_, _, value) + MouseoverDB.HighlightOpacity = value + updateCallback() + end) OpacitySlider:SetIsPercent(true) ToggleContainer:AddChild(OpacitySlider) local StyleDropdown = AG:Create("Dropdown") - StyleDropdown:SetList({["BORDER"] = "Border", ["OVERLAY"] = "Overlay", ["GRADIENT"] = "Gradient" }) + StyleDropdown:SetList({ ["BORDER"] = "Border", ["OVERLAY"] = "Overlay", ["GRADIENT"] = "Gradient" }) StyleDropdown:SetLabel("Highlight Style") StyleDropdown:SetValue(MouseoverDB.Style) StyleDropdown:SetRelativeWidth(0.33) - StyleDropdown:SetCallback("OnValueChanged", function(_, _, value) MouseoverDB.Style = value updateCallback() end) + StyleDropdown:SetCallback("OnValueChanged", function(_, _, value) + MouseoverDB.Style = value + updateCallback() + end) ToggleContainer:AddChild(StyleDropdown) function RefreshMouseoverGUI() @@ -1678,14 +2430,23 @@ local function CreateTargetIndicatorSettings(containerParent, unit, updateCallba local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFTarget Indicator|r") Toggle:SetValue(TargetIndicatorDB.Enabled) - Toggle:SetCallback("OnValueChanged", function(_, _, value) TargetIndicatorDB.Enabled = value updateCallback() RefreshTargetIndicatorGUI() end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + TargetIndicatorDB.Enabled = value + updateCallback() + RefreshTargetIndicatorGUI() + end) Toggle:SetRelativeWidth(0.5) ToggleContainer:AddChild(Toggle) local ColourPicker = AG:Create("ColorPicker") ColourPicker:SetLabel("Indicator Colour") ColourPicker:SetColor(TargetIndicatorDB.Colour[1], TargetIndicatorDB.Colour[2], TargetIndicatorDB.Colour[3]) - ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) TargetIndicatorDB.Colour = {r, g, b} updateCallback() end) + ColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b) + TargetIndicatorDB.Colour = { r, g, b } + updateCallback() + end) ColourPicker:SetHasAlpha(false) ColourPicker:SetRelativeWidth(0.5) ToggleContainer:AddChild(ColourPicker) @@ -1706,17 +2467,44 @@ local function CreateIndicatorSettings(containerParent, unit) SaveSubTab(unit, "Indicators", IndicatorTab) IndicatorContainer:ReleaseChildren() if IndicatorTab == "RaidTargetMarker" then - CreateRaidTargetMarkerSettings(IndicatorContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitRaidTargetMarker(UUF[unit:upper()], unit) end end) + CreateRaidTargetMarkerSettings(IndicatorContainer, unit, + function() + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitRaidTargetMarker( + UUF[unit:upper()], unit) + end + end) elseif IndicatorTab == "LeaderAssistant" then - CreateLeaderAssistaintSettings(IndicatorContainer, unit, function() UUF:UpdateUnitLeaderAssistantIndicator(UUF[unit:upper()], unit) end) + CreateLeaderAssistaintSettings(IndicatorContainer, unit, + function() UUF:UpdateUnitLeaderAssistantIndicator(UUF[unit:upper()], unit) end) elseif IndicatorTab == "Resting" then - CreateStatusSettings(IndicatorContainer, unit, "Resting", function() UUF:UpdateUnitRestingIndicator(UUF[unit:upper()], unit) end) + CreateStatusSettings(IndicatorContainer, unit, "Resting", + function() UUF:UpdateUnitRestingIndicator(UUF[unit:upper()], unit) end) elseif IndicatorTab == "Combat" then - CreateStatusSettings(IndicatorContainer, unit, "Combat", function() UUF:UpdateUnitCombatIndicator(UUF[unit:upper()], unit) end) + CreateStatusSettings(IndicatorContainer, unit, "Combat", + function() UUF:UpdateUnitCombatIndicator(UUF[unit:upper()], unit) end) elseif IndicatorTab == "Mouseover" then - CreateMouseoverSettings(IndicatorContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitMouseoverIndicator(UUF[unit:upper()], unit) end end) + CreateMouseoverSettings(IndicatorContainer, unit, + function() + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitMouseoverIndicator( + UUF[unit:upper()], unit) + end + end) elseif IndicatorTab == "TargetIndicator" then - CreateTargetIndicatorSettings(IndicatorContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTargetGlowIndicator(UUF[unit:upper()], unit) end end) + CreateTargetIndicatorSettings(IndicatorContainer, unit, + function() + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitTargetGlowIndicator( + UUF[unit:upper()], unit) + end + end) end end @@ -1727,23 +2515,23 @@ local function CreateIndicatorSettings(containerParent, unit) IndicatorContainerTabGroup:SetTabs({ { text = "Raid Target Marker", value = "RaidTargetMarker" }, { text = "Leader & Assistant", value = "LeaderAssistant" }, - { text = "Resting", value = "Resting" }, - { text = "Combat", value = "Combat" }, - { text = "Mouseover", value = "Mouseover" }, + { text = "Resting", value = "Resting" }, + { text = "Combat", value = "Combat" }, + { text = "Mouseover", value = "Mouseover" }, }) elseif unit == "target" then IndicatorContainerTabGroup:SetTabs({ { text = "Raid Target Marker", value = "RaidTargetMarker" }, { text = "Leader & Assistant", value = "LeaderAssistant" }, - { text = "Combat", value = "Combat" }, - { text = "Mouseover", value = "Mouseover" }, - { text = "Target Indicator", value = "TargetIndicator" }, + { text = "Combat", value = "Combat" }, + { text = "Mouseover", value = "Mouseover" }, + { text = "Target Indicator", value = "TargetIndicator" }, }) elseif unit == "targettarget" or unit == "focus" or unit == "focustarget" or unit == "pet" or unit == "boss" then IndicatorContainerTabGroup:SetTabs({ { text = "Raid Target Marker", value = "RaidTargetMarker" }, - { text = "Mouseover", value = "Mouseover" }, - { text = "Target Indicator", value = "TargetIndicator" }, + { text = "Mouseover", value = "Mouseover" }, + { text = "Target Indicator", value = "TargetIndicator" }, }) end IndicatorContainerTabGroup:SetCallback("OnGroupSelected", SelectIndicatorTab) @@ -1761,14 +2549,23 @@ local function CreateTagSetting(containerParent, unit, tagDB) EditBox:SetText(TagDB.Tag) EditBox:SetRelativeWidth(0.5) EditBox:DisableButton(true) - EditBox:SetCallback("OnEnterPressed", function(_, _, value) TagDB.Tag = value EditBox:SetText(TagDB.Tag) if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) + EditBox:SetCallback("OnEnterPressed", + function(_, _, value) + TagDB.Tag = value + EditBox:SetText(TagDB.Tag) + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end + end) TagContainer:AddChild(EditBox) local ColourPicker = AG:Create("ColorPicker") ColourPicker:SetLabel("Colour") ColourPicker:SetColor(TagDB.Colour[1], TagDB.Colour[2], TagDB.Colour[3], 1) ColourPicker:SetFullWidth(true) - ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) TagDB.Colour = {r, g, b} if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) + ColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b) + TagDB.Colour = { r, g, b } + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end + end) ColourPicker:SetHasAlpha(false) ColourPicker:SetRelativeWidth(0.5) TagContainer:AddChild(ColourPicker) @@ -1780,7 +2577,11 @@ local function CreateTagSetting(containerParent, unit, tagDB) AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(TagDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) TagDB.Layout[1] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) + AnchorFromDropdown:SetCallback("OnValueChanged", + function(_, _, value) + TagDB.Layout[1] = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end + end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -1788,7 +2589,11 @@ local function CreateTagSetting(containerParent, unit, tagDB) AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(TagDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) TagDB.Layout[2] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) + AnchorToDropdown:SetCallback("OnValueChanged", + function(_, _, value) + TagDB.Layout[2] = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end + end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -1796,7 +2601,11 @@ local function CreateTagSetting(containerParent, unit, tagDB) XPosSlider:SetValue(TagDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) TagDB.Layout[3] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) + XPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + TagDB.Layout[3] = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end + end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -1804,7 +2613,11 @@ local function CreateTagSetting(containerParent, unit, tagDB) YPosSlider:SetValue(TagDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) TagDB.Layout[4] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) + YPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + TagDB.Layout[4] = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end + end) LayoutContainer:AddChild(YPosSlider) local FontSizeSlider = AG:Create("Slider") @@ -1812,18 +2625,36 @@ local function CreateTagSetting(containerParent, unit, tagDB) FontSizeSlider:SetValue(TagDB.FontSize) FontSizeSlider:SetSliderValues(8, 64, 1) FontSizeSlider:SetRelativeWidth(0.33) - FontSizeSlider:SetCallback("OnValueChanged", function(_, _, value) TagDB.FontSize = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) + FontSizeSlider:SetCallback("OnValueChanged", + function(_, _, value) + TagDB.FontSize = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end + end) LayoutContainer:AddChild(FontSizeSlider) local TagSelectionContainer = GUIWidgets.CreateInlineGroup(containerParent, "Tag Selection") - GUIWidgets.CreateInformationTag(TagSelectionContainer, "You can use the dropdowns below to quickly add tags.\n|cFF8080FFPrefix|r indicates that this should be added to the start of the tag string.") + GUIWidgets.CreateInformationTag(TagSelectionContainer, + "You can use the dropdowns below to quickly add tags.\n|cFF8080FFPrefix|r indicates that this should be added to the start of the tag string.") local HealthTagDropdown = AG:Create("Dropdown") HealthTagDropdown:SetList(UUF:FetchTagData("Health")[1], UUF:FetchTagData("Health")[2]) HealthTagDropdown:SetLabel("Health Tags") HealthTagDropdown:SetValue(nil) HealthTagDropdown:SetRelativeWidth(0.5) - HealthTagDropdown:SetCallback("OnValueChanged", function(_, _, value) local currentTag = TagDB.Tag if currentTag and currentTag ~= "" then currentTag = currentTag .. "[" .. value .. "]" else currentTag = "[" .. value .. "]" end EditBox:SetText(currentTag) UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) HealthTagDropdown:SetValue(nil) end) + HealthTagDropdown:SetCallback("OnValueChanged", + function(_, _, value) + local currentTag = TagDB.Tag + if currentTag and currentTag ~= "" then + currentTag = currentTag .. "[" .. value .. "]" + else + currentTag = "[" .. + value .. "]" + end + EditBox:SetText(currentTag) + UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag + UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) + HealthTagDropdown:SetValue(nil) + end) TagSelectionContainer:AddChild(HealthTagDropdown) local PowerTagDropdown = AG:Create("Dropdown") @@ -1831,7 +2662,20 @@ local function CreateTagSetting(containerParent, unit, tagDB) PowerTagDropdown:SetLabel("Power Tags") PowerTagDropdown:SetValue(nil) PowerTagDropdown:SetRelativeWidth(0.5) - PowerTagDropdown:SetCallback("OnValueChanged", function(_, _, value) local currentTag = TagDB.Tag if currentTag and currentTag ~= "" then currentTag = currentTag .. "[" .. value .. "]" else currentTag = "[" .. value .. "]" end EditBox:SetText(currentTag) UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end PowerTagDropdown:SetValue(nil) end) + PowerTagDropdown:SetCallback("OnValueChanged", + function(_, _, value) + local currentTag = TagDB.Tag + if currentTag and currentTag ~= "" then + currentTag = currentTag .. "[" .. value .. "]" + else + currentTag = "[" .. + value .. "]" + end + EditBox:SetText(currentTag) + UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end + PowerTagDropdown:SetValue(nil) + end) TagSelectionContainer:AddChild(PowerTagDropdown) local NameTagDropdown = AG:Create("Dropdown") @@ -1839,7 +2683,20 @@ local function CreateTagSetting(containerParent, unit, tagDB) NameTagDropdown:SetLabel("Name Tags") NameTagDropdown:SetValue(nil) NameTagDropdown:SetRelativeWidth(0.5) - NameTagDropdown:SetCallback("OnValueChanged", function(_, _, value) local currentTag = TagDB.Tag if currentTag and currentTag ~= "" then currentTag = currentTag .. "[" .. value .. "]" else currentTag = "[" .. value .. "]" end EditBox:SetText(currentTag) UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end NameTagDropdown:SetValue(nil) end) + NameTagDropdown:SetCallback("OnValueChanged", + function(_, _, value) + local currentTag = TagDB.Tag + if currentTag and currentTag ~= "" then + currentTag = currentTag .. "[" .. value .. "]" + else + currentTag = "[" .. + value .. "]" + end + EditBox:SetText(currentTag) + UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end + NameTagDropdown:SetValue(nil) + end) TagSelectionContainer:AddChild(NameTagDropdown) local MiscTagDropdown = AG:Create("Dropdown") @@ -1847,7 +2704,20 @@ local function CreateTagSetting(containerParent, unit, tagDB) MiscTagDropdown:SetLabel("Misc Tags") MiscTagDropdown:SetValue(nil) MiscTagDropdown:SetRelativeWidth(0.5) - MiscTagDropdown:SetCallback("OnValueChanged", function(_, _, value) local currentTag = TagDB.Tag if currentTag and currentTag ~= "" then currentTag = currentTag .. "[" .. value .. "]" else currentTag = "[" .. value .. "]" end EditBox:SetText(currentTag) UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end MiscTagDropdown:SetValue(nil) end) + MiscTagDropdown:SetCallback("OnValueChanged", + function(_, _, value) + local currentTag = TagDB.Tag + if currentTag and currentTag ~= "" then + currentTag = currentTag .. "[" .. value .. "]" + else + currentTag = "[" .. + value .. "]" + end + EditBox:SetText(currentTag) + UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end + MiscTagDropdown:SetValue(nil) + end) MiscTagDropdown:SetDisabled(#UUF:FetchTagData("Misc") == 0) TagSelectionContainer:AddChild(MiscTagDropdown) @@ -1855,7 +2725,6 @@ local function CreateTagSetting(containerParent, unit, tagDB) end local function CreateTagsSettings(containerParent, unit) - local function SelectTagTab(TagContainer, _, TagTab) SaveSubTab(unit, "Tags", TagTab) TagContainer:ReleaseChildren() @@ -1867,11 +2736,11 @@ local function CreateTagsSettings(containerParent, unit) TagContainerTabGroup:SetLayout("Flow") TagContainerTabGroup:SetFullWidth(true) TagContainerTabGroup:SetTabs({ - { text = "Tag One", value = "TagOne"}, - { text = "Tag Two", value = "TagTwo"}, - { text = "Tag Three", value = "TagThree"}, - { text = "Tag Four", value = "TagFour"}, - { text = "Tag Five", value = "TagFive"}, + { text = "Tag One", value = "TagOne" }, + { text = "Tag Two", value = "TagTwo" }, + { text = "Tag Three", value = "TagThree" }, + { text = "Tag Four", value = "TagFour" }, + { text = "Tag Five", value = "TagFive" }, }) TagContainerTabGroup:SetCallback("OnGroupSelected", SelectTagTab) TagContainerTabGroup:SelectTab(GetSavedSubTab(unit, "Tags", "TagOne")) @@ -1886,23 +2755,36 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) local AuraContainer = GUIWidgets.CreateInlineGroup(containerParent, auraDB .. " Settings") local Toggle = AG:Create("CheckBox") - Toggle:SetLabel("Enable |cFF8080FF"..auraDB.."|r") + Toggle:SetLabel("Enable |cFF8080FF" .. auraDB .. "|r") Toggle:SetValue(AuraDB.Enabled) - Toggle:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Enabled = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end RefreshAuraGUI() end) + Toggle:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Enabled = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + RefreshAuraGUI() + end) Toggle:SetRelativeWidth(0.33) AuraContainer:AddChild(Toggle) local OnlyShowPlayerToggle = AG:Create("CheckBox") - OnlyShowPlayerToggle:SetLabel("Only Show Player "..auraDB) + OnlyShowPlayerToggle:SetLabel("Only Show Player " .. auraDB) OnlyShowPlayerToggle:SetValue(AuraDB.OnlyShowPlayer) - OnlyShowPlayerToggle:SetCallback("OnValueChanged", function(_, _, value) AuraDB.OnlyShowPlayer = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + OnlyShowPlayerToggle:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.OnlyShowPlayer = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) OnlyShowPlayerToggle:SetRelativeWidth(0.33) AuraContainer:AddChild(OnlyShowPlayerToggle) local ShowTypeCheckbox = AG:Create("CheckBox") ShowTypeCheckbox:SetLabel(auraDB .. " Type Border") ShowTypeCheckbox:SetValue(AuraDB.ShowType) - ShowTypeCheckbox:SetCallback("OnValueChanged", function(_, _, value) AuraDB.ShowType = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + ShowTypeCheckbox:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.ShowType = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) ShowTypeCheckbox:SetRelativeWidth(0.33) AuraContainer:AddChild(ShowTypeCheckbox) @@ -1913,7 +2795,11 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(AuraDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Layout[1] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + AnchorFromDropdown:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Layout[1] = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -1921,7 +2807,11 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(AuraDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Layout[2] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + AnchorToDropdown:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Layout[2] = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -1929,7 +2819,11 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) XPosSlider:SetValue(AuraDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.25) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Layout[3] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + XPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Layout[3] = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -1937,7 +2831,11 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) YPosSlider:SetValue(AuraDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.25) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Layout[4] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + YPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Layout[4] = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) LayoutContainer:AddChild(YPosSlider) local SizeSlider = AG:Create("Slider") @@ -1945,7 +2843,11 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) SizeSlider:SetValue(AuraDB.Size) SizeSlider:SetSliderValues(8, 64, 1) SizeSlider:SetRelativeWidth(0.25) - SizeSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Size = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + SizeSlider:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Size = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) LayoutContainer:AddChild(SizeSlider) local SpacingSlider = AG:Create("Slider") @@ -1953,7 +2855,11 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) SpacingSlider:SetValue(AuraDB.Layout[5]) SpacingSlider:SetSliderValues(-5, 5, 1) SpacingSlider:SetRelativeWidth(0.25) - SpacingSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Layout[5] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + SpacingSlider:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Layout[5] = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) LayoutContainer:AddChild(SpacingSlider) GUIWidgets.CreateHeader(LayoutContainer, "Layout") @@ -1963,7 +2869,11 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) NumAurasSlider:SetValue(AuraDB.Num) NumAurasSlider:SetSliderValues(1, 24, 1) NumAurasSlider:SetRelativeWidth(0.5) - NumAurasSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Num = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + NumAurasSlider:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Num = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) LayoutContainer:AddChild(NumAurasSlider) local PerRowSlider = AG:Create("Slider") @@ -1971,23 +2881,35 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) PerRowSlider:SetValue(AuraDB.Wrap) PerRowSlider:SetSliderValues(1, 24, 1) PerRowSlider:SetRelativeWidth(0.5) - PerRowSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Wrap = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + PerRowSlider:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Wrap = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) LayoutContainer:AddChild(PerRowSlider) local GrowthDirectionDropdown = AG:Create("Dropdown") - GrowthDirectionDropdown:SetList({ ["LEFT"] = "Left", ["RIGHT"] = "Right"}) + GrowthDirectionDropdown:SetList({ ["LEFT"] = "Left", ["RIGHT"] = "Right" }) GrowthDirectionDropdown:SetLabel("Growth Direction") GrowthDirectionDropdown:SetValue(AuraDB.GrowthDirection) GrowthDirectionDropdown:SetRelativeWidth(0.5) - GrowthDirectionDropdown:SetCallback("OnValueChanged", function(_, _, value) AuraDB.GrowthDirection = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + GrowthDirectionDropdown:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.GrowthDirection = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) LayoutContainer:AddChild(GrowthDirectionDropdown) local WrapDirectionDropdown = AG:Create("Dropdown") - WrapDirectionDropdown:SetList({ ["UP"] = "Up", ["DOWN"] = "Down"}) + WrapDirectionDropdown:SetList({ ["UP"] = "Up", ["DOWN"] = "Down" }) WrapDirectionDropdown:SetLabel("Wrap Direction") WrapDirectionDropdown:SetValue(AuraDB.WrapDirection) WrapDirectionDropdown:SetRelativeWidth(0.5) - WrapDirectionDropdown:SetCallback("OnValueChanged", function(_, _, value) AuraDB.WrapDirection = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + WrapDirectionDropdown:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.WrapDirection = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) LayoutContainer:AddChild(WrapDirectionDropdown) local CountContainer = GUIWidgets.CreateInlineGroup(containerParent, "Count Settings") @@ -1997,7 +2919,11 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) CountAnchorFromDropdown:SetLabel("Anchor From") CountAnchorFromDropdown:SetValue(AuraDB.Count.Layout[1]) CountAnchorFromDropdown:SetRelativeWidth(0.5) - CountAnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Count.Layout[1] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + CountAnchorFromDropdown:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Count.Layout[1] = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) CountContainer:AddChild(CountAnchorFromDropdown) local CountAnchorToDropdown = AG:Create("Dropdown") @@ -2005,7 +2931,11 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) CountAnchorToDropdown:SetLabel("Anchor To") CountAnchorToDropdown:SetValue(AuraDB.Count.Layout[2]) CountAnchorToDropdown:SetRelativeWidth(0.5) - CountAnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Count.Layout[2] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + CountAnchorToDropdown:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Count.Layout[2] = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) CountContainer:AddChild(CountAnchorToDropdown) local CountXPosSlider = AG:Create("Slider") @@ -2013,7 +2943,11 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) CountXPosSlider:SetValue(AuraDB.Count.Layout[3]) CountXPosSlider:SetSliderValues(-1000, 1000, 0.1) CountXPosSlider:SetRelativeWidth(0.25) - CountXPosSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Count.Layout[3] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + CountXPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Count.Layout[3] = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) CountContainer:AddChild(CountXPosSlider) local CountYPosSlider = AG:Create("Slider") @@ -2021,7 +2955,11 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) CountYPosSlider:SetValue(AuraDB.Count.Layout[4]) CountYPosSlider:SetSliderValues(-1000, 1000, 0.1) CountYPosSlider:SetRelativeWidth(0.25) - CountYPosSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Count.Layout[4] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + CountYPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Count.Layout[4] = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) CountContainer:AddChild(CountYPosSlider) local FontSizeSlider = AG:Create("Slider") @@ -2029,13 +2967,21 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) FontSizeSlider:SetValue(AuraDB.Count.FontSize) FontSizeSlider:SetSliderValues(8, 64, 1) FontSizeSlider:SetRelativeWidth(0.25) - FontSizeSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Count.FontSize = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + FontSizeSlider:SetCallback("OnValueChanged", + function(_, _, value) + AuraDB.Count.FontSize = value + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) CountContainer:AddChild(FontSizeSlider) local ColourPicker = AG:Create("ColorPicker") ColourPicker:SetLabel("Colour") ColourPicker:SetColor(AuraDB.Count.Colour[1], AuraDB.Count.Colour[2], AuraDB.Count.Colour[3], 1) - ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) AuraDB.Count.Colour = {r, g, b} if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) + ColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b) + AuraDB.Count.Colour = { r, g, b } + if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end + end) ColourPicker:SetHasAlpha(false) ColourPicker:SetRelativeWidth(0.25) CountContainer:AddChild(ColourPicker) @@ -2063,8 +3009,19 @@ local function CreateAuraSettings(containerParent, unit) local ColourPicker = AG:Create("ColorPicker") ColourPicker:SetLabel("Cooldown Text Colour") - ColourPicker:SetColor(UUF.db.profile.Units[unit].Auras.AuraDuration.Colour[1], UUF.db.profile.Units[unit].Auras.AuraDuration.Colour[2], UUF.db.profile.Units[unit].Auras.AuraDuration.Colour[3], 1) - ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) UUF.db.profile.Units[unit].Auras.AuraDuration.Colour = {r, g, b} if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end end) + ColourPicker:SetColor(UUF.db.profile.Units[unit].Auras.AuraDuration.Colour[1], + UUF.db.profile.Units[unit].Auras.AuraDuration.Colour[2], UUF.db.profile.Units[unit].Auras.AuraDuration.Colour[3], + 1) + ColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b) + UUF.db.profile.Units[unit].Auras.AuraDuration.Colour = { r, g, b } + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitAuras(UUF[unit:upper()], unit, + "AuraDuration") + end + end) ColourPicker:SetHasAlpha(false) ColourPicker:SetRelativeWidth(0.5) AuraDurationContainer:AddChild(ColourPicker) @@ -2072,7 +3029,17 @@ local function CreateAuraSettings(containerParent, unit) local ScaleByIconSizeCheckbox = AG:Create("CheckBox") ScaleByIconSizeCheckbox:SetLabel("Scale Cooldown Text By Icon Size") ScaleByIconSizeCheckbox:SetValue(UUF.db.profile.Units[unit].Auras.AuraDuration.ScaleByIconSize) - ScaleByIconSizeCheckbox:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.Units[unit].Auras.AuraDuration.ScaleByIconSize = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end RefreshFontSizeSlider() end) + ScaleByIconSizeCheckbox:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db.profile.Units[unit].Auras.AuraDuration.ScaleByIconSize = value + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitAuras(UUF[unit:upper()], unit, + "AuraDuration") + end + RefreshFontSizeSlider() + end) ScaleByIconSizeCheckbox:SetRelativeWidth(0.5) AuraDurationContainer:AddChild(ScaleByIconSizeCheckbox) @@ -2081,7 +3048,16 @@ local function CreateAuraSettings(containerParent, unit) AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[1] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end end) + AnchorFromDropdown:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[1] = value + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitAuras(UUF[unit:upper()], unit, + "AuraDuration") + end + end) AuraDurationContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -2089,7 +3065,16 @@ local function CreateAuraSettings(containerParent, unit) AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[2] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end end) + AnchorToDropdown:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[2] = value + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitAuras(UUF[unit:upper()], unit, + "AuraDuration") + end + end) AuraDurationContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -2097,7 +3082,16 @@ local function CreateAuraSettings(containerParent, unit) XPosSlider:SetValue(UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[3] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end end) + XPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[3] = value + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitAuras(UUF[unit:upper()], unit, + "AuraDuration") + end + end) AuraDurationContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -2105,7 +3099,16 @@ local function CreateAuraSettings(containerParent, unit) YPosSlider:SetValue(UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[4] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end end) + YPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[4] = value + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitAuras(UUF[unit:upper()], unit, + "AuraDuration") + end + end) AuraDurationContainer:AddChild(YPosSlider) local FontSizeSlider = AG:Create("Slider") @@ -2113,7 +3116,16 @@ local function CreateAuraSettings(containerParent, unit) FontSizeSlider:SetValue(UUF.db.profile.Units[unit].Auras.AuraDuration.FontSize) FontSizeSlider:SetSliderValues(8, 64, 1) FontSizeSlider:SetRelativeWidth(0.33) - FontSizeSlider:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.Units[unit].Auras.AuraDuration.FontSize = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end end) + FontSizeSlider:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db.profile.Units[unit].Auras.AuraDuration.FontSize = value + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitAuras(UUF[unit:upper()], unit, + "AuraDuration") + end + end) FontSizeSlider:SetDisabled(UUF.db.profile.Units[unit].Auras.AuraDuration.ScaleByIconSize) AuraDurationContainer:AddChild(FontSizeSlider) @@ -2122,7 +3134,11 @@ local function CreateAuraSettings(containerParent, unit) FrameStrataDropdown:SetLabel("Frame Strata") FrameStrataDropdown:SetValue(AurasDB.FrameStrata) FrameStrataDropdown:SetRelativeWidth(1) - FrameStrataDropdown:SetCallback("OnValueChanged", function(_, _, value) AurasDB.FrameStrata = value UUF:UpdateUnitAurasStrata(unit) end) + FrameStrataDropdown:SetCallback("OnValueChanged", + function(_, _, value) + AurasDB.FrameStrata = value + UUF:UpdateUnitAurasStrata(unit) + end) containerParent:AddChild(FrameStrataDropdown) function RefreshFontSizeSlider() @@ -2148,7 +3164,7 @@ local function CreateAuraSettings(containerParent, unit) local AuraContainerTabGroup = AG:Create("TabGroup") AuraContainerTabGroup:SetLayout("Flow") AuraContainerTabGroup:SetFullWidth(true) - AuraContainerTabGroup:SetTabs({ { text = "Buffs", value = "Buffs"}, { text = "Debuffs", value = "Debuffs"}, }) + AuraContainerTabGroup:SetTabs({ { text = "Buffs", value = "Buffs" }, { text = "Debuffs", value = "Debuffs" }, }) AuraContainerTabGroup:SetCallback("OnGroupSelected", SelectAuraTab) AuraContainerTabGroup:SelectTab(GetSavedSubTab(unit, "Auras", "Buffs")) containerParent:AddChild(AuraContainerTabGroup) @@ -2162,7 +3178,11 @@ local function CreateAuraDurationSettings(containerParent) local ColourPicker = AG:Create("ColorPicker") ColourPicker:SetLabel("Cooldown Text Colour") ColourPicker:SetColor(1, 1, 1, 1) - ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Colour = {r, g, b} end UUF:UpdateAllUnitFrames() end) + ColourPicker:SetCallback("OnValueChanged", + function(_, _, r, g, b) + for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Colour = { r, g, b } end + UUF:UpdateAllUnitFrames() + end) ColourPicker:SetHasAlpha(false) ColourPicker:SetRelativeWidth(0.5) AuraDurationContainer:AddChild(ColourPicker) @@ -2170,7 +3190,11 @@ local function CreateAuraDurationSettings(containerParent) local ScaleByIconSizeCheckbox = AG:Create("CheckBox") ScaleByIconSizeCheckbox:SetLabel("Scale Cooldown Text By Icon Size") ScaleByIconSizeCheckbox:SetValue(false) - ScaleByIconSizeCheckbox:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.ScaleByIconSize = value end UUF:UpdateAllUnitFrames() end) + ScaleByIconSizeCheckbox:SetCallback("OnValueChanged", + function(_, _, value) + for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.ScaleByIconSize = value end + UUF:UpdateAllUnitFrames() + end) ScaleByIconSizeCheckbox:SetRelativeWidth(0.5) AuraDurationContainer:AddChild(ScaleByIconSizeCheckbox) @@ -2179,7 +3203,11 @@ local function CreateAuraDurationSettings(containerParent) AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue("CENTER") AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[1] = value end UUF:UpdateAllUnitFrames() end) + AnchorFromDropdown:SetCallback("OnValueChanged", + function(_, _, value) + for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[1] = value end + UUF:UpdateAllUnitFrames() + end) AuraDurationContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -2187,7 +3215,11 @@ local function CreateAuraDurationSettings(containerParent) AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue("CENTER") AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[2] = value end UUF:UpdateAllUnitFrames() end) + AnchorToDropdown:SetCallback("OnValueChanged", + function(_, _, value) + for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[2] = value end + UUF:UpdateAllUnitFrames() + end) AuraDurationContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -2195,7 +3227,11 @@ local function CreateAuraDurationSettings(containerParent) XPosSlider:SetValue(0) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[3] = value end UUF:UpdateAllUnitFrames() end) + XPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[3] = value end + UUF:UpdateAllUnitFrames() + end) AuraDurationContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -2203,7 +3239,11 @@ local function CreateAuraDurationSettings(containerParent) YPosSlider:SetValue(0) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[4] = value end UUF:UpdateAllUnitFrames() end) + YPosSlider:SetCallback("OnValueChanged", + function(_, _, value) + for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[4] = value end + UUF:UpdateAllUnitFrames() + end) AuraDurationContainer:AddChild(YPosSlider) local FontSizeSlider = AG:Create("Slider") @@ -2211,16 +3251,22 @@ local function CreateAuraDurationSettings(containerParent) FontSizeSlider:SetValue(12) FontSizeSlider:SetSliderValues(8, 64, 1) FontSizeSlider:SetRelativeWidth(0.33) - FontSizeSlider:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.FontSize = value end UUF:UpdateAllUnitFrames() end) + FontSizeSlider:SetCallback("OnValueChanged", + function(_, _, value) + for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.FontSize = value end + UUF:UpdateAllUnitFrames() + end) FontSizeSlider:SetDisabled(false) AuraDurationContainer:AddChild(FontSizeSlider) end local function CreateGlobalSettings(containerParent) - local GlobalContainer = GUIWidgets.CreateInlineGroup(containerParent, "Global Settings") - GUIWidgets.CreateInformationTag(GlobalContainer, "The settings below will apply to all unit frames within" .. UUF.PRETTY_ADDON_NAME .. ".\nOptions are not dynamic. They are static but will apply to all unit frames when changed.") + GUIWidgets.CreateInformationTag(GlobalContainer, + "The settings below will apply to all unit frames within" .. + UUF.PRETTY_ADDON_NAME .. + ".\nOptions are not dynamic. They are static but will apply to all unit frames when changed.") local ToggleContainer = GUIWidgets.CreateInlineGroup(GlobalContainer, "Toggles") @@ -2254,13 +3300,18 @@ local function CreateGlobalSettings(containerParent) CreateTextureSettings(GlobalContainer) -- CreateRangeSettings(GlobalContainer) CreateAuraDurationSettings(GlobalContainer) + CreateGlobalOutOfCombatFadeSettings(GlobalContainer) local TagContainer = GUIWidgets.CreateInlineGroup(GlobalContainer, "Tag Settings") local UseCustomAbbreviationsCheckbox = AG:Create("CheckBox") UseCustomAbbreviationsCheckbox:SetLabel("Custom Abbreviations") UseCustomAbbreviationsCheckbox:SetValue(UUF.db.profile.General.UseCustomAbbreviations) - UseCustomAbbreviationsCheckbox:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.UseCustomAbbreviations = value UUF:UpdateUnitTags() end) + UseCustomAbbreviationsCheckbox:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db.profile.General.UseCustomAbbreviations = value + UUF:UpdateUnitTags() + end) UseCustomAbbreviationsCheckbox:SetRelativeWidth(0.33) TagContainer:AddChild(UseCustomAbbreviationsCheckbox) @@ -2269,7 +3320,13 @@ local function CreateGlobalSettings(containerParent) TagIntervalSlider:SetValue(1 / UUF.db.profile.General.TagUpdateInterval) TagIntervalSlider:SetSliderValues(1, 10, 0.5) TagIntervalSlider:SetRelativeWidth(0.33) - TagIntervalSlider:SetCallback("OnValueChanged", function(_, _, value) UUF.TAG_UPDATE_INTERVAL = 1 / value UUF.db.profile.General.TagUpdateInterval = 1 / value UUF:SetTagUpdateInterval() UUF:UpdateUnitTags() end) + TagIntervalSlider:SetCallback("OnValueChanged", + function(_, _, value) + UUF.TAG_UPDATE_INTERVAL = 1 / value + UUF.db.profile.General.TagUpdateInterval = 1 / value + UUF:SetTagUpdateInterval() + UUF:UpdateUnitTags() + end) TagContainer:AddChild(TagIntervalSlider) local SeparatorDropdown = AG:Create("Dropdown") @@ -2277,8 +3334,19 @@ local function CreateGlobalSettings(containerParent) SeparatorDropdown:SetLabel("Tag Separator") SeparatorDropdown:SetValue(UUF.db.profile.General.Separator) SeparatorDropdown:SetRelativeWidth(0.33) - SeparatorDropdown:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.Separator = value UUF:UpdateUnitTags() end) - SeparatorDropdown:SetCallback("OnEnter", function() GameTooltip:SetOwner(SeparatorDropdown.frame, "ANCHOR_BOTTOM") GameTooltip:AddLine("The separator chosen here is only applied to custom tags which are combined. Such as |cFF8080FF[curhpperhp]|r or |cFF8080FF[curhpperhp:abbr]|r", 1, 1, 1) GameTooltip:Show() end) + SeparatorDropdown:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db.profile.General.Separator = value + UUF:UpdateUnitTags() + end) + SeparatorDropdown:SetCallback("OnEnter", + function() + GameTooltip:SetOwner(SeparatorDropdown.frame, "ANCHOR_BOTTOM") + GameTooltip:AddLine( + "The separator chosen here is only applied to custom tags which are combined. Such as |cFF8080FF[curhpperhp]|r or |cFF8080FF[curhpperhp:abbr]|r", + 1, 1, 1) + GameTooltip:Show() + end) SeparatorDropdown:SetCallback("OnLeave", function() GameTooltip:Hide() end) TagContainer:AddChild(SeparatorDropdown) @@ -2287,7 +3355,7 @@ end local function CreateUnitSettings(containerParent, unit) EnableUnitFrameToggle = AG:Create("CheckBox") - EnableUnitFrameToggle:SetLabel("Enable |cFFFFCC00"..(UnitDBToUnitPrettyName[unit] or unit) .."|r") + EnableUnitFrameToggle:SetLabel("Enable |cFFFFCC00" .. (UnitDBToUnitPrettyName[unit] or unit) .. "|r") EnableUnitFrameToggle:SetValue(UUF.db.profile.Units[unit].Enabled) EnableUnitFrameToggle:SetCallback("OnValueChanged", function(_, _, value) StaticPopupDialogs["UUF_RELOAD_UI"] = { @@ -2295,8 +3363,14 @@ local function CreateUnitSettings(containerParent, unit) button1 = "Reload Now", button2 = "Later", showAlert = true, - OnAccept = function() UUF.db.profile.Units[unit].Enabled= value ReloadUI() end, - OnCancel = function() EnableUnitFrameToggle:SetValue(UUF.db.profile.Units[unit].Enabled) containerParent:DoLayout() end, + OnAccept = function() + UUF.db.profile.Units[unit].Enabled = value + ReloadUI() + end, + OnCancel = function() + EnableUnitFrameToggle:SetValue(UUF.db.profile.Units[unit].Enabled) + containerParent:DoLayout() + end, timeout = 0, whileDead = true, hideOnEscape = true, @@ -2307,16 +3381,22 @@ local function CreateUnitSettings(containerParent, unit) containerParent:AddChild(EnableUnitFrameToggle) EnableUnitFrameToggle = AG:Create("CheckBox") - EnableUnitFrameToggle:SetLabel("Hide Blizzard |cFFFFCC00"..(UnitDBToUnitPrettyName[unit] or unit) .."|r") + EnableUnitFrameToggle:SetLabel("Hide Blizzard |cFFFFCC00" .. (UnitDBToUnitPrettyName[unit] or unit) .. "|r") EnableUnitFrameToggle:SetValue(UUF.db.profile.Units[unit].ForceHideBlizzard) EnableUnitFrameToggle:SetCallback("OnValueChanged", function(_, _, value) - StaticPopupDialogs["UUF_RELOAD_UI"] = { + StaticPopupDialogs["UUF_RELOAD_UI"] = { text = "You must reload to apply this change, do you want to reload now?", button1 = "Reload Now", button2 = "Later", showAlert = true, - OnAccept = function() UUF.db.profile.Units[unit].ForceHideBlizzard = value ReloadUI() end, - OnCancel = function() EnableUnitFrameToggle:SetValue(UUF.db.profile.Units[unit].ForceHideBlizzard) containerParent:DoLayout() end, + OnAccept = function() + UUF.db.profile.Units[unit].ForceHideBlizzard = value + ReloadUI() + end, + OnCancel = function() + EnableUnitFrameToggle:SetValue(UUF.db.profile.Units[unit].ForceHideBlizzard) + containerParent:DoLayout() + end, timeout = 0, whileDead = true, hideOnEscape = true, @@ -2332,19 +3412,52 @@ local function CreateUnitSettings(containerParent, unit) lastSelectedUnitTabs[unit].mainTab = UnitTab SubContainer:ReleaseChildren() if UnitTab == "Frame" then - CreateFrameSettings(SubContainer, unit, UUF.db.profile.Units[unit].Frame.AnchorParent and true or false, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitFrame(UUF[unit:upper()], unit) end end) + CreateFrameSettings(SubContainer, unit, UUF.db.profile.Units[unit].Frame.AnchorParent and true or false, + function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitFrame(UUF[unit:upper()], unit) end end) elseif UnitTab == "HealPrediction" then - CreateHealPredictionSettings(SubContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitHealPrediction(UUF[unit:upper()], unit) end end) + CreateHealPredictionSettings(SubContainer, unit, + function() + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitHealPrediction( + UUF[unit:upper()], unit) + end + end) elseif UnitTab == "Auras" then CreateAuraSettings(SubContainer, unit) elseif UnitTab == "PowerBar" then - CreatePowerBarSettings(SubContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitPowerBar(UUF[unit:upper()], unit) end end) + CreatePowerBarSettings(SubContainer, unit, + function() + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitPowerBar(UUF[unit:upper()], + unit) + end + end) elseif UnitTab == "AlternativePowerBar" then - CreateAlternativePowerBarSettings(SubContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAlternativePowerBar(UUF[unit:upper()], unit) end end) + CreateAlternativePowerBarSettings(SubContainer, unit, + function() + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitAlternativePowerBar( + UUF[unit:upper()], unit) + end + end) elseif UnitTab == "CastBar" then CreateCastBarSettings(SubContainer, unit) elseif UnitTab == "Portrait" then - CreatePortraitSettings(SubContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitPortrait(UUF[unit:upper()], unit) end end) + CreatePortraitSettings(SubContainer, unit, + function() + if unit == "boss" then + UUF:UpdateBossFrames() + else + UUF:UpdateUnitPortrait(UUF[unit:upper()], + unit) + end + end) elseif UnitTab == "Indicators" then CreateIndicatorSettings(SubContainer, unit) elseif UnitTab == "Tags" then @@ -2360,35 +3473,35 @@ local function CreateUnitSettings(containerParent, unit) SubContainerTabGroup:SetFullWidth(true) if unit == "player" and UUF:RequiresAlternativePowerBar() then SubContainerTabGroup:SetTabs({ - { text = "Frame", value = "Frame"}, - { text = "Heal Prediction", value = "HealPrediction"}, - { text = "Auras", value = "Auras"}, - { text = "Power Bar", value = "PowerBar"}, - { text = "Alternative Power Bar", value = "AlternativePowerBar"}, - { text = "Cast Bar", value = "CastBar"}, - { text = "Portrait", value = "Portrait"}, - { text = "Indicators", value = "Indicators"}, - { text = "Tags", value = "Tags"}, + { text = "Frame", value = "Frame" }, + { text = "Heal Prediction", value = "HealPrediction" }, + { text = "Auras", value = "Auras" }, + { text = "Power Bar", value = "PowerBar" }, + { text = "Alternative Power Bar", value = "AlternativePowerBar" }, + { text = "Cast Bar", value = "CastBar" }, + { text = "Portrait", value = "Portrait" }, + { text = "Indicators", value = "Indicators" }, + { text = "Tags", value = "Tags" }, }) elseif unit ~= "targettarget" and unit ~= "focustarget" then SubContainerTabGroup:SetTabs({ - { text = "Frame", value = "Frame"}, - { text = "Heal Prediction", value = "HealPrediction"}, - { text = "Auras", value = "Auras"}, - { text = "Power Bar", value = "PowerBar"}, - { text = "Cast Bar", value = "CastBar"}, - { text = "Portrait", value = "Portrait"}, - { text = "Indicators", value = "Indicators"}, - { text = "Tags", value = "Tags"}, + { text = "Frame", value = "Frame" }, + { text = "Heal Prediction", value = "HealPrediction" }, + { text = "Auras", value = "Auras" }, + { text = "Power Bar", value = "PowerBar" }, + { text = "Cast Bar", value = "CastBar" }, + { text = "Portrait", value = "Portrait" }, + { text = "Indicators", value = "Indicators" }, + { text = "Tags", value = "Tags" }, }) else SubContainerTabGroup:SetTabs({ - { text = "Frame", value = "Frame"}, - { text = "Heal Prediction", value = "HealPrediction"}, - { text = "Auras", value = "Auras"}, - { text = "Power Bar", value = "PowerBar"}, - { text = "Indicators", value = "Indicators"}, - { text = "Tags", value = "Tags"}, + { text = "Frame", value = "Frame" }, + { text = "Heal Prediction", value = "HealPrediction" }, + { text = "Auras", value = "Auras" }, + { text = "Power Bar", value = "PowerBar" }, + { text = "Indicators", value = "Indicators" }, + { text = "Tags", value = "Tags" }, }) end SubContainerTabGroup:SetCallback("OnGroupSelected", SelectUnitTab) @@ -2399,7 +3512,6 @@ local function CreateUnitSettings(containerParent, unit) end local function CreateTagSettings(containerParent) - local function DrawTagContainer(TagContainer, TagGroup) local TagsList, TagOrder = UUF:FetchTagData(TagGroup)[1], UUF:FetchTagData(TagGroup)[2] @@ -2420,7 +3532,11 @@ local function CreateTagSettings(containerParent) local TagValue = AG:Create("EditBox") TagValue:SetText("[" .. Tag .. "]") - TagValue:SetCallback("OnTextChanged", function(widget, event, value) TagValue:ClearFocus() TagValue:SetText("[" .. Tag .. "]") end) + TagValue:SetCallback("OnTextChanged", + function(widget, event, value) + TagValue:ClearFocus() + TagValue:SetText("[" .. Tag .. "]") + end) TagValue:SetRelativeWidth(0.5) TagContainer:AddChild(TagValue) end @@ -2443,9 +3559,9 @@ local function CreateTagSettings(containerParent) local GUIContainerTabGroup = AG:Create("TabGroup") GUIContainerTabGroup:SetLayout("Flow") GUIContainerTabGroup:SetTabs({ - { text = "Health", value = "Health" }, - { text = "Name", value = "Name" }, - { text = "Power", value = "Power" }, + { text = "Health", value = "Health" }, + { text = "Name", value = "Name" }, + { text = "Power", value = "Power" }, { text = "Miscellaneous", value = "Misc" }, }) GUIContainerTabGroup:SetCallback("OnGroupSelected", SelectedGroup) @@ -2491,7 +3607,8 @@ local function CreateProfileSettings(containerParent) end ResetProfileButton:SetText("Reset |cFF8080FF" .. UUF.db:GetCurrentProfile() .. "|r Profile") local isUsingGlobal = UUF.db.global.UseGlobalProfile - ActiveProfileHeading:SetText( "Active Profile: |cFFFFFFFF" .. UUF.db:GetCurrentProfile() .. (isUsingGlobal and " (|cFFFFCC00Global|r)" or "") .. "|r" ) + ActiveProfileHeading:SetText("Active Profile: |cFFFFFFFF" .. + UUF.db:GetCurrentProfile() .. (isUsingGlobal and " (|cFFFFCC00Global|r)" or "") .. "|r") if UUF.db:IsDualSpecEnabled() then SelectProfileDropdown:SetDisabled(true) CopyFromProfileDropdown:SetDisabled(true) @@ -2514,25 +3631,60 @@ local function CreateProfileSettings(containerParent) SelectProfileDropdown = AG:Create("Dropdown") SelectProfileDropdown:SetLabel("Select...") SelectProfileDropdown:SetRelativeWidth(0.25) - SelectProfileDropdown:SetCallback("OnValueChanged", function(_, _, value) UUF.db:SetProfile(value) UUF:SetUIScale() UUF:UpdateAllUnitFrames() RefreshProfiles() end) + SelectProfileDropdown:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db:SetProfile(value) + UUF:SetUIScale() + UUF:UpdateAllUnitFrames() + RefreshProfiles() + end) ProfileContainer:AddChild(SelectProfileDropdown) CopyFromProfileDropdown = AG:Create("Dropdown") CopyFromProfileDropdown:SetLabel("Copy From...") CopyFromProfileDropdown:SetRelativeWidth(0.25) - CopyFromProfileDropdown:SetCallback("OnValueChanged", function(_, _, value) UUF:CreatePrompt("Copy Profile", "Are you sure you want to copy from |cFF8080FF" .. value .. "|r?\nThis will |cFFFF4040overwrite|r your current profile settings.", function() UUF.db:CopyProfile(value) UUF:SetUIScale() UUF:UpdateAllUnitFrames() RefreshProfiles() end) end) + CopyFromProfileDropdown:SetCallback("OnValueChanged", + function(_, _, value) + UUF:CreatePrompt("Copy Profile", + "Are you sure you want to copy from |cFF8080FF" .. + value .. "|r?\nThis will |cFFFF4040overwrite|r your current profile settings.", + function() + UUF.db:CopyProfile(value) + UUF:SetUIScale() + UUF:UpdateAllUnitFrames() + RefreshProfiles() + end) + end) ProfileContainer:AddChild(CopyFromProfileDropdown) DeleteProfileDropdown = AG:Create("Dropdown") DeleteProfileDropdown:SetLabel("Delete...") DeleteProfileDropdown:SetRelativeWidth(0.25) - DeleteProfileDropdown:SetCallback("OnValueChanged", function(_, _, value) if value ~= UUF.db:GetCurrentProfile() then UUF:CreatePrompt("Delete Profile", "Are you sure you want to delete |cFF8080FF" .. value .. "|r?", function() UUF.db:DeleteProfile(value) UUF:UpdateAllUnitFrames() RefreshProfiles() end) end end) + DeleteProfileDropdown:SetCallback("OnValueChanged", + function(_, _, value) + if value ~= UUF.db:GetCurrentProfile() then + UUF:CreatePrompt("Delete Profile", + "Are you sure you want to delete |cFF8080FF" .. value .. "|r?", + function() + UUF.db:DeleteProfile(value) + UUF:UpdateAllUnitFrames() + RefreshProfiles() + end) + end + end) ProfileContainer:AddChild(DeleteProfileDropdown) ResetProfileButton = AG:Create("Button") ResetProfileButton:SetText("Reset |cFF8080FF" .. UUF.db:GetCurrentProfile() .. "|r Profile") ResetProfileButton:SetRelativeWidth(0.25) - ResetProfileButton:SetCallback("OnClick", function() UUF.db:ResetProfile() UUF:ResolveLSM() UUF:SetUIScale() UUF:UpdateAllUnitFrames() RefreshProfiles() end) + ResetProfileButton:SetCallback("OnClick", + function() + UUF.db:ResetProfile() + UUF:ResolveLSM() + UUF:SetUIScale() + UUF:UpdateAllUnitFrames() + RefreshProfiles() + end) ProfileContainer:AddChild(ResetProfileButton) local CreateProfileEditBox = AG:Create("EditBox") @@ -2546,7 +3698,17 @@ local function CreateProfileSettings(containerParent) local CreateProfileButton = AG:Create("Button") CreateProfileButton:SetText("Create Profile") CreateProfileButton:SetRelativeWidth(0.5) - CreateProfileButton:SetCallback("OnClick", function() local profileName = strtrim(CreateProfileEditBox:GetText() or "") if profileName ~= "" then UUF.db:SetProfile(profileName) UUF:SetUIScale() UUF:UpdateAllUnitFrames() RefreshProfiles() CreateProfileEditBox:SetText("") end end) + CreateProfileButton:SetCallback("OnClick", + function() + local profileName = strtrim(CreateProfileEditBox:GetText() or "") + if profileName ~= "" then + UUF.db:SetProfile(profileName) + UUF:SetUIScale() + UUF:UpdateAllUnitFrames() + RefreshProfiles() + CreateProfileEditBox:SetText("") + end + end) ProfileContainer:AddChild(CreateProfileButton) local GlobalProfileHeading = AG:Create("Heading") @@ -2554,13 +3716,30 @@ local function CreateProfileSettings(containerParent) GlobalProfileHeading:SetFullWidth(true) ProfileContainer:AddChild(GlobalProfileHeading) - GUIWidgets.CreateInformationTag(ProfileContainer, "If |cFF8080FFUse Global Profile Settings|r is enabled, the profile selected below will be used as your active profile.\nThis is useful if you want to use the same profile across multiple characters.") + GUIWidgets.CreateInformationTag(ProfileContainer, + "If |cFF8080FFUse Global Profile Settings|r is enabled, the profile selected below will be used as your active profile.\nThis is useful if you want to use the same profile across multiple characters.") UseGlobalProfileToggle = AG:Create("CheckBox") UseGlobalProfileToggle:SetLabel("Use Global Profile Settings") UseGlobalProfileToggle:SetValue(UUF.db.global.UseGlobalProfile) UseGlobalProfileToggle:SetRelativeWidth(0.5) - UseGlobalProfileToggle:SetCallback("OnValueChanged", function(_, _, value) RefreshProfiles() UUF.db.global.UseGlobalProfile = value if value and UUF.db.global.GlobalProfile and UUF.db.global.GlobalProfile ~= "" then UUF.db:SetProfile(UUF.db.global.GlobalProfile) UUF:SetUIScale() end GlobalProfileDropdown:SetDisabled(not value) for _, child in ipairs(ProfileContainer.children) do if child ~= UseGlobalProfileToggle and child ~= GlobalProfileDropdown then GUIWidgets.DeepDisable(child, value) end end UUF:UpdateAllUnitFrames() RefreshProfiles() end) + UseGlobalProfileToggle:SetCallback("OnValueChanged", + function(_, _, value) + RefreshProfiles() + UUF.db.global.UseGlobalProfile = value + if value and UUF.db.global.GlobalProfile and UUF.db.global.GlobalProfile ~= "" then + UUF.db:SetProfile(UUF.db.global.GlobalProfile) + UUF:SetUIScale() + end + GlobalProfileDropdown:SetDisabled(not value) + for _, child in ipairs(ProfileContainer.children) do + if child ~= UseGlobalProfileToggle and child ~= GlobalProfileDropdown then + GUIWidgets.DeepDisable(child, value) + end + end + UUF:UpdateAllUnitFrames() + RefreshProfiles() + end) ProfileContainer:AddChild(UseGlobalProfileToggle) GlobalProfileDropdown = AG:Create("Dropdown") @@ -2568,7 +3747,14 @@ local function CreateProfileSettings(containerParent) GlobalProfileDropdown:SetRelativeWidth(0.5) GlobalProfileDropdown:SetList(profileKeys) GlobalProfileDropdown:SetValue(UUF.db.global.GlobalProfile) - GlobalProfileDropdown:SetCallback("OnValueChanged", function(_, _, value) UUF.db:SetProfile(value) UUF.db.global.GlobalProfile = value UUF:SetUIScale() UUF:UpdateAllUnitFrames() RefreshProfiles() end) + GlobalProfileDropdown:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db:SetProfile(value) + UUF.db.global.GlobalProfile = value + UUF:SetUIScale() + UUF:UpdateAllUnitFrames() + RefreshProfiles() + end) ProfileContainer:AddChild(GlobalProfileDropdown) local SpecProfileContainer = GUIWidgets.CreateInlineGroup(ProfileContainer, "Specialization Profiles") @@ -2577,7 +3763,13 @@ local function CreateProfileSettings(containerParent) UseDualSpecializationToggle:SetLabel("Enable Specialization Profiles") UseDualSpecializationToggle:SetValue(UUF.db:IsDualSpecEnabled()) UseDualSpecializationToggle:SetRelativeWidth(1) - UseDualSpecializationToggle:SetCallback("OnValueChanged", function(_, _, value) UUF.db:SetDualSpecEnabled(value) for i = 1, numSpecs do specProfilesList[i]:SetDisabled(not value) end UUF:UpdateAllUnitFrames() RefreshProfiles() end) + UseDualSpecializationToggle:SetCallback("OnValueChanged", + function(_, _, value) + UUF.db:SetDualSpecEnabled(value) + for i = 1, numSpecs do specProfilesList[i]:SetDisabled(not value) end + UUF:UpdateAllUnitFrames() + RefreshProfiles() + end) UseDualSpecializationToggle:SetDisabled(UUF.db.global.UseGlobalProfile) SpecProfileContainer:AddChild(UseDualSpecializationToggle) @@ -2586,7 +3778,8 @@ local function CreateProfileSettings(containerParent) specProfilesList[i] = AG:Create("Dropdown") specProfilesList[i]:SetLabel(string.format("%s", specName or ("Spec %d"):format(i))) specProfilesList[i]:SetList(profileKeys) - specProfilesList[i]:SetCallback("OnValueChanged", function(widget, event, value) UUF.db:SetDualSpecProfile(value, i) end) + specProfilesList[i]:SetCallback("OnValueChanged", + function(widget, event, value) UUF.db:SetDualSpecProfile(value, i) end) specProfilesList[i]:SetRelativeWidth(numSpecs == 2 and 0.5 or numSpecs == 3 and 0.33 or 0.25) specProfilesList[i]:SetDisabled(not UUF.db:IsDualSpecEnabled() or UUF.db.global.UseGlobalProfile) SpecProfileContainer:AddChild(specProfilesList[i]) @@ -2601,7 +3794,8 @@ local function CreateProfileSettings(containerParent) ExportingHeading:SetFullWidth(true) SharingContainer:AddChild(ExportingHeading) - GUIWidgets.CreateInformationTag(SharingContainer, "You can export your profile by pressing |cFF8080FFExport Profile|r button below & share the string with other |cFF8080FFUnhalted|r Unit Frame users.") + GUIWidgets.CreateInformationTag(SharingContainer, + "You can export your profile by pressing |cFF8080FFExport Profile|r button below & share the string with other |cFF8080FFUnhalted|r Unit Frame users.") local ExportingEditBox = AG:Create("EditBox") ExportingEditBox:SetLabel("Export String...") @@ -2615,7 +3809,12 @@ local function CreateProfileSettings(containerParent) local ExportProfileButton = AG:Create("Button") ExportProfileButton:SetText("Export Profile") ExportProfileButton:SetRelativeWidth(0.3) - ExportProfileButton:SetCallback("OnClick", function() ExportingEditBox:SetText(UUF:ExportSavedVariables()) ExportingEditBox:HighlightText() ExportingEditBox:SetFocus() end) + ExportProfileButton:SetCallback("OnClick", + function() + ExportingEditBox:SetText(UUF:ExportSavedVariables()) + ExportingEditBox:HighlightText() + ExportingEditBox:SetFocus() + end) SharingContainer:AddChild(ExportProfileButton) local ImportingHeading = AG:Create("Heading") @@ -2623,7 +3822,8 @@ local function CreateProfileSettings(containerParent) ImportingHeading:SetFullWidth(true) SharingContainer:AddChild(ImportingHeading) - GUIWidgets.CreateInformationTag(SharingContainer, "If you have an exported string, paste it in the |cFF8080FFImport String|r box below & press |cFF8080FFImport Profile|r.") + GUIWidgets.CreateInformationTag(SharingContainer, + "If you have an exported string, paste it in the |cFF8080FFImport String|r box below & press |cFF8080FFImport Profile|r.") local ImportingEditBox = AG:Create("EditBox") ImportingEditBox:SetLabel("Import String...") @@ -2637,10 +3837,22 @@ local function CreateProfileSettings(containerParent) local ImportProfileButton = AG:Create("Button") ImportProfileButton:SetText("Import Profile") ImportProfileButton:SetRelativeWidth(0.3) - ImportProfileButton:SetCallback("OnClick", function() if ImportingEditBox:GetText() ~= "" then UUF:ImportSavedVariables(ImportingEditBox:GetText()) ImportingEditBox:SetText("") end end) + ImportProfileButton:SetCallback("OnClick", + function() + if ImportingEditBox:GetText() ~= "" then + UUF:ImportSavedVariables(ImportingEditBox:GetText()) + ImportingEditBox:SetText("") + end + end) SharingContainer:AddChild(ImportProfileButton) GlobalProfileDropdown:SetDisabled(not UUF.db.global.UseGlobalProfile) - if UUF.db.global.UseGlobalProfile then for _, child in ipairs(ProfileContainer.children) do if child ~= UseGlobalProfileToggle and child ~= GlobalProfileDropdown then GUIWidgets.DeepDisable(child, true) end end end + if UUF.db.global.UseGlobalProfile then + for _, child in ipairs(ProfileContainer.children) do + if child ~= UseGlobalProfileToggle and child ~= GlobalProfileDropdown then + GUIWidgets.DeepDisable(child, true) + end + end + end end function UUF:CreateGUI() @@ -2655,7 +3867,11 @@ function UUF:CreateGUI() Container:SetWidth(900) Container:SetHeight(600) Container:EnableResize(false) - Container:SetCallback("OnClose", function(widget) AG:Release(widget) isGUIOpen = false DisableAllTestModes() end) + Container:SetCallback("OnClose", function(widget) + AG:Release(widget) + isGUIOpen = false + DisableAllTestModes() + end) local function SelectTab(GUIContainer, _, MainTab) GUIContainer:ReleaseChildren() @@ -2673,69 +3889,131 @@ function UUF:CreateGUI() CreateColourSettings(ScrollFrame) local SupportMeContainer = AG:Create("InlineGroup") - SupportMeContainer:SetTitle("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Emotes\\peepoLove.png:18:18|t How To Support " .. UUF.PRETTY_ADDON_NAME .. " Development") + SupportMeContainer:SetTitle( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Emotes\\peepoLove.png:18:18|t How To Support " .. + UUF.PRETTY_ADDON_NAME .. " Development") SupportMeContainer:SetLayout("Flow") SupportMeContainer:SetFullWidth(true) ScrollFrame:AddChild(SupportMeContainer) - -- local KoFiInteractive = AG:Create("InteractiveLabel") - -- KoFiInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:16:21|t |cFF8080FFKo-Fi|r") - -- KoFiInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") - -- KoFiInteractive:SetJustifyV("MIDDLE") - -- KoFiInteractive:SetRelativeWidth(0.33) - -- KoFiInteractive:SetCallback("OnClick", function() UUF:OpenURL("Support Me on Ko-Fi", "https://ko-fi.com/unhalted") end) - -- KoFiInteractive:SetCallback("OnEnter", function() KoFiInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:16:21|t |cFFFFFFFFKo-Fi|r") end) - -- KoFiInteractive:SetCallback("OnLeave", function() KoFiInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:16:21|t |cFF8080FFKo-Fi|r") end) - -- SupportMeContainer:AddChild(KoFiInteractive) - - -- local PayPalInteractive = AG:Create("InteractiveLabel") - -- PayPalInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:23:21|t |cFF8080FFPayPal|r") - -- PayPalInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") - -- PayPalInteractive:SetJustifyV("MIDDLE") - -- PayPalInteractive:SetRelativeWidth(0.33) - -- PayPalInteractive:SetCallback("OnClick", function() UUF:OpenURL("Support Me on PayPal", "https://www.paypal.com/paypalme/dhunt1911") end) - -- PayPalInteractive:SetCallback("OnEnter", function() PayPalInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:23:21|t |cFFFFFFFFPayPal|r") end) - -- PayPalInteractive:SetCallback("OnLeave", function() PayPalInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:23:21|t |cFF8080FFPayPal|r") end) - -- SupportMeContainer:AddChild(PayPalInteractive) + local KoFiInteractive = AG:Create("InteractiveLabel") + KoFiInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:16:21|t |cFF8080FFKo-Fi|r") + KoFiInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") + KoFiInteractive:SetJustifyV("MIDDLE") + KoFiInteractive:SetRelativeWidth(0.33) + KoFiInteractive:SetCallback("OnClick", + function() UUF:OpenURL("Support Me on Ko-Fi", "https://ko-fi.com/unhalted") end) + KoFiInteractive:SetCallback("OnEnter", + function() + KoFiInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:16:21|t |cFFFFFFFFKo-Fi|r") + end) + KoFiInteractive:SetCallback("OnLeave", + function() + KoFiInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:16:21|t |cFF8080FFKo-Fi|r") + end) + SupportMeContainer:AddChild(KoFiInteractive) + + local PayPalInteractive = AG:Create("InteractiveLabel") + PayPalInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:23:21|t |cFF8080FFPayPal|r") + PayPalInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") + PayPalInteractive:SetJustifyV("MIDDLE") + PayPalInteractive:SetRelativeWidth(0.33) + PayPalInteractive:SetCallback("OnClick", + function() UUF:OpenURL("Support Me on PayPal", "https://www.paypal.com/paypalme/dhunt1911") end) + PayPalInteractive:SetCallback("OnEnter", + function() + PayPalInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:23:21|t |cFFFFFFFFPayPal|r") + end) + PayPalInteractive:SetCallback("OnLeave", + function() + PayPalInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:23:21|t |cFF8080FFPayPal|r") + end) + SupportMeContainer:AddChild(PayPalInteractive) local TwitchInteractive = AG:Create("InteractiveLabel") - TwitchInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:25:21|t |cFF8080FFTwitch|r") + TwitchInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:25:21|t |cFF8080FFTwitch|r") TwitchInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") TwitchInteractive:SetJustifyV("MIDDLE") TwitchInteractive:SetRelativeWidth(0.33) - TwitchInteractive:SetCallback("OnClick", function() UUF:OpenURL("Support Me on Twitch", "https://www.twitch.tv/unhaltedgb") end) - TwitchInteractive:SetCallback("OnEnter", function() TwitchInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:25:21|t |cFFFFFFFFTwitch|r") end) - TwitchInteractive:SetCallback("OnLeave", function() TwitchInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:25:21|t |cFF8080FFTwitch|r") end) + TwitchInteractive:SetCallback("OnClick", + function() UUF:OpenURL("Support Me on Twitch", "https://www.twitch.tv/unhaltedgb") end) + TwitchInteractive:SetCallback("OnEnter", + function() + TwitchInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:25:21|t |cFFFFFFFFTwitch|r") + end) + TwitchInteractive:SetCallback("OnLeave", + function() + TwitchInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:25:21|t |cFF8080FFTwitch|r") + end) SupportMeContainer:AddChild(TwitchInteractive) local DiscordInteractive = AG:Create("InteractiveLabel") - DiscordInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:21:21|t |cFF8080FFDiscord|r") + DiscordInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:21:21|t |cFF8080FFDiscord|r") DiscordInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") DiscordInteractive:SetJustifyV("MIDDLE") DiscordInteractive:SetRelativeWidth(0.33) - DiscordInteractive:SetCallback("OnClick", function() UUF:OpenURL("Support Me on Discord", "https://discord.gg/UZCgWRYvVE") end) - DiscordInteractive:SetCallback("OnEnter", function() DiscordInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:21:21|t |cFFFFFFFFDiscord|r") end) - DiscordInteractive:SetCallback("OnLeave", function() DiscordInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:21:21|t |cFF8080FFDiscord|r") end) + DiscordInteractive:SetCallback("OnClick", + function() UUF:OpenURL("Support Me on Discord", "https://discord.gg/UZCgWRYvVE") end) + DiscordInteractive:SetCallback("OnEnter", + function() + DiscordInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:21:21|t |cFFFFFFFFDiscord|r") + end) + DiscordInteractive:SetCallback("OnLeave", + function() + DiscordInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:21:21|t |cFF8080FFDiscord|r") + end) SupportMeContainer:AddChild(DiscordInteractive) - -- local PatreonInteractive = AG:Create("InteractiveLabel") - -- PatreonInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:21:21|t |cFF8080FFPatreon|r") - -- PatreonInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") - -- PatreonInteractive:SetJustifyV("MIDDLE") - -- PatreonInteractive:SetRelativeWidth(0.33) - -- PatreonInteractive:SetCallback("OnClick", function() UUF:OpenURL("Support Me on Patreon", "https://www.patreon.com/unhalted") end) - -- PatreonInteractive:SetCallback("OnEnter", function() PatreonInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:21:21|t |cFFFFFFFFPatreon|r") end) - -- PatreonInteractive:SetCallback("OnLeave", function() PatreonInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:21:21|t |cFF8080FFPatreon|r") end) - -- SupportMeContainer:AddChild(PatreonInteractive) + local PatreonInteractive = AG:Create("InteractiveLabel") + PatreonInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:21:21|t |cFF8080FFPatreon|r") + PatreonInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") + PatreonInteractive:SetJustifyV("MIDDLE") + PatreonInteractive:SetRelativeWidth(0.33) + PatreonInteractive:SetCallback("OnClick", + function() UUF:OpenURL("Support Me on Patreon", "https://www.patreon.com/unhalted") end) + PatreonInteractive:SetCallback("OnEnter", + function() + PatreonInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:21:21|t |cFFFFFFFFPatreon|r") + end) + PatreonInteractive:SetCallback("OnLeave", + function() + PatreonInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:21:21|t |cFF8080FFPatreon|r") + end) + SupportMeContainer:AddChild(PatreonInteractive) local GithubInteractive = AG:Create("InteractiveLabel") - GithubInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Github.png:21:21|t |cFF8080FFGithub|r") + GithubInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Github.png:21:21|t |cFF8080FFGithub|r") GithubInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") GithubInteractive:SetJustifyV("MIDDLE") GithubInteractive:SetRelativeWidth(0.33) - GithubInteractive:SetCallback("OnClick", function() UUF:OpenURL("Support Me on Github", "https://github.com/dalehuntgb/UnhaltedUnitFrames") end) - GithubInteractive:SetCallback("OnEnter", function() GithubInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Github.png:21:21|t |cFFFFFFFFGithub|r") end) - GithubInteractive:SetCallback("OnLeave", function() GithubInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Github.png:21:21|t |cFF8080FFGithub|r") end) + GithubInteractive:SetCallback("OnClick", + function() UUF:OpenURL("Support Me on Github", "https://github.com/dalehuntgb/UnhaltedUnitFrames") end) + GithubInteractive:SetCallback("OnEnter", + function() + GithubInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Github.png:21:21|t |cFFFFFFFFGithub|r") + end) + GithubInteractive:SetCallback("OnLeave", + function() + GithubInteractive:SetText( + "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Github.png:21:21|t |cFF8080FFGithub|r") + end) SupportMeContainer:AddChild(GithubInteractive) ScrollFrame:DoLayout() @@ -2806,17 +4084,17 @@ function UUF:CreateGUI() ContainerTabGroup:SetLayout("Flow") ContainerTabGroup:SetFullWidth(true) ContainerTabGroup:SetTabs({ - { text = "General", value = "General"}, - { text = "Global", value = "Global"}, - { text = "Player", value = "Player"}, - { text = "Target", value = "Target"}, - { text = "Target of Target", value = "TargetTarget"}, - { text = "Pet", value = "Pet"}, - { text = "Focus", value = "Focus"}, - { text = "Focus Target", value = "FocusTarget"}, - { text = "Boss", value = "Boss"}, - { text = "Tags", value = "Tags"}, - { text = "Profiles", value = "Profiles"}, + { text = "General", value = "General" }, + { text = "Global", value = "Global" }, + { text = "Player", value = "Player" }, + { text = "Target", value = "Target" }, + { text = "Target of Target", value = "TargetTarget" }, + { text = "Pet", value = "Pet" }, + { text = "Focus", value = "Focus" }, + { text = "Focus Target", value = "FocusTarget" }, + { text = "Boss", value = "Boss" }, + { text = "Tags", value = "Tags" }, + { text = "Profiles", value = "Profiles" }, }) ContainerTabGroup:SetCallback("OnGroupSelected", SelectTab) ContainerTabGroup:SelectTab("General") @@ -2831,4 +4109,4 @@ function UUFG:CloseUUFGUI() if isGUIOpen and Container then Container:Hide() end -end \ No newline at end of file +end diff --git a/Core/Core.lua b/Core/Core.lua index f374e21..c4464a9 100755 --- a/Core/Core.lua +++ b/Core/Core.lua @@ -19,7 +19,22 @@ function UnhaltedUnitFrames:OnInitialize() local playerSpecalizationChangedEventFrame = CreateFrame("Frame") playerSpecalizationChangedEventFrame:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED") - playerSpecalizationChangedEventFrame:SetScript("OnEvent", function(_, event, ...) if event == "PLAYER_SPECIALIZATION_CHANGED" then local unit = ... if unit == "player" then UUF:UpdateAllUnitFrames() end end end) + playerSpecalizationChangedEventFrame:SetScript("OnEvent", + function(_, event, ...) + if event == "PLAYER_SPECIALIZATION_CHANGED" then + local unit = ... + if unit == "player" then UUF:UpdateAllUnitFrames() end + end + end) + + -- Combat fade event handler + UUF.CombatFadeEventFrame = CreateFrame("Frame") + UUF.CombatFadeEventFrame:RegisterEvent("PLAYER_REGEN_ENABLED") + UUF.CombatFadeEventFrame:RegisterEvent("PLAYER_REGEN_DISABLED") + UUF.CombatFadeEventFrame:RegisterEvent("PLAYER_TARGET_CHANGED") + UUF.CombatFadeEventFrame:SetScript("OnEvent", function(_, event, ...) + UUF:UpdateOutOfCombatFade() + end) end function UnhaltedUnitFrames:OnEnable() @@ -32,4 +47,6 @@ function UnhaltedUnitFrames:OnEnable() UUF:SpawnUnitFrame("focustarget") UUF:SpawnUnitFrame("pet") UUF:SpawnUnitFrame("boss") -end \ No newline at end of file + -- Initial fade setup + UUF:UpdateOutOfCombatFade() +end diff --git a/Core/Defaults.lua b/Core/Defaults.lua index b634632..afcb3d7 100755 --- a/Core/Defaults.lua +++ b/Core/Defaults.lua @@ -11,6 +11,11 @@ local Defaults = { Separator = "||", ToTSeparator = "»", UseCustomAbbreviations = false, + OutOfCombatFade = { + UseGlobal = true, + GlobalOpacity = 0.5, + FadeInWithTarget = false, + }, UIScale = { Enabled = false, Scale = 1.0, @@ -29,33 +34,33 @@ local Defaults = { FontFlag = "OUTLINE", Shadow = { Enabled = false, - Colour = {0, 0, 0, 1}, + Colour = { 0, 0, 0, 1 }, XPos = 1, YPos = -1, } }, Colours = { Reaction = { - [1] = {204/255, 64/255, 64/255}, -- Hated - [2] = {204/255, 64/255, 64/255}, -- Hostile - [3] = {204/255, 128/255, 64/255}, -- Unfriendly - [4] = {204/255, 204/255, 64/255}, -- Neutral - [5] = {64/255, 204/255, 64/255}, -- Friendly - [6] = {64/255, 204/255, 64/255}, -- Honored - [7] = {64/255, 204/255, 64/255}, -- Revered - [8] = {64/255, 204/255, 64/255}, -- Exalted + [1] = { 204 / 255, 64 / 255, 64 / 255 }, -- Hated + [2] = { 204 / 255, 64 / 255, 64 / 255 }, -- Hostile + [3] = { 204 / 255, 128 / 255, 64 / 255 }, -- Unfriendly + [4] = { 204 / 255, 204 / 255, 64 / 255 }, -- Neutral + [5] = { 64 / 255, 204 / 255, 64 / 255 }, -- Friendly + [6] = { 64 / 255, 204 / 255, 64 / 255 }, -- Honored + [7] = { 64 / 255, 204 / 255, 64 / 255 }, -- Revered + [8] = { 64 / 255, 204 / 255, 64 / 255 }, -- Exalted }, Power = { - [0] = {0, 0, 1}, -- Mana - [1] = {1, 0, 0}, -- Rage - [2] = {1, 0.5, 0.25}, -- Focus - [3] = {1, 1, 0}, -- Energy - [6] = {0, 0.82, 1}, -- Runic Power - [8] = {0.75, 0.52, 0.9}, -- Astral Power - [11] = {0, 0.5, 1}, -- Maelstrom - [13] = {0.4, 0, 0.8}, -- Insanity - [17] = {0.79, 0.26, 0.99}, -- Fury - [18] = {1, 0.61, 0} -- Pain + [0] = { 0, 0, 1 }, -- Mana + [1] = { 1, 0, 0 }, -- Rage + [2] = { 1, 0.5, 0.25 }, -- Focus + [3] = { 1, 1, 0 }, -- Energy + [6] = { 0, 0.82, 1 }, -- Runic Power + [8] = { 0.75, 0.52, 0.9 }, -- Astral Power + [11] = { 0, 0.5, 1 }, -- Maelstrom + [13] = { 0.4, 0, 0.8 }, -- Insanity + [17] = { 0.79, 0.26, 0.99 }, -- Fury + [18] = { 1, 0.61, 0 } -- Pain }, } }, @@ -66,8 +71,13 @@ local Defaults = { Frame = { Width = 244, Height = 42, - Layout = {"CENTER", "CENTER", -425.1, -275.1}, + Layout = { "CENTER", "CENTER", -425.1, -275.1 }, FrameStrata = "LOW", + OutOfCombatFade = { + Enabled = false, + Opacity = 0.5, + FadeInWithTarget = false, + }, }, HealthBar = { ColourByClass = true, @@ -76,30 +86,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = {8/255, 8/255, 8/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, ForegroundOpacity = 0.8, - Background = {34/255, 34/255, 34/255}, + Background = { 34 / 255, 34 / 255, 34 / 255 }, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = {255/255, 204/255, 0/255, 1.0}, + Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = {128/255, 64/255, 255/255, 1.0}, + Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = {8/255, 8/255, 8/255}, - Background = {128/255, 128/255, 128/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Background = { 128 / 255, 128 / 255, 128 / 255 }, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -111,20 +121,20 @@ local Defaults = { Enabled = true, Height = 5, Width = 100, - Foreground = {8/255, 8/255, 8/255}, - Background = {34/255, 34/255, 34/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Background = { 34 / 255, 34 / 255, 34 / 255 }, ColourByType = true, Inverse = false, - Layout = {"LEFT", "BOTTOMLEFT", 3, 1}, + Layout = { "LEFT", "BOTTOMLEFT", 3, 1 }, }, CastBar = { Enabled = true, Width = 244, Height = 24, - Layout = {"TOPLEFT", "BOTTOMLEFT", 0, -1}, - Foreground = {128/255, 128/255, 255/255}, - Background = {34/255, 34/255, 34/255}, - NotInterruptibleColour = {255/255, 64/255, 64/255}, + Layout = { "TOPLEFT", "BOTTOMLEFT", 0, -1 }, + Foreground = { 128 / 255, 128 / 255, 255 / 255 }, + Background = { 34 / 255, 34 / 255, 34 / 255 }, + NotInterruptibleColour = { 255 / 255, 64 / 255, 64 / 255 }, MatchParentWidth = true, ColourByClass = false, Inverse = false, @@ -137,15 +147,15 @@ local Defaults = { SpellName = { Enabled = true, FontSize = 12, - Layout = {"LEFT", "LEFT", 3, 0}, - Colour = {1, 1, 1}, + Layout = { "LEFT", "LEFT", 3, 0 }, + Colour = { 1, 1, 1 }, MaxChars = 15, }, Duration = { Enabled = true, FontSize = 12, - Layout = {"RIGHT", "RIGHT", -3, 0}, - Colour = {1, 1, 1}, + Layout = { "RIGHT", "RIGHT", -3, 0 }, + Colour = { 1, 1, 1 }, } } }, @@ -153,7 +163,7 @@ local Defaults = { Enabled = false, Width = 42, Height = 42, - Layout = {"RIGHT", "LEFT", -1, 0}, + Layout = { "RIGHT", "LEFT", -1, 0 }, Zoom = 0.3, UseClassPortrait = false, }, @@ -161,28 +171,28 @@ local Defaults = { RaidTargetMarker = { Enabled = true, Size = 24, - Layout = {"CENTER", "TOP", 0, 0}, + Layout = { "CENTER", "TOP", 0, 0 }, }, LeaderAssistantIndicator = { Enabled = true, Size = 16, - Layout = {"TOPLEFT", "TOPLEFT", 3, -3}, + Layout = { "TOPLEFT", "TOPLEFT", 3, -3 }, }, Resting = { Enabled = true, Size = 16, - Layout = {"LEFT", "TOPLEFT", 3, 0}, + Layout = { "LEFT", "TOPLEFT", 3, 0 }, Texture = "RESTING0" }, Combat = { Enabled = true, Size = 16, - Layout = {"CENTER", "TOP", 0, 0}, + Layout = { "CENTER", "TOP", 0, 0 }, Texture = "COMBAT0" }, Mouseover = { Enabled = true, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, HighlightOpacity = 0.75, Style = "GRADIENT" }, @@ -190,71 +200,71 @@ local Defaults = { Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = {"CENTER", "CENTER", 0, 0}, + Layout = { "CENTER", "CENTER", 0, 0 }, FontSize = 12, ScaleByIconSize = false, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, }, Buffs = { Enabled = true, OnlyShowPlayer = false, Size = 34, - Layout = {"BOTTOMRIGHT", "TOPRIGHT", 0, 1, 1}, + Layout = { "BOTTOMRIGHT", "TOPRIGHT", 0, 1, 1 }, Num = 4, Wrap = 4, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, Debuffs = { Enabled = true, OnlyShowPlayer = false, Size = 34, - Layout = {"BOTTOMLEFT", "TOPLEFT", 0, 1, 1}, + Layout = { "BOTTOMLEFT", "TOPLEFT", 0, 1, 1 }, Num = 3, Wrap = 3, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, }, Tags = { TagOne = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagTwo = { FontSize = 12, - Layout = {"RIGHT", "RIGHT", -3, 0}, - Colour = {1, 1, 1}, + Layout = { "RIGHT", "RIGHT", -3, 0 }, + Colour = { 1, 1, 1 }, Tag = "[curhp:abbr]", }, TagThree = { FontSize = 12, - Layout = {"RIGHT", "BOTTOMRIGHT", -3, 2}, - Colour = {1, 1, 1}, + Layout = { "RIGHT", "BOTTOMRIGHT", -3, 2 }, + Colour = { 1, 1, 1 }, Tag = "[powercolor][curpp]", }, TagFour = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagFive = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, } @@ -265,8 +275,13 @@ local Defaults = { Frame = { Width = 244, Height = 42, - Layout = {"CENTER", "CENTER", 425.1, -275.1}, + Layout = { "CENTER", "CENTER", 425.1, -275.1 }, FrameStrata = "LOW", + OutOfCombatFade = { + Enabled = false, + Opacity = 0.5, + FadeInWithTarget = false, + }, }, HealthBar = { ColourByClass = true, @@ -275,30 +290,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = {8/255, 8/255, 8/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, ForegroundOpacity = 0.8, - Background = {34/255, 34/255, 34/255}, + Background = { 34 / 255, 34 / 255, 34 / 255 }, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = {255/255, 204/255, 0/255, 1.0}, + Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = {128/255, 64/255, 255/255, 1.0}, + Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = {8/255, 8/255, 8/255}, - Background = {128/255, 128/255, 128/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Background = { 128 / 255, 128 / 255, 128 / 255 }, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -310,10 +325,10 @@ local Defaults = { Enabled = true, Width = 244, Height = 24, - Layout = {"TOPLEFT", "BOTTOMLEFT", 0, -1}, - Foreground = {128/255, 128/255, 255/255}, - Background = {34/255, 34/255, 34/255}, - NotInterruptibleColour = {255/255, 64/255, 64/255}, + Layout = { "TOPLEFT", "BOTTOMLEFT", 0, -1 }, + Foreground = { 128 / 255, 128 / 255, 255 / 255 }, + Background = { 34 / 255, 34 / 255, 34 / 255 }, + NotInterruptibleColour = { 255 / 255, 64 / 255, 64 / 255 }, MatchParentWidth = true, ColourByClass = false, Inverse = false, @@ -326,15 +341,15 @@ local Defaults = { SpellName = { Enabled = true, FontSize = 12, - Layout = {"LEFT", "LEFT", 3, 0}, - Colour = {1, 1, 1}, + Layout = { "LEFT", "LEFT", 3, 0 }, + Colour = { 1, 1, 1 }, MaxChars = 15, }, Duration = { Enabled = true, FontSize = 12, - Layout = {"RIGHT", "RIGHT", -3, 0}, - Colour = {1, 1, 1}, + Layout = { "RIGHT", "RIGHT", -3, 0 }, + Colour = { 1, 1, 1 }, } } }, @@ -342,7 +357,7 @@ local Defaults = { Enabled = false, Width = 42, Height = 42, - Layout = {"LEFT", "RIGHT", 1, 0}, + Layout = { "LEFT", "RIGHT", 1, 0 }, Zoom = 0.3, UseClassPortrait = false, }, @@ -350,28 +365,28 @@ local Defaults = { RaidTargetMarker = { Enabled = true, Size = 24, - Layout = {"CENTER", "TOP", 0, 0}, + Layout = { "CENTER", "TOP", 0, 0 }, }, LeaderAssistantIndicator = { Enabled = true, Size = 16, - Layout = {"TOPRIGHT", "TOPRIGHT", -3, -3}, + Layout = { "TOPRIGHT", "TOPRIGHT", -3, -3 }, }, Combat = { Enabled = true, Size = 16, - Layout = {"CENTER", "TOP", 0, 0}, + Layout = { "CENTER", "TOP", 0, 0 }, Texture = "COMBAT0" }, Mouseover = { Enabled = true, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, HighlightOpacity = 0.75, Style = "GRADIENT" }, Target = { Enabled = false, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, } }, Range = { @@ -382,71 +397,71 @@ local Defaults = { Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = {"CENTER", "CENTER", 0, 0}, + Layout = { "CENTER", "CENTER", 0, 0 }, FontSize = 12, ScaleByIconSize = false, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, }, Buffs = { Enabled = true, OnlyShowPlayer = false, Size = 34, - Layout = {"BOTTOMLEFT", "TOPLEFT", 0, 1, 1}, + Layout = { "BOTTOMLEFT", "TOPLEFT", 0, 1, 1 }, Num = 3, Wrap = 3, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, Debuffs = { Enabled = true, OnlyShowPlayer = false, Size = 34, - Layout = {"BOTTOMRIGHT", "TOPRIGHT", 0, 1, 1}, + Layout = { "BOTTOMRIGHT", "TOPRIGHT", 0, 1, 1 }, Num = 4, Wrap = 4, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, }, Tags = { TagOne = { FontSize = 12, - Layout = {"LEFT", "LEFT", 3, 0}, - Colour = {1, 1, 1}, + Layout = { "LEFT", "LEFT", 3, 0 }, + Colour = { 1, 1, 1 }, Tag = "[name]", }, TagTwo = { FontSize = 12, - Layout = {"RIGHT", "RIGHT", -3, 0}, - Colour = {1, 1, 1}, + Layout = { "RIGHT", "RIGHT", -3, 0 }, + Colour = { 1, 1, 1 }, Tag = "[curhp:abbr]", }, TagThree = { FontSize = 12, - Layout = {"RIGHT", "BOTTOMRIGHT", -3, 2}, - Colour = {1, 1, 1}, + Layout = { "RIGHT", "BOTTOMRIGHT", -3, 2 }, + Colour = { 1, 1, 1 }, Tag = "[powercolor][curpp]", }, TagFour = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagFive = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, } @@ -458,8 +473,13 @@ local Defaults = { Width = 122, Height = 22, AnchorParent = "UUF_Target", - Layout = {"TOPRIGHT", "BOTTOMRIGHT", 0, -26.1}, + Layout = { "TOPRIGHT", "BOTTOMRIGHT", 0, -26.1 }, FrameStrata = "LOW", + OutOfCombatFade = { + Enabled = false, + Opacity = 0.5, + FadeInWithTarget = false, + }, }, HealthBar = { ColourByClass = true, @@ -468,30 +488,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = {8/255, 8/255, 8/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, ForegroundOpacity = 0.8, - Background = {34/255, 34/255, 34/255}, + Background = { 34 / 255, 34 / 255, 34 / 255 }, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = {255/255, 204/255, 0/255, 1.0}, + Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = {128/255, 64/255, 255/255, 1.0}, + Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = {8/255, 8/255, 8/255}, - Background = {128/255, 128/255, 128/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Background = { 128 / 255, 128 / 255, 128 / 255 }, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -534,7 +554,7 @@ local Defaults = { Enabled = false, Width = 22, Height = 22, - Layout = {"RIGHT", "LEFT", -1, 0}, + Layout = { "RIGHT", "LEFT", -1, 0 }, Zoom = 0.3, UseClassPortrait = false, }, @@ -542,87 +562,87 @@ local Defaults = { RaidTargetMarker = { Enabled = true, Size = 16, - Layout = {"LEFT", "TOPLEFT", 3, 0}, + Layout = { "LEFT", "TOPLEFT", 3, 0 }, }, Mouseover = { Enabled = true, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, HighlightOpacity = 0.75, Style = "GRADIENT" }, Target = { Enabled = false, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, } }, Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = {"CENTER", "CENTER", 0, 0}, + Layout = { "CENTER", "CENTER", 0, 0 }, FontSize = 12, ScaleByIconSize = false, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, }, Buffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = {"RIGHT", "LEFT", -1, 0, 1}, + Layout = { "RIGHT", "LEFT", -1, 0, 1 }, Num = 3, Wrap = 3, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, Debuffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = {"LEFT", "RIGHT", 1, 0, 1}, + Layout = { "LEFT", "RIGHT", 1, 0, 1 }, Num = 3, Wrap = 3, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, }, Tags = { TagOne = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "[name]", }, TagTwo = { FontSize = 12, - Layout = {"CENTER", "CENTER",0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagThree = { FontSize = 12, - Layout = {"CENTER", "CENTER",0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagFour = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagFive = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, } @@ -634,8 +654,13 @@ local Defaults = { Width = 122, Height = 22, AnchorParent = "UUF_Player", - Layout = {"BOTTOMLEFT", "TOPLEFT", 0, 36.1}, + Layout = { "BOTTOMLEFT", "TOPLEFT", 0, 36.1 }, FrameStrata = "LOW", + OutOfCombatFade = { + Enabled = false, + Opacity = 0.5, + FadeInWithTarget = false, + }, }, HealthBar = { ColourByClass = true, @@ -644,30 +669,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = {8/255, 8/255, 8/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, ForegroundOpacity = 0.8, - Background = {34/255, 34/255, 34/255}, + Background = { 34 / 255, 34 / 255, 34 / 255 }, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = {255/255, 204/255, 0/255, 1.0}, + Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = {128/255, 64/255, 255/255, 1.0}, + Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = {8/255, 8/255, 8/255}, - Background = {128/255, 128/255, 128/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Background = { 128 / 255, 128 / 255, 128 / 255 }, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -679,10 +704,10 @@ local Defaults = { Enabled = true, Width = 244, Height = 24, - Layout = {"BOTTOMLEFT", "TOPLEFT", 0, 1}, - Foreground = {128/255, 128/255, 255/255}, - Background = {34/255, 34/255, 34/255}, - NotInterruptibleColour = {255/255, 64/255, 64/255}, + Layout = { "BOTTOMLEFT", "TOPLEFT", 0, 1 }, + Foreground = { 128 / 255, 128 / 255, 255 / 255 }, + Background = { 34 / 255, 34 / 255, 34 / 255 }, + NotInterruptibleColour = { 255 / 255, 64 / 255, 64 / 255 }, MatchParentWidth = true, ColourByClass = false, Inverse = false, @@ -695,15 +720,15 @@ local Defaults = { SpellName = { Enabled = true, FontSize = 12, - Layout = {"LEFT", "LEFT", 3, 0}, - Colour = {1, 1, 1}, + Layout = { "LEFT", "LEFT", 3, 0 }, + Colour = { 1, 1, 1 }, MaxChars = 15, }, Duration = { Enabled = true, FontSize = 12, - Layout = {"RIGHT", "RIGHT", -3, 0}, - Colour = {1, 1, 1}, + Layout = { "RIGHT", "RIGHT", -3, 0 }, + Colour = { 1, 1, 1 }, } } }, @@ -711,7 +736,7 @@ local Defaults = { Enabled = false, Width = 22, Height = 22, - Layout = {"LEFT", "RIGHT", 1, 0}, + Layout = { "LEFT", "RIGHT", 1, 0 }, Zoom = 0.3, UseClassPortrait = false, }, @@ -719,87 +744,87 @@ local Defaults = { RaidTargetMarker = { Enabled = true, Size = 16, - Layout = {"RIGHT", "TOPRIGHT", -3, 0}, + Layout = { "RIGHT", "TOPRIGHT", -3, 0 }, }, Mouseover = { Enabled = true, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, HighlightOpacity = 0.75, Style = "GRADIENT" }, Target = { Enabled = false, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, } }, Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = {"CENTER", "CENTER", 0, 0}, + Layout = { "CENTER", "CENTER", 0, 0 }, FontSize = 12, ScaleByIconSize = false, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, }, Buffs = { Enabled = true, OnlyShowPlayer = false, Size = 22, - Layout = {"RIGHT", "LEFT", -1, 0, 1}, + Layout = { "RIGHT", "LEFT", -1, 0, 1 }, Num = 1, Wrap = 1, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, Debuffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = {"LEFT", "RIGHT", 1, 0, 1}, + Layout = { "LEFT", "RIGHT", 1, 0, 1 }, Num = 3, Wrap = 3, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, }, Tags = { TagOne = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "[name]", }, TagTwo = { FontSize = 12, - Layout = {"CENTER", "CENTER",0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagThree = { FontSize = 12, - Layout = {"CENTER", "CENTER",0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagFour = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagFive = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, } @@ -811,8 +836,13 @@ local Defaults = { Width = 122, Height = 22, AnchorParent = "UUF_Focus", - Layout = {"LEFT", "RIGHT", 1, 0}, + Layout = { "LEFT", "RIGHT", 1, 0 }, FrameStrata = "LOW", + OutOfCombatFade = { + Enabled = false, + Opacity = 0.5, + FadeInWithTarget = false, + }, }, HealthBar = { ColourByClass = true, @@ -821,30 +851,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = {8/255, 8/255, 8/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, ForegroundOpacity = 0.8, - Background = {34/255, 34/255, 34/255}, + Background = { 34 / 255, 34 / 255, 34 / 255 }, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = {255/255, 204/255, 0/255, 1.0}, + Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = {128/255, 64/255, 255/255, 1.0}, + Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = {8/255, 8/255, 8/255}, - Background = {128/255, 128/255, 128/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Background = { 128 / 255, 128 / 255, 128 / 255 }, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -887,7 +917,7 @@ local Defaults = { Enabled = false, Width = 22, Height = 22, - Layout = {"RIGHT", "LEFT", -1, 0}, + Layout = { "RIGHT", "LEFT", -1, 0 }, Zoom = 0.3, UseClassPortrait = false, }, @@ -895,87 +925,87 @@ local Defaults = { RaidTargetMarker = { Enabled = true, Size = 16, - Layout = {"LEFT", "TOPLEFT", 3, 0}, + Layout = { "LEFT", "TOPLEFT", 3, 0 }, }, Mouseover = { Enabled = true, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, HighlightOpacity = 0.75, Style = "GRADIENT" }, Target = { Enabled = false, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, } }, Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = {"CENTER", "CENTER", 0, 0}, + Layout = { "CENTER", "CENTER", 0, 0 }, FontSize = 12, ScaleByIconSize = false, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, }, Buffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = {"RIGHT", "LEFT", -1, 0, 1}, + Layout = { "RIGHT", "LEFT", -1, 0, 1 }, Num = 3, Wrap = 3, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, Debuffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = {"LEFT", "RIGHT", 1, 0, 1}, + Layout = { "LEFT", "RIGHT", 1, 0, 1 }, Num = 3, Wrap = 3, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, }, Tags = { TagOne = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "[name]", }, TagTwo = { FontSize = 12, - Layout = {"CENTER", "CENTER",0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagThree = { FontSize = 12, - Layout = {"CENTER", "CENTER",0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagFour = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagFive = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, } @@ -987,8 +1017,13 @@ local Defaults = { Width = 122, Height = 22, AnchorParent = "UUF_Player", - Layout = {"TOPLEFT", "BOTTOMLEFT", 0, -26.1}, + Layout = { "TOPLEFT", "BOTTOMLEFT", 0, -26.1 }, FrameStrata = "LOW", + OutOfCombatFade = { + Enabled = false, + Opacity = 0.5, + FadeInWithTarget = false, + }, }, HealthBar = { ColourByClass = true, @@ -997,30 +1032,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = {8/255, 8/255, 8/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, ForegroundOpacity = 0.8, - Background = {34/255, 34/255, 34/255}, + Background = { 34 / 255, 34 / 255, 34 / 255 }, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = {255/255, 204/255, 0/255, 1.0}, + Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = {128/255, 64/255, 255/255, 1.0}, + Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = {8/255, 8/255, 8/255}, - Background = {128/255, 128/255, 128/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Background = { 128 / 255, 128 / 255, 128 / 255 }, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -1032,10 +1067,10 @@ local Defaults = { Enabled = false, Width = 244, Height = 24, - Layout = {"TOPLEFT", "BOTTOMLEFT", 0, -1}, - Foreground = {128/255, 128/255, 255/255}, - Background = {34/255, 34/255, 34/255}, - NotInterruptibleColour = {255/255, 64/255, 64/255}, + Layout = { "TOPLEFT", "BOTTOMLEFT", 0, -1 }, + Foreground = { 128 / 255, 128 / 255, 255 / 255 }, + Background = { 34 / 255, 34 / 255, 34 / 255 }, + NotInterruptibleColour = { 255 / 255, 64 / 255, 64 / 255 }, MatchParentWidth = true, ColourByClass = false, Inverse = false, @@ -1048,15 +1083,15 @@ local Defaults = { SpellName = { Enabled = true, FontSize = 12, - Layout = {"LEFT", "LEFT", 3, 0}, - Colour = {1, 1, 1}, + Layout = { "LEFT", "LEFT", 3, 0 }, + Colour = { 1, 1, 1 }, MaxChars = 15, }, Duration = { Enabled = true, FontSize = 12, - Layout = {"RIGHT", "RIGHT", -3, 0}, - Colour = {1, 1, 1}, + Layout = { "RIGHT", "RIGHT", -3, 0 }, + Colour = { 1, 1, 1 }, } } }, @@ -1064,7 +1099,7 @@ local Defaults = { Enabled = false, Width = 22, Height = 22, - Layout = {"LEFT", "RIGHT", 1, 0}, + Layout = { "LEFT", "RIGHT", 1, 0 }, Zoom = 0.3, UseClassPortrait = false, }, @@ -1072,87 +1107,87 @@ local Defaults = { RaidTargetMarker = { Enabled = false, Size = 16, - Layout = {"LEFT", "TOPLEFT", 3, 0}, + Layout = { "LEFT", "TOPLEFT", 3, 0 }, }, Mouseover = { Enabled = true, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, HighlightOpacity = 0.75, Style = "GRADIENT" }, Target = { Enabled = false, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, } }, Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = {"CENTER", "CENTER", 0, 0}, + Layout = { "CENTER", "CENTER", 0, 0 }, FontSize = 12, ScaleByIconSize = false, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, }, Buffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = {"LEFT", "RIGHT", 1, 0, 1}, + Layout = { "LEFT", "RIGHT", 1, 0, 1 }, Num = 1, Wrap = 1, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, Debuffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = {"RIGHT", "LEFT", -1, 0, 1}, + Layout = { "RIGHT", "LEFT", -1, 0, 1 }, Num = 3, Wrap = 3, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, }, Tags = { TagOne = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "[name]", }, TagTwo = { FontSize = 12, - Layout = {"CENTER", "CENTER",0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagThree = { FontSize = 12, - Layout = {"CENTER", "CENTER",0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagFour = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagFive = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, } @@ -1163,9 +1198,14 @@ local Defaults = { Frame = { Width = 244, Height = 42, - Layout = {"CENTER", "CENTER", 550.1, -0.1, 26}, + Layout = { "CENTER", "CENTER", 550.1, -0.1, 26 }, GrowthDirection = "DOWN", FrameStrata = "LOW", + OutOfCombatFade = { + Enabled = false, + Opacity = 0.5, + FadeInWithTarget = false, + }, }, HealthBar = { ColourByClass = true, @@ -1174,30 +1214,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = {8/255, 8/255, 8/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, ForegroundOpacity = 0.8, - Background = {34/255, 34/255, 34/255}, + Background = { 34 / 255, 34 / 255, 34 / 255 }, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = {255/255, 204/255, 0/255, 1.0}, + Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = {128/255, 64/255, 255/255, 1.0}, + Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = {8/255, 8/255, 8/255}, - Background = {128/255, 128/255, 128/255}, + Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Background = { 128 / 255, 128 / 255, 128 / 255 }, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -1209,10 +1249,10 @@ local Defaults = { Enabled = true, Width = 244, Height = 24, - Layout = {"TOPLEFT", "BOTTOMLEFT", 0, -1}, - Foreground = {128/255, 128/255, 255/255}, - Background = {34/255, 34/255, 34/255}, - NotInterruptibleColour = {255/255, 64/255, 64/255}, + Layout = { "TOPLEFT", "BOTTOMLEFT", 0, -1 }, + Foreground = { 128 / 255, 128 / 255, 255 / 255 }, + Background = { 34 / 255, 34 / 255, 34 / 255 }, + NotInterruptibleColour = { 255 / 255, 64 / 255, 64 / 255 }, MatchParentWidth = true, ColourByClass = false, Inverse = false, @@ -1225,15 +1265,15 @@ local Defaults = { SpellName = { Enabled = true, FontSize = 12, - Layout = {"LEFT", "LEFT", 3, 0}, - Colour = {1, 1, 1}, + Layout = { "LEFT", "LEFT", 3, 0 }, + Colour = { 1, 1, 1 }, MaxChars = 15, }, Duration = { Enabled = true, FontSize = 12, - Layout = {"RIGHT", "RIGHT", -3, 0}, - Colour = {1, 1, 1}, + Layout = { "RIGHT", "RIGHT", -3, 0 }, + Colour = { 1, 1, 1 }, } } }, @@ -1241,7 +1281,7 @@ local Defaults = { Enabled = true, Width = 42, Height = 42, - Layout = {"RIGHT", "LEFT", -1, 0}, + Layout = { "RIGHT", "LEFT", -1, 0 }, Zoom = 0.3, UseClassPortrait = false, }, @@ -1249,87 +1289,87 @@ local Defaults = { RaidTargetMarker = { Enabled = true, Size = 24, - Layout = {"CENTER", "TOP", 0, 0}, + Layout = { "CENTER", "TOP", 0, 0 }, }, Mouseover = { Enabled = true, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, HighlightOpacity = 0.75, Style = "GRADIENT" }, Target = { Enabled = true, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, } }, Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = {"CENTER", "CENTER", 0, 0}, + Layout = { "CENTER", "CENTER", 0, 0 }, FontSize = 12, ScaleByIconSize = false, - Colour = {1, 1, 1}, + Colour = { 1, 1, 1 }, }, Buffs = { Enabled = true, OnlyShowPlayer = false, Size = 42, - Layout = {"LEFT", "RIGHT", 1, 0, 1}, + Layout = { "LEFT", "RIGHT", 1, 0, 1 }, Num = 3, Wrap = 3, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, Debuffs = { Enabled = false, OnlyShowPlayer = false, Size = 34, - Layout = {"BOTTOMRIGHT", "TOPRIGHT", 0, 1, 1}, + Layout = { "BOTTOMRIGHT", "TOPRIGHT", 0, 1, 1 }, Num = 4, Wrap = 4, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, + Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, FontSize = 12, - Colour = {1, 1, 1, 1} + Colour = { 1, 1, 1, 1 } } }, }, Tags = { TagOne = { FontSize = 12, - Layout = {"LEFT", "LEFT", 3, 0}, - Colour = {1, 1, 1}, + Layout = { "LEFT", "LEFT", 3, 0 }, + Colour = { 1, 1, 1 }, Tag = "[name]", }, TagTwo = { FontSize = 12, - Layout = {"RIGHT", "RIGHT", -3, 0}, - Colour = {1, 1, 1}, + Layout = { "RIGHT", "RIGHT", -3, 0 }, + Colour = { 1, 1, 1 }, Tag = "[curhp:abbr]", }, TagThree = { FontSize = 12, - Layout = {"RIGHT", "BOTTOMRIGHT", -3, 2}, - Colour = {1, 1, 1}, + Layout = { "RIGHT", "BOTTOMRIGHT", -3, 2 }, + Colour = { 1, 1, 1 }, Tag = "[powercolor][curpp]", }, TagFour = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, TagFive = { FontSize = 12, - Layout = {"CENTER", "CENTER", 0, 0}, - Colour = {1, 1, 1}, + Layout = { "CENTER", "CENTER", 0, 0 }, + Colour = { 1, 1, 1 }, Tag = "", }, } @@ -1339,4 +1379,4 @@ local Defaults = { } ---@return table Defaults Returns the Default Table. -function UUF:GetDefaultDB() return Defaults end \ No newline at end of file +function UUF:GetDefaultDB() return Defaults end diff --git a/Core/Globals.lua b/Core/Globals.lua index b8de816..7c386a5 100755 --- a/Core/Globals.lua +++ b/Core/Globals.lua @@ -10,7 +10,7 @@ UUF.MAX_BOSS_FRAMES = 10 UUF.LSM = LibStub("LibSharedMedia-3.0") UUF.LDS = LibStub("LibDualSpec-1.0") UUF.AG = LibStub("AceGUI-3.0") -UUF.BACKDROP = { bgFile = "Interface\\Buttons\\WHITE8X8", edgeFile = "Interface\\Buttons\\WHITE8X8", edgeSize = 1, insets = {left = 0, right = 0, top = 0, bottom = 0} } +UUF.BACKDROP = { bgFile = "Interface\\Buttons\\WHITE8X8", edgeFile = "Interface\\Buttons\\WHITE8X8", edgeSize = 1, insets = { left = 0, right = 0, top = 0, bottom = 0 } } UUF.INFOBUTTON = "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\InfoButton.png:16:16|t " UUF.ADDON_NAME = C_AddOns.GetAddOnMetadata("UnhaltedUnitFrames", "Title") UUF.ADDON_VERSION = C_AddOns.GetAddOnMetadata("UnhaltedUnitFrames", "Version") @@ -18,20 +18,24 @@ UUF.ADDON_AUTHOR = C_AddOns.GetAddOnMetadata("UnhaltedUnitFrames", "Author") UUF.ADDON_LOGO = "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\Logo:11:12|t" UUF.PRETTY_ADDON_NAME = UUF.ADDON_LOGO .. " " .. UUF.ADDON_NAME -UUF.LSM:Register("statusbar", "Better Blizzard", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\BetterBlizzard.blp") +UUF.LSM:Register("statusbar", "Better Blizzard", + "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\BetterBlizzard.blp") UUF.LSM:Register("statusbar", "Dragonflight", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\Dragonflight.tga") UUF.LSM:Register("statusbar", "Skyline", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\Skyline.tga") UUF.LSM:Register("statusbar", "Stripes", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\Stripes.png") UUF.LSM:Register("statusbar", "Thin Stripes", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\ThinStripes.png") -UUF.LSM:Register("background", "Dragonflight", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\Backgrounds\\Dragonflight_BG.tga") +UUF.LSM:Register("background", "Dragonflight", + "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\Backgrounds\\Dragonflight_BG.tga") UUF.LSM:Register("font", "Expressway", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\Expressway.ttf") UUF.LSM:Register("font", "Avante", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\Avante.ttf") UUF.LSM:Register("font", "Avantgarde (Book)", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\AvantGarde\\Book.ttf") -UUF.LSM:Register("font", "Avantgarde (Book Oblique)", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\AvantGarde\\BookOblique.ttf") +UUF.LSM:Register("font", "Avantgarde (Book Oblique)", + "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\AvantGarde\\BookOblique.ttf") UUF.LSM:Register("font", "Avantgarde (Demi)", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\AvantGarde\\Demi.ttf") -UUF.LSM:Register("font", "Avantgarde (Regular)", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\AvantGarde\\Regular.ttf") +UUF.LSM:Register("font", "Avantgarde (Regular)", + "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\AvantGarde\\Regular.ttf") UUF.StatusTextures = { Combat = { @@ -71,7 +75,10 @@ function UUF:FetchFrameName(unit) ["boss"] = "UUF_Boss", } if not unit then return end - if unit:match("^boss(%d+)$") then local unitID = unit:match("^boss(%d+)$") return "UUF_Boss" .. unitID end + if unit:match("^boss(%d+)$") then + local unitID = unit:match("^boss(%d+)$") + return "UUF_Boss" .. unitID + end return UnitToFrame[unit] end @@ -80,7 +87,8 @@ function UUF:ResolveLSM() local General = UUF.db.profile.General UUF.Media = UUF.Media or {} UUF.Media.Font = LSM:Fetch("font", General.Fonts.Font) or STANDARD_TEXT_FONT - UUF.Media.Foreground = LSM:Fetch("statusbar", General.Textures.Foreground) or "Interface\\RaidFrame\\Raid-Bar-Hp-Fill" + UUF.Media.Foreground = LSM:Fetch("statusbar", General.Textures.Foreground) or + "Interface\\RaidFrame\\Raid-Bar-Hp-Fill" UUF.Media.Background = LSM:Fetch("statusbar", General.Textures.Background) or "Interface\\Buttons\\WHITE8X8" end @@ -158,7 +166,8 @@ local function AddAnchorsToBCDM() ["UUF_Target"] = "|cFF8080FFUnhalted|rUnitFrames: Target Frame", ["UUF_Pet"] = "|cFF8080FFUnhalted|rUnitFrames: Pet Frame", } - BCDMG.AddAnchors("UnhaltedUnitFrames", {"Utility", "Custom", "AdditionalCustom", "Item", "ItemSpell", "Trinket"}, UUF_Anchors) + BCDMG.AddAnchors("UnhaltedUnitFrames", { "Utility", "Custom", "AdditionalCustom", "Item", "ItemSpell", "Trinket" }, + UUF_Anchors) end function UUF:Init() @@ -209,14 +218,14 @@ function UUF:GetClassColour(unitFrame) local _, class = UnitClass(unitFrame.unit) local classColour = RAID_CLASS_COLORS[class] if classColour then - return {classColour.r, classColour.g, classColour.b, 1} + return { classColour.r, classColour.g, classColour.b, 1 } end end function UUF:GetReactionColour(reaction) local reactionColour = oUF.colors.reaction[reaction] if reactionColour then - return {reactionColour.r, reactionColour.g, reactionColour.b, 1} + return { reactionColour.r, reactionColour.g, reactionColour.b, 1 } end end @@ -227,12 +236,12 @@ end function UUF:RequiresAlternativePowerBar() local SpecsNeedingAltPower = { - PRIEST = { 258 }, -- Shadow - MAGE = { 62, 63, 64 }, -- Fire, Frost - PALADIN = { 70 }, -- Ret - SHAMAN = { 262, 263 }, -- Ele, Enh - EVOKER = { 1467, 1473 }, -- Dev, Aug - DRUID = { 102, 103, 104 }, -- Balance, Feral, Guardian + PRIEST = { 258 }, -- Shadow + MAGE = { 62, 63, 64 }, -- Fire, Frost + PALADIN = { 70 }, -- Ret + SHAMAN = { 262, 263 }, -- Ele, Enh + EVOKER = { 1467, 1473 }, -- Dev, Aug + DRUID = { 102, 103, 104 }, -- Balance, Feral, Guardian } local class = select(2, UnitClass("player")) local specIndex = GetSpecialization() @@ -245,15 +254,15 @@ function UUF:RequiresAlternativePowerBar() end UUF.LayoutConfig = { - TOPLEFT = { anchor="TOPLEFT", offsetMultiplier=0 }, - TOP = { anchor="TOP", offsetMultiplier=0 }, - TOPRIGHT = { anchor="TOPRIGHT", offsetMultiplier=0 }, - BOTTOMLEFT = { anchor="TOPLEFT", offsetMultiplier=1 }, - BOTTOM = { anchor="TOP", offsetMultiplier=1 }, - BOTTOMRIGHT = { anchor="TOPRIGHT", offsetMultiplier=1 }, - CENTER = { anchor="CENTER", offsetMultiplier=0.5, isCenter=true }, - LEFT = { anchor="LEFT", offsetMultiplier=0.5, isCenter=true }, - RIGHT = { anchor="RIGHT", offsetMultiplier=0.5, isCenter=true }, + TOPLEFT = { anchor = "TOPLEFT", offsetMultiplier = 0 }, + TOP = { anchor = "TOP", offsetMultiplier = 0 }, + TOPRIGHT = { anchor = "TOPRIGHT", offsetMultiplier = 0 }, + BOTTOMLEFT = { anchor = "TOPLEFT", offsetMultiplier = 1 }, + BOTTOM = { anchor = "TOP", offsetMultiplier = 1 }, + BOTTOMRIGHT = { anchor = "TOPRIGHT", offsetMultiplier = 1 }, + CENTER = { anchor = "CENTER", offsetMultiplier = 0.5, isCenter = true }, + LEFT = { anchor = "LEFT", offsetMultiplier = 0.5, isCenter = true }, + RIGHT = { anchor = "RIGHT", offsetMultiplier = 0.5, isCenter = true }, } function UUF:SetTagUpdateInterval() @@ -322,6 +331,92 @@ function UUFG:UpdateAllTags() end end +function UUF:UpdateOutOfCombatFade() + local inCombat = UnitAffectingCombat("player") + local hasTarget = UnitExists("target") + local fadeSettings = UUF.db.profile.General.OutOfCombatFade + + -- List of units to update + local units = { "PLAYER", "TARGET", "TARGETTARGET", "FOCUS", "FOCUSTARGET", "PET" } + + for _, unitKey in ipairs(units) do + local unitFrame = UUF[unitKey] + if unitFrame then + local unitName = unitKey:lower() + local unitDB = UUF.db.profile.Units[unitName] + + if unitDB and unitDB.Frame then + local useGlobal = fadeSettings.UseGlobal + local fadeEnabled = false + local targetOpacity = 1.0 + local fadeInWithTarget = false + + if useGlobal then + fadeEnabled = true + targetOpacity = fadeSettings.GlobalOpacity or 0.5 + fadeInWithTarget = fadeSettings.FadeInWithTarget or false + else + fadeEnabled = unitDB.Frame.OutOfCombatFade.Enabled + targetOpacity = unitDB.Frame.OutOfCombatFade.Opacity or 0.5 + fadeInWithTarget = unitDB.Frame.OutOfCombatFade.FadeInWithTarget or false + end + + -- Determine the target alpha: + -- - If in combat, always full opacity + -- - If out of combat and fade is enabled: + -- - If fadeInWithTarget is enabled and we have a target, full opacity + -- - Otherwise, use targetOpacity + local shouldFade = fadeEnabled and not inCombat + local shouldFadeInWithTarget = fadeInWithTarget and hasTarget + + if shouldFade and not shouldFadeInWithTarget then + unitFrame:SetAlpha(targetOpacity) + else + unitFrame:SetAlpha(1.0) + end + end + end + end + + -- Update boss frames + for i = 1, UUF.MAX_BOSS_FRAMES do + local bossFrame = UUF["BOSS" .. i] + if bossFrame then + local bossDB = UUF.db.profile.Units.boss + if bossDB and bossDB.Frame then + local useGlobal = fadeSettings.UseGlobal + local fadeEnabled = false + local targetOpacity = 1.0 + local fadeInWithTarget = false + + if useGlobal then + fadeEnabled = true + targetOpacity = fadeSettings.GlobalOpacity or 0.5 + fadeInWithTarget = fadeSettings.FadeInWithTarget or false + else + fadeEnabled = bossDB.Frame.OutOfCombatFade.Enabled + targetOpacity = bossDB.Frame.OutOfCombatFade.Opacity or 0.5 + fadeInWithTarget = bossDB.Frame.OutOfCombatFade.FadeInWithTarget or false + end + + -- Determine the target alpha: + -- - If in combat, always full opacity + -- - If out of combat and fade is enabled: + -- - If fadeInWithTarget is enabled and we have a target, full opacity + -- - Otherwise, use targetOpacity + local shouldFade = fadeEnabled and not inCombat + local shouldFadeInWithTarget = fadeInWithTarget and hasTarget + + if shouldFade and not shouldFadeInWithTarget then + bossFrame:SetAlpha(targetOpacity) + else + bossFrame:SetAlpha(1.0) + end + end + end + end +end + -- Thanks Details / Plater for this. function UUF:CleanTruncateUTF8String(text) local DetailsFramework = _G.DF @@ -329,4 +424,4 @@ function UUF:CleanTruncateUTF8String(text) return DetailsFramework:CleanTruncateUTF8String(text) end return text -end \ No newline at end of file +end From 64ce7baa44691cf41f6c3a1bf34cd3a0c5bd72ce Mon Sep 17 00:00:00 2001 From: bitdruid Date: Sun, 25 Jan 2026 16:07:03 +0100 Subject: [PATCH 2/2] revert formattings --- Core/Config/GUI.lua | 2034 +++++++++---------------------------------- Core/Core.lua | 10 +- Core/Defaults.lua | 540 ++++++------ Core/Globals.lua | 61 +- 4 files changed, 695 insertions(+), 1950 deletions(-) diff --git a/Core/Config/GUI.lua b/Core/Config/GUI.lua index 39a1396..c807591 100755 --- a/Core/Config/GUI.lua +++ b/Core/Config/GUI.lua @@ -14,8 +14,7 @@ local function SaveSubTab(unit, tabName, subTabValue) end local function GetSavedSubTab(unit, tabName, defaultValue) - return lastSelectedUnitTabs[unit] and lastSelectedUnitTabs[unit].subTabs and - lastSelectedUnitTabs[unit].subTabs[tabName] or defaultValue + return lastSelectedUnitTabs[unit] and lastSelectedUnitTabs[unit].subTabs and lastSelectedUnitTabs[unit].subTabs[tabName] or defaultValue end local function GetSavedMainTab(unit, defaultValue) @@ -33,7 +32,7 @@ local UnitDBToUnitPrettyName = { } local AnchorPoints = { { ["TOPLEFT"] = "Top Left", ["TOP"] = "Top", ["TOPRIGHT"] = "Top Right", ["LEFT"] = "Left", ["CENTER"] = "Center", ["RIGHT"] = "Right", ["BOTTOMLEFT"] = "Bottom Left", ["BOTTOM"] = "Bottom", ["BOTTOMRIGHT"] = "Bottom Right" }, { "TOPLEFT", "TOP", "TOPRIGHT", "LEFT", "CENTER", "RIGHT", "BOTTOMLEFT", "BOTTOM", "BOTTOMRIGHT", } } -local FrameStrataList = { { ["BACKGROUND"] = "Background", ["LOW"] = "Low", ["MEDIUM"] = "Medium", ["HIGH"] = "High", ["DIALOG"] = "Dialog", ["FULLSCREEN"] = "Fullscreen", ["FULLSCREEN_DIALOG"] = "Fullscreen Dialog", ["TOOLTIP"] = "Tooltip" }, { "BACKGROUND", "LOW", "MEDIUM", "HIGH", "DIALOG", "FULLSCREEN", "FULLSCREEN_DIALOG", "TOOLTIP" } } +local FrameStrataList = {{ ["BACKGROUND"] = "Background", ["LOW"] = "Low", ["MEDIUM"] = "Medium", ["HIGH"] = "High", ["DIALOG"] = "Dialog", ["FULLSCREEN"] = "Fullscreen", ["FULLSCREEN_DIALOG"] = "Fullscreen Dialog", ["TOOLTIP"] = "Tooltip" }, { "BACKGROUND", "LOW", "MEDIUM", "HIGH", "DIALOG", "FULLSCREEN", "FULLSCREEN_DIALOG", "TOOLTIP" }} local Power = { [0] = "Mana", @@ -136,33 +135,26 @@ end local function GenerateSupportText(parentFrame) local SupportOptions = { - "Support Me on |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:13:18|t |cFF8080FFKo-Fi|r!", - "Support Me on |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:14:14|t |cFF8080FFPatreon|r!", - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:20:18|t |cFF8080FFPayPal Donations|r are appreciated!", + -- "Support Me on |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:13:18|t |cFF8080FFKo-Fi|r!", + -- "Support Me on |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:14:14|t |cFF8080FFPatreon|r!", + -- "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:20:18|t |cFF8080FFPayPal Donations|r are appreciated!", "Join the |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:18:18|t |cFF8080FFDiscord|r Community!", "Report Issues / Feedback on |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\GitHub.png:18:18|t |cFF8080FFGitHub|r!", "Follow Me on |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:18:14|t |cFF8080FFTwitch|r!", - "|cFF8080FFSupport|r is truly appreciated |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Emotes\\peepoLove.png:18:18|t " .. - "|cFF8080FFDevelopment|r takes time & effort." + "|cFF8080FFSupport|r is truly appreciated |TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Emotes\\peepoLove.png:18:18|t " .. "|cFF8080FFDevelopment|r takes time & effort." } parentFrame.statustext:SetText(SupportOptions[math.random(1, #SupportOptions)]) end local function CreateUIScaleSettings(containerParent) local Container = GUIWidgets.CreateInlineGroup(containerParent, "UI Scale") - GUIWidgets.CreateInformationTag(Container, - "These options allow you to adjust the UI Scale beyond the means that |cFF00B0F7Blizzard|r provides. If you encounter issues, please |cFFFF4040disable|r this feature.") + GUIWidgets.CreateInformationTag(Container,"These options allow you to adjust the UI Scale beyond the means that |cFF00B0F7Blizzard|r provides. If you encounter issues, please |cFFFF4040disable|r this feature.") local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable UI Scale") Toggle:SetValue(UUF.db.profile.General.UIScale.Enabled) Toggle:SetFullWidth(true) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db.profile.General.UIScale.Enabled = value - UUF:SetUIScale() - GUIWidgets.DeepDisable(Container, not value, Toggle) - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.UIScale.Enabled = value UUF:SetUIScale() GUIWidgets.DeepDisable(Container, not value, Toggle) end) Toggle:SetRelativeWidth(0.5) Container:AddChild(Toggle) @@ -171,11 +163,7 @@ local function CreateUIScaleSettings(containerParent) Slider:SetValue(UUF.db.profile.General.UIScale.Scale) Slider:SetSliderValues(0.3, 1.5, 0.01) Slider:SetFullWidth(true) - Slider:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db.profile.General.UIScale.Scale = value - UUF:SetUIScale() - end) + Slider:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.UIScale.Scale = value UUF:SetUIScale() end) Slider:SetRelativeWidth(0.5) Container:AddChild(Slider) @@ -184,55 +172,24 @@ local function CreateUIScaleSettings(containerParent) local PixelPerfectButton = AG:Create("Button") PixelPerfectButton:SetText("Pixel Perfect Scale") PixelPerfectButton:SetRelativeWidth(0.33) - PixelPerfectButton:SetCallback("OnClick", - function() - local pixelScale = UUF:GetPixelPerfectScale() - UUF.db.profile.General.UIScale.Scale = pixelScale - UUF:SetUIScale() - Slider:SetValue(pixelScale) - end) - PixelPerfectButton:SetCallback("OnEnter", - function() - GameTooltip:SetOwner(PixelPerfectButton.frame, "ANCHOR_CURSOR") - GameTooltip:AddLine("Recommended UI Scale: |cFF8080FF" .. UUF:GetPixelPerfectScale() .. "|r", 1, 1, 1, false) - GameTooltip:Show() - end) + PixelPerfectButton:SetCallback("OnClick", function() local pixelScale = UUF:GetPixelPerfectScale() UUF.db.profile.General.UIScale.Scale = pixelScale UUF:SetUIScale() Slider:SetValue(pixelScale) end) + PixelPerfectButton:SetCallback("OnEnter", function() GameTooltip:SetOwner(PixelPerfectButton.frame, "ANCHOR_CURSOR") GameTooltip:AddLine("Recommended UI Scale: |cFF8080FF" .. UUF:GetPixelPerfectScale() .. "|r", 1, 1, 1, false) GameTooltip:Show() end) PixelPerfectButton:SetCallback("OnLeave", function() GameTooltip:Hide() end) Container:AddChild(PixelPerfectButton) local TenEighytyPButton = AG:Create("Button") TenEighytyPButton:SetText("1080p Scale") TenEighytyPButton:SetRelativeWidth(0.33) - TenEighytyPButton:SetCallback("OnClick", - function() - UUF.db.profile.General.UIScale.Scale = 0.7111111111111 - UUF:SetUIScale() - Slider:SetValue(0.7111111111111) - end) - TenEighytyPButton:SetCallback("OnEnter", - function() - GameTooltip:SetOwner(TenEighytyPButton.frame, "ANCHOR_CURSOR") - GameTooltip:AddLine("UI Scale: |cFF8080FF0.7111111111111|r", 1, 1, 1, false) - GameTooltip:Show() - end) + TenEighytyPButton:SetCallback("OnClick", function() UUF.db.profile.General.UIScale.Scale = 0.7111111111111 UUF:SetUIScale() Slider:SetValue(0.7111111111111) end) + TenEighytyPButton:SetCallback("OnEnter", function() GameTooltip:SetOwner(TenEighytyPButton.frame, "ANCHOR_CURSOR") GameTooltip:AddLine("UI Scale: |cFF8080FF0.7111111111111|r", 1, 1, 1, false) GameTooltip:Show() end) TenEighytyPButton:SetCallback("OnLeave", function() GameTooltip:Hide() end) Container:AddChild(TenEighytyPButton) local FourteenFortyPButton = AG:Create("Button") FourteenFortyPButton:SetText("1440p Scale") FourteenFortyPButton:SetRelativeWidth(0.33) - FourteenFortyPButton:SetCallback("OnClick", - function() - UUF.db.profile.General.UIScale.Scale = 0.5333333333333 - UUF:SetUIScale() - Slider:SetValue(0.5333333333333) - end) - FourteenFortyPButton:SetCallback("OnEnter", - function() - GameTooltip:SetOwner(FourteenFortyPButton.frame, "ANCHOR_CURSOR") - GameTooltip:AddLine("UI Scale: |cFF8080FF0.5333333333333|r", 1, 1, 1, false) - GameTooltip:Show() - end) + FourteenFortyPButton:SetCallback("OnClick", function() UUF.db.profile.General.UIScale.Scale = 0.5333333333333 UUF:SetUIScale() Slider:SetValue(0.5333333333333) end) + FourteenFortyPButton:SetCallback("OnEnter", function() GameTooltip:SetOwner(FourteenFortyPButton.frame, "ANCHOR_CURSOR") GameTooltip:AddLine("UI Scale: |cFF8080FF0.5333333333333|r", 1, 1, 1, false) GameTooltip:Show() end) FourteenFortyPButton:SetCallback("OnLeave", function() GameTooltip:Hide() end) Container:AddChild(FourteenFortyPButton) @@ -242,43 +199,22 @@ end local function CreateFontSettings(containerParent) local Container = GUIWidgets.CreateInlineGroup(containerParent, "Fonts") - GUIWidgets.CreateInformationTag(Container, - "Fonts are applied to all Unit Frames & Elements where appropriate. More fonts can be added via |cFFFFCC00SharedMedia|r.") + GUIWidgets.CreateInformationTag(Container,"Fonts are applied to all Unit Frames & Elements where appropriate. More fonts can be added via |cFFFFCC00SharedMedia|r.") local FontDropdown = AG:Create("LSM30_Font") FontDropdown:SetList(LSM:HashTable("font")) FontDropdown:SetLabel("Font") FontDropdown:SetValue(UUF.db.profile.General.Fonts.Font) FontDropdown:SetRelativeWidth(0.5) - FontDropdown:SetCallback("OnValueChanged", - function(widget, _, value) - widget:SetValue(value) - UUF.db.profile.General.Fonts.Font = value - UUF:ResolveLSM() - UUF:UpdateAllUnitFrames() - end) + FontDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) UUF.db.profile.General.Fonts.Font = value UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) Container:AddChild(FontDropdown) local FontFlagDropdown = AG:Create("Dropdown") - FontFlagDropdown:SetList({ - ["NONE"] = "None", - ["OUTLINE"] = "Outline", - ["THICKOUTLINE"] = "Thick Outline", - ["MONOCHROME"] = "Monochrome", - ["MONOCHROMEOUTLINE"] = "Monochrome Outline", - ["MONOCHROMETHICKOUTLINE"] = - "Monochrome Thick Outline" - }) + FontFlagDropdown:SetList({["NONE"] = "None", ["OUTLINE"] = "Outline", ["THICKOUTLINE"] = "Thick Outline", ["MONOCHROME"] = "Monochrome", ["MONOCHROMEOUTLINE"] = "Monochrome Outline", ["MONOCHROMETHICKOUTLINE"] = "Monochrome Thick Outline"}) FontFlagDropdown:SetLabel("Font Flag") FontFlagDropdown:SetValue(UUF.db.profile.General.Fonts.FontFlag) FontFlagDropdown:SetRelativeWidth(0.5) - FontFlagDropdown:SetCallback("OnValueChanged", - function(widget, _, value) - widget:SetValue(value) - UUF.db.profile.General.Fonts.FontFlag = value - UUF:ResolveLSM() - UUF:UpdateAllUnitFrames() - end) + FontFlagDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) UUF.db.profile.General.Fonts.FontFlag = value UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) Container:AddChild(FontFlagDropdown) local SimpleGroup = AG:Create("SimpleGroup") @@ -292,13 +228,7 @@ local function CreateFontSettings(containerParent) Toggle:SetLabel("Enable Font Shadows") Toggle:SetValue(UUF.db.profile.General.Fonts.Shadow.Enabled) Toggle:SetFullWidth(true) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db.profile.General.Fonts.Shadow.Enabled = value - UUF:ResolveLSM() - GUIWidgets.DeepDisable(SimpleGroup, not UUF.db.profile.General.Fonts.Shadow.Enabled, Toggle) - UUF:UpdateAllUnitFrames() - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.Fonts.Shadow.Enabled = value UUF:ResolveLSM() GUIWidgets.DeepDisable(SimpleGroup, not UUF.db.profile.General.Fonts.Shadow.Enabled, Toggle) UUF:UpdateAllUnitFrames() end) Toggle:SetRelativeWidth(0.5) SimpleGroup:AddChild(Toggle) @@ -306,12 +236,7 @@ local function CreateFontSettings(containerParent) ColorPicker:SetLabel("Colour") ColorPicker:SetColor(unpack(UUF.db.profile.General.Fonts.Shadow.Colour)) ColorPicker:SetFullWidth(true) - ColorPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b, a) - UUF.db.profile.General.Fonts.Shadow.Colour = { r, g, b, a } - UUF:ResolveLSM() - UUF:UpdateAllUnitFrames() - end) + ColorPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) UUF.db.profile.General.Fonts.Shadow.Colour = {r, g, b, a} UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) ColorPicker:SetRelativeWidth(0.5) SimpleGroup:AddChild(ColorPicker) @@ -320,12 +245,7 @@ local function CreateFontSettings(containerParent) XSlider:SetValue(UUF.db.profile.General.Fonts.Shadow.XPos) XSlider:SetSliderValues(-5, 5, 1) XSlider:SetFullWidth(true) - XSlider:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db.profile.General.Fonts.Shadow.XPos = value - UUF:ResolveLSM() - UUF:UpdateAllUnitFrames() - end) + XSlider:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.Fonts.Shadow.XPos = value UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) XSlider:SetRelativeWidth(0.5) SimpleGroup:AddChild(XSlider) @@ -334,12 +254,7 @@ local function CreateFontSettings(containerParent) YSlider:SetValue(UUF.db.profile.General.Fonts.Shadow.YPos) YSlider:SetSliderValues(-5, 5, 1) YSlider:SetFullWidth(true) - YSlider:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db.profile.General.Fonts.Shadow.YPos = value - UUF:ResolveLSM() - UUF:UpdateAllUnitFrames() - end) + YSlider:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.Fonts.Shadow.YPos = value UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) YSlider:SetRelativeWidth(0.5) SimpleGroup:AddChild(YSlider) @@ -349,21 +264,14 @@ end local function CreateTextureSettings(containerParent) local Container = GUIWidgets.CreateInlineGroup(containerParent, "Textures") - GUIWidgets.CreateInformationTag(Container, - "Textures are applied to all Unit Frames & Elements where appropriate. More textures can be added via |cFFFFCC00SharedMedia|r.") + GUIWidgets.CreateInformationTag(Container,"Textures are applied to all Unit Frames & Elements where appropriate. More textures can be added via |cFFFFCC00SharedMedia|r.") local ForegroundTextureDropdown = AG:Create("LSM30_Statusbar") ForegroundTextureDropdown:SetList(LSM:HashTable("statusbar")) ForegroundTextureDropdown:SetLabel("Foreground Texture") ForegroundTextureDropdown:SetValue(UUF.db.profile.General.Textures.Foreground) ForegroundTextureDropdown:SetRelativeWidth(0.5) - ForegroundTextureDropdown:SetCallback("OnValueChanged", - function(widget, _, value) - widget:SetValue(value) - UUF.db.profile.General.Textures.Foreground = value - UUF:ResolveLSM() - UUF:UpdateAllUnitFrames() - end) + ForegroundTextureDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) UUF.db.profile.General.Textures.Foreground = value UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) Container:AddChild(ForegroundTextureDropdown) local BackgroundTextureDropdown = AG:Create("LSM30_Statusbar") @@ -371,45 +279,16 @@ local function CreateTextureSettings(containerParent) BackgroundTextureDropdown:SetLabel("Background Texture") BackgroundTextureDropdown:SetValue(UUF.db.profile.General.Textures.Background) BackgroundTextureDropdown:SetRelativeWidth(0.5) - BackgroundTextureDropdown:SetCallback("OnValueChanged", - function(widget, _, value) - widget:SetValue(value) - UUF.db.profile.General.Textures.Background = value - UUF:ResolveLSM() - UUF:UpdateAllUnitFrames() - end) + BackgroundTextureDropdown:SetCallback("OnValueChanged", function(widget, _, value) widget:SetValue(value) UUF.db.profile.General.Textures.Background = value UUF:ResolveLSM() UUF:UpdateAllUnitFrames() end) Container:AddChild(BackgroundTextureDropdown) local MouseoverStyleDropdown = AG:Create("Dropdown") - MouseoverStyleDropdown:SetList({ - ["SELECT"] = "Set a Highlight Texture...", - ["BORDER"] = "Border", - ["OVERLAY"] = - "Overlay", - ["GRADIENT"] = "Gradient" - }) + MouseoverStyleDropdown:SetList({["SELECT"] = "Set a Highlight Texture...", ["BORDER"] = "Border", ["OVERLAY"] = "Overlay", ["GRADIENT"] = "Gradient" }) MouseoverStyleDropdown:SetLabel("Highlight Style") MouseoverStyleDropdown:SetValue("SELECT") MouseoverStyleDropdown:SetRelativeWidth(0.5) - MouseoverStyleDropdown:SetCallback("OnValueChanged", - function(_, _, value) - for _, unitDB in pairs(UUF.db.profile.Units) do - if unitDB.Indicators.Mouseover and unitDB.Indicators.Mouseover.Enabled then - unitDB.Indicators.Mouseover.Style = - value - end - end - UUF:UpdateAllUnitFrames() - MouseoverStyleDropdown:SetValue("SELECT") - end) - MouseoverStyleDropdown:SetCallback("OnEnter", - function() - GameTooltip:SetOwner(MouseoverStyleDropdown.frame, "ANCHOR_BOTTOM") - GameTooltip:AddLine( - "Set |cFF8080FFMouseover Highlight Style|r for all units. |cFF8080FFColour|r & |cFF8080FFAlpha|r can be adjusted per unit.", - 1, 1, 1) - GameTooltip:Show() - end) + MouseoverStyleDropdown:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do if unitDB.Indicators.Mouseover and unitDB.Indicators.Mouseover.Enabled then unitDB.Indicators.Mouseover.Style = value end end UUF:UpdateAllUnitFrames() MouseoverStyleDropdown:SetValue("SELECT") end) + MouseoverStyleDropdown:SetCallback("OnEnter", function() GameTooltip:SetOwner(MouseoverStyleDropdown.frame, "ANCHOR_BOTTOM") GameTooltip:AddLine("Set |cFF8080FFMouseover Highlight Style|r for all units. |cFF8080FFColour|r & |cFF8080FFAlpha|r can be adjusted per unit.", 1, 1, 1) GameTooltip:Show() end) MouseoverStyleDropdown:SetCallback("OnLeave", function() GameTooltip:Hide() end) Container:AddChild(MouseoverStyleDropdown) @@ -419,28 +298,15 @@ local function CreateTextureSettings(containerParent) MouseoverHighlightSlider:SetSliderValues(0.0, 1.0, 0.01) MouseoverHighlightSlider:SetRelativeWidth(0.5) MouseoverHighlightSlider:SetIsPercent(true) - MouseoverHighlightSlider:SetCallback("OnValueChanged", - function(_, _, value) - for _, unitDB in pairs(UUF.db.profile.Units) do - if unitDB.Indicators.Mouseover and unitDB.Indicators.Mouseover.Enabled then - unitDB.Indicators.Mouseover.HighlightOpacity = - value - end - end - UUF:UpdateAllUnitFrames() - end) + MouseoverHighlightSlider:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do if unitDB.Indicators.Mouseover and unitDB.Indicators.Mouseover.Enabled then unitDB.Indicators.Mouseover.HighlightOpacity = value end end UUF:UpdateAllUnitFrames() end) Container:AddChild(MouseoverHighlightSlider) local ForegroundColourPicker = AG:Create("ColorPicker") ForegroundColourPicker:SetLabel("Foreground Colour") - local R, G, B = 8 / 255, 8 / 255, 8 / 255 + local R, G, B = 8/255, 8/255, 8/255 ForegroundColourPicker:SetColor(R, G, B) ForegroundColourPicker:SetRelativeWidth(0.5) - ForegroundColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b, a) - for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.ForegroundColour = { r, g, b } end - UUF:UpdateAllUnitFrames() - end) + ForegroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.ForegroundColour = {r, g, b} end UUF:UpdateAllUnitFrames() end) Container:AddChild(ForegroundColourPicker) local ForegroundOpacitySlider = AG:Create("Slider") @@ -449,23 +315,15 @@ local function CreateTextureSettings(containerParent) ForegroundOpacitySlider:SetSliderValues(0.0, 1.0, 0.01) ForegroundOpacitySlider:SetRelativeWidth(0.5) ForegroundOpacitySlider:SetIsPercent(true) - ForegroundOpacitySlider:SetCallback("OnValueChanged", - function(_, _, value) - for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.ForegroundOpacity = value end - UUF:UpdateAllUnitFrames() - end) + ForegroundOpacitySlider:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.ForegroundOpacity = value end UUF:UpdateAllUnitFrames() end) Container:AddChild(ForegroundOpacitySlider) local BackgroundColourPicker = AG:Create("ColorPicker") BackgroundColourPicker:SetLabel("Background Colour") - local R2, G2, B2 = 8 / 255, 8 / 255, 8 / 255 + local R2, G2, B2 = 8/255, 8/255, 8/255 BackgroundColourPicker:SetColor(R2, G2, B2) BackgroundColourPicker:SetRelativeWidth(0.5) - BackgroundColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b, a) - for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.BackgroundColour = { r, g, b } end - UUF:UpdateAllUnitFrames() - end) + BackgroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.BackgroundColour = {r, g, b} end UUF:UpdateAllUnitFrames() end) Container:AddChild(BackgroundColourPicker) local BackgroundOpacitySlider = AG:Create("Slider") @@ -474,11 +332,7 @@ local function CreateTextureSettings(containerParent) BackgroundOpacitySlider:SetSliderValues(0.0, 1.0, 0.01) BackgroundOpacitySlider:SetRelativeWidth(0.5) BackgroundOpacitySlider:SetIsPercent(true) - BackgroundOpacitySlider:SetCallback("OnValueChanged", - function(_, _, value) - for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.BackgroundOpacity = value end - UUF:UpdateAllUnitFrames() - end) + BackgroundOpacitySlider:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.HealthBar.BackgroundOpacity = value end UUF:UpdateAllUnitFrames() end) Container:AddChild(BackgroundOpacitySlider) end @@ -490,12 +344,7 @@ local function CreateRangeSettings(containerParent) Toggle:SetLabel("Enable Range Fading") Toggle:SetValue(RangeDB.Enabled) Toggle:SetFullWidth(true) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - RangeDB.Enabled = value - UUF:UpdateAllUnitFrames() - GUIWidgets.DeepDisable(Container, not value, Toggle) - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) RangeDB.Enabled = value UUF:UpdateAllUnitFrames() GUIWidgets.DeepDisable(Container, not value, Toggle) end) Toggle:SetRelativeWidth(0.33) Container:AddChild(Toggle) @@ -504,11 +353,7 @@ local function CreateRangeSettings(containerParent) InAlphaSlider:SetValue(RangeDB.InRange) InAlphaSlider:SetSliderValues(0.0, 1.0, 0.01) InAlphaSlider:SetFullWidth(true) - InAlphaSlider:SetCallback("OnValueChanged", - function(_, _, value) - RangeDB.InRange = value - UUF:UpdateAllUnitFrames() - end) + InAlphaSlider:SetCallback("OnValueChanged", function(_, _, value) RangeDB.InRange = value UUF:UpdateAllUnitFrames() end) InAlphaSlider:SetRelativeWidth(0.33) InAlphaSlider:SetIsPercent(true) Container:AddChild(InAlphaSlider) @@ -518,11 +363,7 @@ local function CreateRangeSettings(containerParent) OutAlphaSlider:SetValue(RangeDB.OutOfRange) OutAlphaSlider:SetSliderValues(0.0, 1.0, 0.01) OutAlphaSlider:SetFullWidth(true) - OutAlphaSlider:SetCallback("OnValueChanged", - function(_, _, value) - RangeDB.OutOfRange = value - UUF:UpdateAllUnitFrames() - end) + OutAlphaSlider:SetCallback("OnValueChanged", function(_, _, value) RangeDB.OutOfRange = value UUF:UpdateAllUnitFrames() end) OutAlphaSlider:SetRelativeWidth(0.33) OutAlphaSlider:SetIsPercent(true) Container:AddChild(OutAlphaSlider) @@ -534,19 +375,13 @@ local function CreateGlobalOutOfCombatFadeSettings(containerParent) local FadeDB = UUF.db.profile.General.OutOfCombatFade local Container = GUIWidgets.CreateInlineGroup(containerParent, "Out of Combat Fade") - GUIWidgets.CreateInformationTag(Container, - "Fade unit frames when out of combat. Per-frame settings can override this global setting.") + GUIWidgets.CreateInformationTag(Container, "Fade unit frames when out of combat. Per-frame settings can override this global setting.") local UseGlobalToggle = AG:Create("CheckBox") UseGlobalToggle:SetLabel("Use Global Out of Combat Fade") UseGlobalToggle:SetValue(FadeDB.UseGlobal) UseGlobalToggle:SetFullWidth(true) - UseGlobalToggle:SetCallback("OnValueChanged", - function(_, _, value) - FadeDB.UseGlobal = value - UUF:UpdateOutOfCombatFade() - GUIWidgets.DeepDisable(Container, not value, UseGlobalToggle) - end) + UseGlobalToggle:SetCallback("OnValueChanged", function(_, _, value) FadeDB.UseGlobal = value UUF:UpdateOutOfCombatFade() GUIWidgets.DeepDisable(Container, not value, UseGlobalToggle) end) UseGlobalToggle:SetRelativeWidth(0.5) Container:AddChild(UseGlobalToggle) @@ -555,11 +390,7 @@ local function CreateGlobalOutOfCombatFadeSettings(containerParent) GlobalOpacitySlider:SetValue(FadeDB.GlobalOpacity) GlobalOpacitySlider:SetSliderValues(0.0, 1.0, 0.01) GlobalOpacitySlider:SetFullWidth(true) - GlobalOpacitySlider:SetCallback("OnValueChanged", - function(_, _, value) - FadeDB.GlobalOpacity = value - UUF:UpdateOutOfCombatFade() - end) + GlobalOpacitySlider:SetCallback("OnValueChanged", function(_, _, value) FadeDB.GlobalOpacity = value UUF:UpdateOutOfCombatFade() end) GlobalOpacitySlider:SetRelativeWidth(0.5) GlobalOpacitySlider:SetIsPercent(true) Container:AddChild(GlobalOpacitySlider) @@ -568,16 +399,11 @@ local function CreateGlobalOutOfCombatFadeSettings(containerParent) FadeInWithTargetToggle:SetLabel("Fade In When Target Is Set") FadeInWithTargetToggle:SetValue(FadeDB.FadeInWithTarget) FadeInWithTargetToggle:SetFullWidth(true) - FadeInWithTargetToggle:SetCallback("OnValueChanged", - function(_, _, value) - FadeDB.FadeInWithTarget = value - UUF:UpdateOutOfCombatFade() - end) + FadeInWithTargetToggle:SetCallback("OnValueChanged", function(_, _, value) FadeDB.FadeInWithTarget = value UUF:UpdateOutOfCombatFade() end) FadeInWithTargetToggle:SetRelativeWidth(0.5) Container:AddChild(FadeInWithTargetToggle) - GUIWidgets.CreateInformationTag(Container, - "When enabled, frames will fade to full opacity if you have a target, even while out of combat.") + GUIWidgets.CreateInformationTag(Container, "When enabled, frames will fade to full opacity if you have a target, even while out of combat.") GUIWidgets.DeepDisable(Container, not FadeDB.UseGlobal, UseGlobalToggle) end @@ -585,51 +411,29 @@ end local function CreateColourSettings(containerParent) local Container = GUIWidgets.CreateInlineGroup(containerParent, "Colours") - GUIWidgets.CreateInformationTag(Container, - "Buttons below will reset the colours to their default values as defined by " .. UUF.PRETTY_ADDON_NAME .. ".") + GUIWidgets.CreateInformationTag(Container,"Buttons below will reset the colours to their default values as defined by " .. UUF.PRETTY_ADDON_NAME .. ".") local ResetAllColoursButton = AG:Create("Button") ResetAllColoursButton:SetText("All Colours") - ResetAllColoursButton:SetCallback("OnClick", - function() - UUF:CopyTabe(UUF:GetDefaultDB().profile.General.Colours, UUF.db.profile.General.Colours) - Container:ReleaseChildren() - CreateColourSettings(containerParent) - Container:DoLayout() - containerParent:DoLayout() - end) + ResetAllColoursButton:SetCallback("OnClick", function() UUF:CopyTabe(UUF:GetDefaultDB().profile.General.Colours, UUF.db.profile.General.Colours) Container:ReleaseChildren() CreateColourSettings(containerParent) Container:DoLayout() containerParent:DoLayout() end) ResetAllColoursButton:SetRelativeWidth(0.33) Container:AddChild(ResetAllColoursButton) local ResetPowerColoursButton = AG:Create("Button") ResetPowerColoursButton:SetText("Power Colours") - ResetPowerColoursButton:SetCallback("OnClick", - function() - UUF:CopyTabe(UUF:GetDefaultDB().profile.General.Colours.Power, UUF.db.profile.General.Colours.Power) - Container:ReleaseChildren() - CreateColourSettings(containerParent) - Container:DoLayout() - containerParent:DoLayout() - end) + ResetPowerColoursButton:SetCallback("OnClick", function() UUF:CopyTabe(UUF:GetDefaultDB().profile.General.Colours.Power, UUF.db.profile.General.Colours.Power) Container:ReleaseChildren() CreateColourSettings(containerParent) Container:DoLayout() containerParent:DoLayout() end) ResetPowerColoursButton:SetRelativeWidth(0.33) Container:AddChild(ResetPowerColoursButton) local ResetReactionColoursButton = AG:Create("Button") ResetReactionColoursButton:SetText("Reaction Colours") - ResetReactionColoursButton:SetCallback("OnClick", - function() - UUF:CopyTabe(UUF:GetDefaultDB().profile.General.Colours.Reaction, UUF.db.profile.General.Colours.Reaction) - Container:ReleaseChildren() - CreateColourSettings(containerParent) - Container:DoLayout() - containerParent:DoLayout() - end) + ResetReactionColoursButton:SetCallback("OnClick", function() UUF:CopyTabe(UUF:GetDefaultDB().profile.General.Colours.Reaction, UUF.db.profile.General.Colours.Reaction) Container:ReleaseChildren() CreateColourSettings(containerParent) Container:DoLayout() containerParent:DoLayout() end) ResetReactionColoursButton:SetRelativeWidth(0.33) Container:AddChild(ResetReactionColoursButton) GUIWidgets.CreateHeader(Container, "Power") - local PowerOrder = { 0, 1, 2, 3, 6, 8, 11, 13, 17, 18 } + local PowerOrder = {0, 1, 2, 3, 6, 8, 11, 13, 17, 18} for _, powerType in ipairs(PowerOrder) do local powerColour = UUF.db.profile.General.Colours.Power[powerType] @@ -637,12 +441,7 @@ local function CreateColourSettings(containerParent) PowerColourPicker:SetLabel(Power[powerType]) local R, G, B = unpack(powerColour) PowerColourPicker:SetColor(R, G, B) - PowerColourPicker:SetCallback("OnValueChanged", - function(widget, _, r, g, b) - UUF.db.profile.General.Colours.Power[powerType] = { r, g, b } - UUF:LoadCustomColours() - UUF:UpdateAllUnitFrames() - end) + PowerColourPicker:SetCallback("OnValueChanged", function(widget, _, r, g, b) UUF.db.profile.General.Colours.Power[powerType] = {r, g, b} UUF:LoadCustomColours() UUF:UpdateAllUnitFrames() end) PowerColourPicker:SetHasAlpha(false) PowerColourPicker:SetRelativeWidth(0.19) Container:AddChild(PowerColourPicker) @@ -650,19 +449,14 @@ local function CreateColourSettings(containerParent) GUIWidgets.CreateHeader(Container, "Reaction") - local ReactionOrder = { 1, 2, 3, 4, 5, 6, 7, 8 } + local ReactionOrder = {1, 2, 3, 4, 5, 6, 7, 8} for _, reactionType in ipairs(ReactionOrder) do local ReactionColourPicker = AG:Create("ColorPicker") ReactionColourPicker:SetLabel(Reaction[reactionType]) local R, G, B = unpack(UUF.db.profile.General.Colours.Reaction[reactionType]) ReactionColourPicker:SetColor(R, G, B) - ReactionColourPicker:SetCallback("OnValueChanged", - function(widget, _, r, g, b) - UUF.db.profile.General.Colours.Reaction[reactionType] = { r, g, b } - UUF:LoadCustomColours() - UUF:UpdateAllUnitFrames() - end) + ReactionColourPicker:SetCallback("OnValueChanged", function(widget, _, r, g, b) UUF.db.profile.General.Colours.Reaction[reactionType] = {r, g, b} UUF:LoadCustomColours() UUF:UpdateAllUnitFrames() end) ReactionColourPicker:SetHasAlpha(false) ReactionColourPicker:SetRelativeWidth(0.25) Container:AddChild(ReactionColourPicker) @@ -680,10 +474,7 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC WidthSlider:SetValue(FrameDB.Width) WidthSlider:SetSliderValues(1, 1000, 0.1) WidthSlider:SetRelativeWidth(0.5) - WidthSlider:SetCallback("OnValueChanged", function(_, _, value) - FrameDB.Width = value - updateCallback() - end) + WidthSlider:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Width = value updateCallback() end) LayoutContainer:AddChild(WidthSlider) local HeightSlider = AG:Create("Slider") @@ -691,10 +482,7 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC HeightSlider:SetValue(FrameDB.Height) HeightSlider:SetSliderValues(1, 1000, 0.1) HeightSlider:SetRelativeWidth(0.5) - HeightSlider:SetCallback("OnValueChanged", function(_, _, value) - FrameDB.Height = value - updateCallback() - end) + HeightSlider:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Height = value updateCallback() end) LayoutContainer:AddChild(HeightSlider) local AnchorFromDropdown = AG:Create("Dropdown") @@ -702,10 +490,7 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(FrameDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth((unitHasParent or unit == "boss") and 0.33 or 0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) - FrameDB.Layout[1] = value - updateCallback() - end) + AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Layout[1] = value updateCallback() end) LayoutContainer:AddChild(AnchorFromDropdown) if unitHasParent then @@ -714,12 +499,7 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC AnchorParentEditBox:SetText(FrameDB.AnchorParent or "") AnchorParentEditBox:SetRelativeWidth(0.33) AnchorParentEditBox:DisableButton(true) - AnchorParentEditBox:SetCallback("OnEnterPressed", - function(_, _, value) - FrameDB.AnchorParent = value ~= "" and value or nil - AnchorParentEditBox:SetText(FrameDB.AnchorParent or "") - updateCallback() - end) + AnchorParentEditBox:SetCallback("OnEnterPressed", function(_, _, value) FrameDB.AnchorParent = value ~= "" and value or nil AnchorParentEditBox:SetText(FrameDB.AnchorParent or "") updateCallback() end) LayoutContainer:AddChild(AnchorParentEditBox) end @@ -728,23 +508,16 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(FrameDB.Layout[2]) AnchorToDropdown:SetRelativeWidth((unitHasParent or unit == "boss") and 0.33 or 0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) - FrameDB.Layout[2] = value - updateCallback() - end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Layout[2] = value updateCallback() end) LayoutContainer:AddChild(AnchorToDropdown) if unit == "boss" then local GrowthDirectionDropdown = AG:Create("Dropdown") - GrowthDirectionDropdown:SetList({ ["UP"] = "Up", ["DOWN"] = "Down" }) + GrowthDirectionDropdown:SetList({["UP"] = "Up", ["DOWN"] = "Down"}) GrowthDirectionDropdown:SetLabel("Growth Direction") GrowthDirectionDropdown:SetValue(FrameDB.GrowthDirection) GrowthDirectionDropdown:SetRelativeWidth(0.33) - GrowthDirectionDropdown:SetCallback("OnValueChanged", - function(_, _, value) - FrameDB.GrowthDirection = value - updateCallback() - end) + GrowthDirectionDropdown:SetCallback("OnValueChanged", function(_, _, value) FrameDB.GrowthDirection = value updateCallback() end) LayoutContainer:AddChild(GrowthDirectionDropdown) end @@ -753,10 +526,7 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC XPosSlider:SetValue(FrameDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(unit == "boss" and 0.25 or 0.33) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) - FrameDB.Layout[3] = value - updateCallback() - end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Layout[3] = value updateCallback() end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -764,10 +534,7 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC YPosSlider:SetValue(FrameDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(unit == "boss" and 0.25 or 0.33) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) - FrameDB.Layout[4] = value - updateCallback() - end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Layout[4] = value updateCallback() end) LayoutContainer:AddChild(YPosSlider) if unit == "boss" then @@ -776,10 +543,7 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC SpacingSlider:SetValue(FrameDB.Layout[5]) SpacingSlider:SetSliderValues(-1, 100, 0.1) SpacingSlider:SetRelativeWidth(0.33) - SpacingSlider:SetCallback("OnValueChanged", function(_, _, value) - FrameDB.Layout[5] = value - updateCallback() - end) + SpacingSlider:SetCallback("OnValueChanged", function(_, _, value) FrameDB.Layout[5] = value updateCallback() end) LayoutContainer:AddChild(SpacingSlider) end @@ -788,11 +552,7 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC FrameStrataDropdown:SetLabel("Frame Strata") FrameStrataDropdown:SetValue(FrameDB.FrameStrata) FrameStrataDropdown:SetRelativeWidth(unit == "boss" and 0.25 or 0.33) - FrameStrataDropdown:SetCallback("OnValueChanged", - function(_, _, value) - FrameDB.FrameStrata = value - updateCallback() - end) + FrameStrataDropdown:SetCallback("OnValueChanged", function(_, _, value) FrameDB.FrameStrata = value updateCallback() end) LayoutContainer:AddChild(FrameStrataDropdown) local ColourContainer = GUIWidgets.CreateInlineGroup(containerParent, "Colours & Toggles") @@ -800,22 +560,14 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC local ColourWhenTappedToggle = AG:Create("CheckBox") ColourWhenTappedToggle:SetLabel("Colour When Tapped") ColourWhenTappedToggle:SetValue(HealthBarDB.ColourWhenTapped) - ColourWhenTappedToggle:SetCallback("OnValueChanged", - function(_, _, value) - HealthBarDB.ColourWhenTapped = value - updateCallback() - end) + ColourWhenTappedToggle:SetCallback("OnValueChanged", function(_, _, value) HealthBarDB.ColourWhenTapped = value updateCallback() end) ColourWhenTappedToggle:SetRelativeWidth((unit == "player" or unit == "target") and 0.33 or 0.5) ColourContainer:AddChild(ColourWhenTappedToggle) local InverseGrowthDirectionToggle = AG:Create("CheckBox") InverseGrowthDirectionToggle:SetLabel("Inverse Growth Direction") InverseGrowthDirectionToggle:SetValue(HealthBarDB.Inverse) - InverseGrowthDirectionToggle:SetCallback("OnValueChanged", - function(_, _, value) - HealthBarDB.Inverse = value - updateCallback() - end) + InverseGrowthDirectionToggle:SetCallback("OnValueChanged", function(_, _, value) HealthBarDB.Inverse = value updateCallback() end) InverseGrowthDirectionToggle:SetRelativeWidth((unit == "player" or unit == "target") and 0.33 or 0.5) ColourContainer:AddChild(InverseGrowthDirectionToggle) @@ -824,48 +576,41 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC AnchorToCooldownViewerToggle:SetLabel("Anchor To Cooldown Viewer") AnchorToCooldownViewerToggle:SetValue(HealthBarDB.AnchorToCooldownViewer) AnchorToCooldownViewerToggle:SetCallback("OnValueChanged", - function(_, _, value) - HealthBarDB.AnchorToCooldownViewer = value - if not value then - FrameDB.Layout[1] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[1] - FrameDB.Layout[2] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[2] - FrameDB.Layout[3] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[3] - FrameDB.Layout[4] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[4] + function(_, _, value) + HealthBarDB.AnchorToCooldownViewer = value + if not value then + FrameDB.Layout[1] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[1] + FrameDB.Layout[2] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[2] + FrameDB.Layout[3] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[3] + FrameDB.Layout[4] = UUF:GetDefaultDB().profile.Units[unit].Frame.Layout[4] + AnchorFromDropdown:SetValue(FrameDB.Layout[1]) + AnchorToDropdown:SetValue(FrameDB.Layout[2]) + XPosSlider:SetValue(FrameDB.Layout[3]) + YPosSlider:SetValue(FrameDB.Layout[4]) + else + if unit == "player" then + FrameDB.Layout[1] = "RIGHT" + FrameDB.Layout[2] = "LEFT" + FrameDB.Layout[3] = 0 + FrameDB.Layout[4] = 0 + AnchorFromDropdown:SetValue(FrameDB.Layout[1]) + AnchorToDropdown:SetValue(FrameDB.Layout[2]) + XPosSlider:SetValue(FrameDB.Layout[3]) + YPosSlider:SetValue(FrameDB.Layout[4]) + elseif unit == "target" then + FrameDB.Layout[1] = "LEFT" + FrameDB.Layout[2] = "RIGHT" + FrameDB.Layout[3] = 0 + FrameDB.Layout[4] = 0 AnchorFromDropdown:SetValue(FrameDB.Layout[1]) AnchorToDropdown:SetValue(FrameDB.Layout[2]) XPosSlider:SetValue(FrameDB.Layout[3]) YPosSlider:SetValue(FrameDB.Layout[4]) - else - if unit == "player" then - FrameDB.Layout[1] = "RIGHT" - FrameDB.Layout[2] = "LEFT" - FrameDB.Layout[3] = 0 - FrameDB.Layout[4] = 0 - AnchorFromDropdown:SetValue(FrameDB.Layout[1]) - AnchorToDropdown:SetValue(FrameDB.Layout[2]) - XPosSlider:SetValue(FrameDB.Layout[3]) - YPosSlider:SetValue(FrameDB.Layout[4]) - elseif unit == "target" then - FrameDB.Layout[1] = "LEFT" - FrameDB.Layout[2] = "RIGHT" - FrameDB.Layout[3] = 0 - FrameDB.Layout[4] = 0 - AnchorFromDropdown:SetValue(FrameDB.Layout[1]) - AnchorToDropdown:SetValue(FrameDB.Layout[2]) - XPosSlider:SetValue(FrameDB.Layout[3]) - YPosSlider:SetValue(FrameDB.Layout[4]) - end end - updateCallback() - end) - AnchorToCooldownViewerToggle:SetCallback("OnEnter", - function() - GameTooltip:SetOwner(AnchorToCooldownViewerToggle.frame, "ANCHOR_CURSOR") - GameTooltip:AddLine( - "Anchor To |cFF8080FFEssential|r Cooldown Viewer. Toggling this will overwrite existing |cFF8080FFLayout|r Settings.", - 1, 1, 1, false) - GameTooltip:Show() - end) + end + updateCallback() + end) + AnchorToCooldownViewerToggle:SetCallback("OnEnter", function() GameTooltip:SetOwner(AnchorToCooldownViewerToggle.frame, "ANCHOR_CURSOR") GameTooltip:AddLine("Anchor To |cFF8080FFEssential|r Cooldown Viewer. Toggling this will overwrite existing |cFF8080FFLayout|r Settings.", 1, 1, 1, false) GameTooltip:Show() end) AnchorToCooldownViewerToggle:SetCallback("OnLeave", function() GameTooltip:Hide() end) AnchorToCooldownViewerToggle:SetRelativeWidth(0.33) ColourContainer:AddChild(AnchorToCooldownViewerToggle) @@ -877,11 +622,7 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC ForegroundColourPicker:SetLabel("Foreground Colour") local R, G, B = unpack(HealthBarDB.Foreground) ForegroundColourPicker:SetColor(R, G, B) - ForegroundColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b) - HealthBarDB.Foreground = { r, g, b } - updateCallback() - end) + ForegroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) HealthBarDB.Foreground = {r, g, b} updateCallback() end) ForegroundColourPicker:SetHasAlpha(false) ForegroundColourPicker:SetRelativeWidth(0.25) ForegroundColourPicker:SetDisabled(HealthBarDB.ColourByClass) @@ -891,12 +632,7 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC local ForegroundColourByClassToggle = AG:Create("CheckBox") ForegroundColourByClassToggle:SetLabel("Colour by Class / Reaction") ForegroundColourByClassToggle:SetValue(HealthBarDB.ColourByClass) - ForegroundColourByClassToggle:SetCallback("OnValueChanged", - function(_, _, value) - HealthBarDB.ColourByClass = value - UUFGUI.FrameFGColourPicker:SetDisabled(HealthBarDB.ColourByClass) - updateCallback() - end) + ForegroundColourByClassToggle:SetCallback("OnValueChanged", function(_, _, value) HealthBarDB.ColourByClass = value UUFGUI.FrameFGColourPicker:SetDisabled(HealthBarDB.ColourByClass) updateCallback() end) ForegroundColourByClassToggle:SetRelativeWidth(0.25) ColourContainer:AddChild(ForegroundColourByClassToggle) @@ -905,11 +641,7 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC ForegroundOpacitySlider:SetValue(HealthBarDB.ForegroundOpacity) ForegroundOpacitySlider:SetSliderValues(0, 1, 0.01) ForegroundOpacitySlider:SetRelativeWidth(0.5) - ForegroundOpacitySlider:SetCallback("OnValueChanged", - function(_, _, value) - HealthBarDB.ForegroundOpacity = value - updateCallback() - end) + ForegroundOpacitySlider:SetCallback("OnValueChanged", function(_, _, value) HealthBarDB.ForegroundOpacity = value updateCallback() end) ForegroundOpacitySlider:SetIsPercent(true) ColourContainer:AddChild(ForegroundOpacitySlider) @@ -917,11 +649,7 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC BackgroundColourPicker:SetLabel("Background Colour") local R2, G2, B2 = unpack(HealthBarDB.Background) BackgroundColourPicker:SetColor(R2, G2, B2) - BackgroundColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b) - HealthBarDB.Background = { r, g, b } - updateCallback() - end) + BackgroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) HealthBarDB.Background = {r, g, b} updateCallback() end) BackgroundColourPicker:SetHasAlpha(false) BackgroundColourPicker:SetRelativeWidth(0.25) BackgroundColourPicker:SetDisabled(HealthBarDB.ColourBackgroundByClass) @@ -931,12 +659,7 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC local BackgroundColourByClassToggle = AG:Create("CheckBox") BackgroundColourByClassToggle:SetLabel("Colour by Class / Reaction") BackgroundColourByClassToggle:SetValue(HealthBarDB.ColourBackgroundByClass) - BackgroundColourByClassToggle:SetCallback("OnValueChanged", - function(_, _, value) - HealthBarDB.ColourBackgroundByClass = value - UUFGUI.FrameBGColourPicker:SetDisabled(HealthBarDB.ColourBackgroundByClass) - updateCallback() - end) + BackgroundColourByClassToggle:SetCallback("OnValueChanged", function(_, _, value) HealthBarDB.ColourBackgroundByClass = value UUFGUI.FrameBGColourPicker:SetDisabled(HealthBarDB.ColourBackgroundByClass) updateCallback() end) BackgroundColourByClassToggle:SetRelativeWidth(0.25) ColourContainer:AddChild(BackgroundColourByClassToggle) @@ -945,60 +668,9 @@ local function CreateFrameSettings(containerParent, unit, unitHasParent, updateC BackgroundOpacitySlider:SetValue(HealthBarDB.BackgroundOpacity) BackgroundOpacitySlider:SetSliderValues(0, 1, 0.01) BackgroundOpacitySlider:SetRelativeWidth(0.5) - BackgroundOpacitySlider:SetCallback("OnValueChanged", - function(_, _, value) - HealthBarDB.BackgroundOpacity = value - updateCallback() - end) + BackgroundOpacitySlider:SetCallback("OnValueChanged", function(_, _, value) HealthBarDB.BackgroundOpacity = value updateCallback() end) BackgroundOpacitySlider:SetIsPercent(true) ColourContainer:AddChild(BackgroundOpacitySlider) - - -- Out of Combat Fade Settings - local OutOfCombatFadeContainer = GUIWidgets.CreateInlineGroup(containerParent, "Out of Combat Fade") - - local OutOfCombatFadeEnabled = AG:Create("CheckBox") - OutOfCombatFadeEnabled:SetLabel("Enable Out of Combat Fade (Per-Frame)") - OutOfCombatFadeEnabled:SetValue(FrameDB.OutOfCombatFade.Enabled) - OutOfCombatFadeEnabled:SetCallback("OnValueChanged", - function(_, _, value) - FrameDB.OutOfCombatFade.Enabled = value - updateCallback() - UUF:UpdateOutOfCombatFade() - end) - OutOfCombatFadeEnabled:SetRelativeWidth(0.5) - OutOfCombatFadeContainer:AddChild(OutOfCombatFadeEnabled) - - GUIWidgets.CreateInformationTag(OutOfCombatFadeContainer, - "Enable this to override the Global Out of Combat Fade setting for this specific frame.") - - local OutOfCombatFadeOpacitySlider = AG:Create("Slider") - OutOfCombatFadeOpacitySlider:SetLabel("Out of Combat Opacity") - OutOfCombatFadeOpacitySlider:SetValue(FrameDB.OutOfCombatFade.Opacity) - OutOfCombatFadeOpacitySlider:SetSliderValues(0.0, 1.0, 0.01) - OutOfCombatFadeOpacitySlider:SetRelativeWidth(0.5) - OutOfCombatFadeOpacitySlider:SetCallback("OnValueChanged", - function(_, _, value) - FrameDB.OutOfCombatFade.Opacity = value - updateCallback() - UUF:UpdateOutOfCombatFade() - end) - OutOfCombatFadeOpacitySlider:SetIsPercent(true) - OutOfCombatFadeContainer:AddChild(OutOfCombatFadeOpacitySlider) - - local OutOfCombatFadeFadeInWithTargetToggle = AG:Create("CheckBox") - OutOfCombatFadeFadeInWithTargetToggle:SetLabel("Fade In When Target Is Set") - OutOfCombatFadeFadeInWithTargetToggle:SetValue(FrameDB.OutOfCombatFade.FadeInWithTarget) - OutOfCombatFadeFadeInWithTargetToggle:SetCallback("OnValueChanged", - function(_, _, value) - FrameDB.OutOfCombatFade.FadeInWithTarget = value - updateCallback() - UUF:UpdateOutOfCombatFade() - end) - OutOfCombatFadeFadeInWithTargetToggle:SetRelativeWidth(0.5) - OutOfCombatFadeContainer:AddChild(OutOfCombatFadeFadeInWithTargetToggle) - - GUIWidgets.CreateInformationTag(OutOfCombatFadeContainer, - "When enabled, this frame will fade to full opacity if you have a target, even while out of combat.") end local function CreateHealPredictionSettings(containerParent, unit, updateCallback) @@ -1009,23 +681,14 @@ local function CreateHealPredictionSettings(containerParent, unit, updateCallbac local ShowAbsorbToggle = AG:Create("CheckBox") ShowAbsorbToggle:SetLabel("Show Absorbs") ShowAbsorbToggle:SetValue(HealPredictionDB.Absorbs.Enabled) - ShowAbsorbToggle:SetCallback("OnValueChanged", - function(_, _, value) - HealPredictionDB.Absorbs.Enabled = value - updateCallback() - RefreshHealPredictionSettings() - end) + ShowAbsorbToggle:SetCallback("OnValueChanged", function(_, _, value) HealPredictionDB.Absorbs.Enabled = value updateCallback() RefreshHealPredictionSettings() end) ShowAbsorbToggle:SetRelativeWidth(0.5) AbsorbSettings:AddChild(ShowAbsorbToggle) local UseStripedTextureAbsorbToggle = AG:Create("CheckBox") UseStripedTextureAbsorbToggle:SetLabel("Use Striped Texture") UseStripedTextureAbsorbToggle:SetValue(HealPredictionDB.Absorbs.UseStripedTexture) - UseStripedTextureAbsorbToggle:SetCallback("OnValueChanged", - function(_, _, value) - HealPredictionDB.Absorbs.UseStripedTexture = value - updateCallback() - end) + UseStripedTextureAbsorbToggle:SetCallback("OnValueChanged", function(_, _, value) HealPredictionDB.Absorbs.UseStripedTexture = value updateCallback() end) UseStripedTextureAbsorbToggle:SetRelativeWidth(0.5) AbsorbSettings:AddChild(UseStripedTextureAbsorbToggle) @@ -1033,48 +696,31 @@ local function CreateHealPredictionSettings(containerParent, unit, updateCallbac AbsorbColourPicker:SetLabel("Absorb Colour") local R, G, B, A = unpack(HealPredictionDB.Absorbs.Colour) AbsorbColourPicker:SetColor(R, G, B, A) - AbsorbColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b, a) - HealPredictionDB.Absorbs.Colour = { r, g, b, a } - updateCallback() - end) + AbsorbColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) HealPredictionDB.Absorbs.Colour = {r, g, b, a} updateCallback() end) AbsorbColourPicker:SetHasAlpha(true) AbsorbColourPicker:SetRelativeWidth(0.5) AbsorbSettings:AddChild(AbsorbColourPicker) local AbsorbPositionDropdown = AG:Create("Dropdown") - AbsorbPositionDropdown:SetList({ ["LEFT"] = "Left", ["RIGHT"] = "Right" }) + AbsorbPositionDropdown:SetList({["LEFT"] = "Left", ["RIGHT"] = "Right"}) AbsorbPositionDropdown:SetLabel("Position") AbsorbPositionDropdown:SetValue(HealPredictionDB.Absorbs.Position) AbsorbPositionDropdown:SetRelativeWidth(0.5) - AbsorbPositionDropdown:SetCallback("OnValueChanged", - function(_, _, value) - HealPredictionDB.Absorbs.Position = value - updateCallback() - end) + AbsorbPositionDropdown:SetCallback("OnValueChanged", function(_, _, value) HealPredictionDB.Absorbs.Position = value updateCallback() end) AbsorbSettings:AddChild(AbsorbPositionDropdown) local HealAbsorbSettings = GUIWidgets.CreateInlineGroup(containerParent, "Heal Absorb Settings") local ShowHealAbsorbToggle = AG:Create("CheckBox") ShowHealAbsorbToggle:SetLabel("Show Heal Absorbs") ShowHealAbsorbToggle:SetValue(HealPredictionDB.HealAbsorbs.Enabled) - ShowHealAbsorbToggle:SetCallback("OnValueChanged", - function(_, _, value) - HealPredictionDB.HealAbsorbs.Enabled = value - updateCallback() - RefreshHealPredictionSettings() - end) + ShowHealAbsorbToggle:SetCallback("OnValueChanged", function(_, _, value) HealPredictionDB.HealAbsorbs.Enabled = value updateCallback() RefreshHealPredictionSettings() end) ShowHealAbsorbToggle:SetRelativeWidth(0.5) HealAbsorbSettings:AddChild(ShowHealAbsorbToggle) local UseStripedTextureHealAbsorbToggle = AG:Create("CheckBox") UseStripedTextureHealAbsorbToggle:SetLabel("Use Striped Texture") UseStripedTextureHealAbsorbToggle:SetValue(HealPredictionDB.HealAbsorbs.UseStripedTexture) - UseStripedTextureHealAbsorbToggle:SetCallback("OnValueChanged", - function(_, _, value) - HealPredictionDB.HealAbsorbs.UseStripedTexture = value - updateCallback() - end) + UseStripedTextureHealAbsorbToggle:SetCallback("OnValueChanged", function(_, _, value) HealPredictionDB.HealAbsorbs.UseStripedTexture = value updateCallback() end) UseStripedTextureHealAbsorbToggle:SetRelativeWidth(0.5) HealAbsorbSettings:AddChild(UseStripedTextureHealAbsorbToggle) @@ -1082,25 +728,17 @@ local function CreateHealPredictionSettings(containerParent, unit, updateCallbac HealAbsorbColourPicker:SetLabel("Heal Absorb Colour") local R2, G2, B2, A2 = unpack(HealPredictionDB.HealAbsorbs.Colour) HealAbsorbColourPicker:SetColor(R2, G2, B2, A2) - HealAbsorbColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b, a) - HealPredictionDB.HealAbsorbs.Colour = { r, g, b, a } - updateCallback() - end) + HealAbsorbColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) HealPredictionDB.HealAbsorbs.Colour = {r, g, b, a} updateCallback() end) HealAbsorbColourPicker:SetHasAlpha(true) HealAbsorbColourPicker:SetRelativeWidth(0.5) HealAbsorbSettings:AddChild(HealAbsorbColourPicker) local HealAbsorbPositionDropdown = AG:Create("Dropdown") - HealAbsorbPositionDropdown:SetList({ ["LEFT"] = "Left", ["RIGHT"] = "Right" }) + HealAbsorbPositionDropdown:SetList({["LEFT"] = "Left", ["RIGHT"] = "Right"}) HealAbsorbPositionDropdown:SetLabel("Position") HealAbsorbPositionDropdown:SetValue(HealPredictionDB.HealAbsorbs.Position) HealAbsorbPositionDropdown:SetRelativeWidth(0.5) - HealAbsorbPositionDropdown:SetCallback("OnValueChanged", - function(_, _, value) - HealPredictionDB.HealAbsorbs.Position = value - updateCallback() - end) + HealAbsorbPositionDropdown:SetCallback("OnValueChanged", function(_, _, value) HealPredictionDB.HealAbsorbs.Position = value updateCallback() end) HealAbsorbSettings:AddChild(HealAbsorbPositionDropdown) function RefreshHealPredictionSettings() @@ -1120,35 +758,21 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFCast Bar|r") Toggle:SetValue(CastBarDB.Enabled) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - CastBarDB.Enabled = value - updateCallback() - RefreshCastBarBarSettings() - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Enabled = value updateCallback() RefreshCastBarBarSettings() end) Toggle:SetRelativeWidth(0.33) LayoutContainer:AddChild(Toggle) local MatchParentWidthToggle = AG:Create("CheckBox") MatchParentWidthToggle:SetLabel("Match Frame Width") MatchParentWidthToggle:SetValue(CastBarDB.MatchParentWidth) - MatchParentWidthToggle:SetCallback("OnValueChanged", - function(_, _, value) - CastBarDB.MatchParentWidth = value - updateCallback() - RefreshCastBarBarSettings() - end) + MatchParentWidthToggle:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.MatchParentWidth = value updateCallback() RefreshCastBarBarSettings() end) MatchParentWidthToggle:SetRelativeWidth(0.33) LayoutContainer:AddChild(MatchParentWidthToggle) local InverseGrowthDirectionToggle = AG:Create("CheckBox") InverseGrowthDirectionToggle:SetLabel("Inverse Growth Direction") InverseGrowthDirectionToggle:SetValue(CastBarDB.Inverse) - InverseGrowthDirectionToggle:SetCallback("OnValueChanged", - function(_, _, value) - CastBarDB.Inverse = value - updateCallback() - end) + InverseGrowthDirectionToggle:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Inverse = value updateCallback() end) InverseGrowthDirectionToggle:SetRelativeWidth(0.33) LayoutContainer:AddChild(InverseGrowthDirectionToggle) @@ -1157,10 +781,7 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) WidthSlider:SetValue(CastBarDB.Width) WidthSlider:SetSliderValues(1, 1000, 0.1) WidthSlider:SetRelativeWidth(0.5) - WidthSlider:SetCallback("OnValueChanged", function(_, _, value) - CastBarDB.Width = value - updateCallback() - end) + WidthSlider:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Width = value updateCallback() end) LayoutContainer:AddChild(WidthSlider) local HeightSlider = AG:Create("Slider") @@ -1168,10 +789,7 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) HeightSlider:SetValue(CastBarDB.Height) HeightSlider:SetSliderValues(1, 1000, 0.1) HeightSlider:SetRelativeWidth(0.5) - HeightSlider:SetCallback("OnValueChanged", function(_, _, value) - CastBarDB.Height = value - updateCallback() - end) + HeightSlider:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Height = value updateCallback() end) LayoutContainer:AddChild(HeightSlider) local AnchorFromDropdown = AG:Create("Dropdown") @@ -1179,11 +797,7 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(CastBarDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", - function(_, _, value) - CastBarDB.Layout[1] = value - updateCallback() - end) + AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Layout[1] = value updateCallback() end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -1191,10 +805,7 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(CastBarDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) - CastBarDB.Layout[2] = value - updateCallback() - end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Layout[2] = value updateCallback() end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -1202,10 +813,7 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) XPosSlider:SetValue(CastBarDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) - CastBarDB.Layout[3] = value - updateCallback() - end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Layout[3] = value updateCallback() end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -1213,10 +821,7 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) YPosSlider:SetValue(CastBarDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) - CastBarDB.Layout[4] = value - updateCallback() - end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.Layout[4] = value updateCallback() end) LayoutContainer:AddChild(YPosSlider) local FrameStrataDropdown = AG:Create("Dropdown") @@ -1224,11 +829,7 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) FrameStrataDropdown:SetLabel("Frame Strata") FrameStrataDropdown:SetValue(CastBarDB.FrameStrata) FrameStrataDropdown:SetRelativeWidth(0.33) - FrameStrataDropdown:SetCallback("OnValueChanged", - function(_, _, value) - CastBarDB.FrameStrata = value - updateCallback() - end) + FrameStrataDropdown:SetCallback("OnValueChanged", function(_, _, value) CastBarDB.FrameStrata = value updateCallback() end) LayoutContainer:AddChild(FrameStrataDropdown) local ColourContainer = GUIWidgets.CreateInlineGroup(containerParent, "Colours & Toggles") @@ -1237,11 +838,7 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) ForegroundColourPicker:SetLabel("Foreground") local R, G, B, A = unpack(CastBarDB.Foreground) ForegroundColourPicker:SetColor(R, G, B, A) - ForegroundColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b, a) - CastBarDB.Foreground = { r, g, b, a } - updateCallback() - end) + ForegroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) CastBarDB.Foreground = {r, g, b, a} updateCallback() end) ForegroundColourPicker:SetHasAlpha(true) ForegroundColourPicker:SetRelativeWidth(0.33) ColourContainer:AddChild(ForegroundColourPicker) @@ -1250,11 +847,7 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) BackgroundColourPicker:SetLabel("Background") local R2, G2, B2, A2 = unpack(CastBarDB.Background) BackgroundColourPicker:SetColor(R2, G2, B2, A2) - BackgroundColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b, a) - CastBarDB.Background = { r, g, b, a } - updateCallback() - end) + BackgroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) CastBarDB.Background = {r, g, b, a} updateCallback() end) BackgroundColourPicker:SetHasAlpha(true) BackgroundColourPicker:SetRelativeWidth(0.33) ColourContainer:AddChild(BackgroundColourPicker) @@ -1263,11 +856,7 @@ local function CreateCastBarBarSettings(containerParent, unit, updateCallback) NotInterruptibleColourPicker:SetLabel("Not Interruptible") local R3, G3, B3 = unpack(CastBarDB.NotInterruptibleColour) NotInterruptibleColourPicker:SetColor(R3, G3, B3) - NotInterruptibleColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b, a) - CastBarDB.NotInterruptibleColour = { r, g, b, a } - updateCallback() - end) + NotInterruptibleColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) CastBarDB.NotInterruptibleColour = {r, g, b, a} updateCallback() end) NotInterruptibleColourPicker:SetHasAlpha(true) NotInterruptibleColourPicker:SetRelativeWidth(0.33) ColourContainer:AddChild(NotInterruptibleColourPicker) @@ -1308,25 +897,16 @@ local function CreateCastBarIconSettings(containerParent, unit, updateCallback) local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFCast Bar Icon|r") Toggle:SetValue(CastBarIconDB.Enabled) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - CastBarIconDB.Enabled = value - updateCallback() - RefreshCastBarIconSettings() - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) CastBarIconDB.Enabled = value updateCallback() RefreshCastBarIconSettings() end) Toggle:SetRelativeWidth(0.5) LayoutContainer:AddChild(Toggle) local PositionDropdown = AG:Create("Dropdown") - PositionDropdown:SetList({ ["LEFT"] = "Left", ["RIGHT"] = "Right" }) + PositionDropdown:SetList({["LEFT"] = "Left", ["RIGHT"] = "Right"}) PositionDropdown:SetLabel("Position") PositionDropdown:SetValue(CastBarIconDB.Position) PositionDropdown:SetRelativeWidth(0.5) - PositionDropdown:SetCallback("OnValueChanged", - function(_, _, value) - CastBarIconDB.Position = value - updateCallback() - end) + PositionDropdown:SetCallback("OnValueChanged", function(_, _, value) CastBarIconDB.Position = value updateCallback() end) LayoutContainer:AddChild(PositionDropdown) function RefreshCastBarIconSettings() @@ -1349,12 +929,7 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC local SpellNameToggle = AG:Create("CheckBox") SpellNameToggle:SetLabel("Enable |cFF8080FFSpell Name Text|r") SpellNameToggle:SetValue(SpellNameTextDB.Enabled) - SpellNameToggle:SetCallback("OnValueChanged", - function(_, _, value) - SpellNameTextDB.Enabled = value - updateCallback() - RefreshCastBarSpellNameSettings() - end) + SpellNameToggle:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.Enabled = value updateCallback() RefreshCastBarSpellNameSettings() end) SpellNameToggle:SetRelativeWidth(0.5) SpellNameContainer:AddChild(SpellNameToggle) @@ -1362,11 +937,7 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC SpellNameColourPicker:SetLabel("Colour") local R, G, B = unpack(SpellNameTextDB.Colour) SpellNameColourPicker:SetColor(R, G, B) - SpellNameColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b) - SpellNameTextDB.Colour = { r, g, b } - updateCallback() - end) + SpellNameColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) SpellNameTextDB.Colour = {r, g, b} updateCallback() end) SpellNameColourPicker:SetHasAlpha(false) SpellNameColourPicker:SetRelativeWidth(0.5) SpellNameContainer:AddChild(SpellNameColourPicker) @@ -1377,11 +948,7 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC SpellNameAnchorFromDropdown:SetLabel("Anchor From") SpellNameAnchorFromDropdown:SetValue(SpellNameTextDB.Layout[1]) SpellNameAnchorFromDropdown:SetRelativeWidth(0.5) - SpellNameAnchorFromDropdown:SetCallback("OnValueChanged", - function(_, _, value) - SpellNameTextDB.Layout[1] = value - updateCallback() - end) + SpellNameAnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.Layout[1] = value updateCallback() end) SpellNameLayoutContainer:AddChild(SpellNameAnchorFromDropdown) local SpellNameAnchorToDropdown = AG:Create("Dropdown") @@ -1389,11 +956,7 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC SpellNameAnchorToDropdown:SetLabel("Anchor To") SpellNameAnchorToDropdown:SetValue(SpellNameTextDB.Layout[2]) SpellNameAnchorToDropdown:SetRelativeWidth(0.5) - SpellNameAnchorToDropdown:SetCallback("OnValueChanged", - function(_, _, value) - SpellNameTextDB.Layout[2] = value - updateCallback() - end) + SpellNameAnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.Layout[2] = value updateCallback() end) SpellNameLayoutContainer:AddChild(SpellNameAnchorToDropdown) local SpellNameXPosSlider = AG:Create("Slider") @@ -1401,11 +964,7 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC SpellNameXPosSlider:SetValue(SpellNameTextDB.Layout[3]) SpellNameXPosSlider:SetSliderValues(-1000, 1000, 0.1) SpellNameXPosSlider:SetRelativeWidth(0.25) - SpellNameXPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - SpellNameTextDB.Layout[3] = value - updateCallback() - end) + SpellNameXPosSlider:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.Layout[3] = value updateCallback() end) SpellNameLayoutContainer:AddChild(SpellNameXPosSlider) local SpellNameYPosSlider = AG:Create("Slider") @@ -1413,11 +972,7 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC SpellNameYPosSlider:SetValue(SpellNameTextDB.Layout[4]) SpellNameYPosSlider:SetSliderValues(-1000, 1000, 0.1) SpellNameYPosSlider:SetRelativeWidth(0.25) - SpellNameYPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - SpellNameTextDB.Layout[4] = value - updateCallback() - end) + SpellNameYPosSlider:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.Layout[4] = value updateCallback() end) SpellNameLayoutContainer:AddChild(SpellNameYPosSlider) local SpellNameFontSizeSlider = AG:Create("Slider") @@ -1425,11 +980,7 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC SpellNameFontSizeSlider:SetValue(SpellNameTextDB.FontSize) SpellNameFontSizeSlider:SetSliderValues(8, 64, 1) SpellNameFontSizeSlider:SetRelativeWidth(0.25) - SpellNameFontSizeSlider:SetCallback("OnValueChanged", - function(_, _, value) - SpellNameTextDB.FontSize = value - updateCallback() - end) + SpellNameFontSizeSlider:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.FontSize = value updateCallback() end) SpellNameLayoutContainer:AddChild(SpellNameFontSizeSlider) local MaxCharsSlider = AG:Create("Slider") @@ -1437,11 +988,7 @@ local function CreateCastBarSpellNameTextSettings(containerParent, unit, updateC MaxCharsSlider:SetValue(SpellNameTextDB.MaxChars) MaxCharsSlider:SetSliderValues(1, 64, 1) MaxCharsSlider:SetRelativeWidth(0.25) - MaxCharsSlider:SetCallback("OnValueChanged", - function(_, _, value) - SpellNameTextDB.MaxChars = value - updateCallback() - end) + MaxCharsSlider:SetCallback("OnValueChanged", function(_, _, value) SpellNameTextDB.MaxChars = value updateCallback() end) SpellNameLayoutContainer:AddChild(MaxCharsSlider) function RefreshCastBarSpellNameSettings() @@ -1471,17 +1018,12 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa local CastBarTextDB = UUF.db.profile.Units[unit].CastBar.Text local DurationTextDB = CastBarTextDB.Duration - local DurationContainer = GUIWidgets.CreateInlineGroup(containerParent, "Duration Settings") + local DurationContainer = GUIWidgets.CreateInlineGroup(containerParent, "Duration Settings") local DurationToggle = AG:Create("CheckBox") DurationToggle:SetLabel("Enable |cFF8080FFDuration Text|r") DurationToggle:SetValue(DurationTextDB.Enabled) - DurationToggle:SetCallback("OnValueChanged", - function(_, _, value) - DurationTextDB.Enabled = value - updateCallback() - RefreshCastBarDurationSettings() - end) + DurationToggle:SetCallback("OnValueChanged", function(_, _, value) DurationTextDB.Enabled = value updateCallback() RefreshCastBarDurationSettings() end) DurationToggle:SetRelativeWidth(0.5) DurationContainer:AddChild(DurationToggle) @@ -1489,11 +1031,7 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa DurationColourPicker:SetLabel("Colour") local R, G, B = unpack(DurationTextDB.Colour) DurationColourPicker:SetColor(R, G, B) - DurationColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b) - DurationTextDB.Colour = { r, g, b } - updateCallback() - end) + DurationColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) DurationTextDB.Colour = {r, g, b} updateCallback() end) DurationColourPicker:SetHasAlpha(false) DurationColourPicker:SetRelativeWidth(0.5) DurationContainer:AddChild(DurationColourPicker) @@ -1504,11 +1042,7 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa DurationAnchorFromDropdown:SetLabel("Anchor From") DurationAnchorFromDropdown:SetValue(DurationTextDB.Layout[1]) DurationAnchorFromDropdown:SetRelativeWidth(0.5) - DurationAnchorFromDropdown:SetCallback("OnValueChanged", - function(_, _, value) - DurationTextDB.Layout[1] = value - updateCallback() - end) + DurationAnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) DurationTextDB.Layout[1] = value updateCallback() end) DurationLayoutContainer:AddChild(DurationAnchorFromDropdown) local DurationAnchorToDropdown = AG:Create("Dropdown") @@ -1516,11 +1050,7 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa DurationAnchorToDropdown:SetLabel("Anchor To") DurationAnchorToDropdown:SetValue(DurationTextDB.Layout[2]) DurationAnchorToDropdown:SetRelativeWidth(0.5) - DurationAnchorToDropdown:SetCallback("OnValueChanged", - function(_, _, value) - DurationTextDB.Layout[2] = value - updateCallback() - end) + DurationAnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) DurationTextDB.Layout[2] = value updateCallback() end) DurationLayoutContainer:AddChild(DurationAnchorToDropdown) local DurationXPosSlider = AG:Create("Slider") @@ -1528,11 +1058,7 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa DurationXPosSlider:SetValue(DurationTextDB.Layout[3]) DurationXPosSlider:SetSliderValues(-1000, 1000, 0.1) DurationXPosSlider:SetRelativeWidth(0.33) - DurationXPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - DurationTextDB.Layout[3] = value - updateCallback() - end) + DurationXPosSlider:SetCallback("OnValueChanged", function(_, _, value) DurationTextDB.Layout[3] = value updateCallback() end) DurationLayoutContainer:AddChild(DurationXPosSlider) local DurationYPosSlider = AG:Create("Slider") @@ -1540,11 +1066,7 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa DurationYPosSlider:SetValue(DurationTextDB.Layout[4]) DurationYPosSlider:SetSliderValues(-1000, 1000, 0.1) DurationYPosSlider:SetRelativeWidth(0.33) - DurationYPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - DurationTextDB.Layout[4] = value - updateCallback() - end) + DurationYPosSlider:SetCallback("OnValueChanged", function(_, _, value) DurationTextDB.Layout[4] = value updateCallback() end) DurationLayoutContainer:AddChild(DurationYPosSlider) local DurationFontSizeSlider = AG:Create("Slider") @@ -1552,11 +1074,7 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa DurationFontSizeSlider:SetValue(DurationTextDB.FontSize) DurationFontSizeSlider:SetSliderValues(8, 64, 1) DurationFontSizeSlider:SetRelativeWidth(0.33) - DurationFontSizeSlider:SetCallback("OnValueChanged", - function(_, _, value) - DurationTextDB.FontSize = value - updateCallback() - end) + DurationFontSizeSlider:SetCallback("OnValueChanged", function(_, _, value) DurationTextDB.FontSize = value updateCallback() end) DurationLayoutContainer:AddChild(DurationFontSizeSlider) function RefreshCastBarDurationSettings() @@ -1581,49 +1099,18 @@ local function CreateCastBarDurationTextSettings(containerParent, unit, updateCa end local function CreateCastBarSettings(containerParent, unit) + local function SelectCastBarTab(CastBarContainer, _, CastBarTab) SaveSubTab(unit, "CastBar", CastBarTab) CastBarContainer:ReleaseChildren() if CastBarTab == "Bar" then - CreateCastBarBarSettings(CastBarContainer, unit, - function() - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitCastBar(UUF[unit:upper()], - unit) - end - end) + CreateCastBarBarSettings(CastBarContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitCastBar(UUF[unit:upper()], unit) end end) elseif CastBarTab == "Icon" then - CreateCastBarIconSettings(CastBarContainer, unit, - function() - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitCastBar(UUF[unit:upper()], - unit) - end - end) + CreateCastBarIconSettings(CastBarContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitCastBar(UUF[unit:upper()], unit) end end) elseif CastBarTab == "SpellName" then - CreateCastBarSpellNameTextSettings(CastBarContainer, unit, - function() - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitCastBar(UUF[unit:upper()], - unit) - end - end) + CreateCastBarSpellNameTextSettings(CastBarContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitCastBar(UUF[unit:upper()], unit) end end) elseif CastBarTab == "Duration" then - CreateCastBarDurationTextSettings(CastBarContainer, unit, - function() - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitCastBar(UUF[unit:upper()], - unit) - end - end) + CreateCastBarDurationTextSettings(CastBarContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitCastBar(UUF[unit:upper()], unit) end end) end end @@ -1631,10 +1118,10 @@ local function CreateCastBarSettings(containerParent, unit) CastBarTabGroup:SetLayout("Flow") CastBarTabGroup:SetFullWidth(true) CastBarTabGroup:SetTabs({ - { text = "Bar", value = "Bar" }, - { text = "Icon", value = "Icon" }, - { text = "Text: |cFFFFFFFFSpell Name|r", value = "SpellName" }, - { text = "Text: |cFFFFFFFFDuration|r", value = "Duration" }, + {text = "Bar", value = "Bar"}, + {text = "Icon" , value = "Icon"}, + {text = "Text: |cFFFFFFFFSpell Name|r", value = "SpellName"}, + {text = "Text: |cFFFFFFFFDuration|r", value = "Duration"}, }) CastBarTabGroup:SetCallback("OnGroupSelected", SelectCastBarTab) CastBarTabGroup:SelectTab(GetSavedSubTab(unit, "CastBar", "Bar")) @@ -1650,23 +1137,14 @@ local function CreatePowerBarSettings(containerParent, unit, updateCallback) local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFPower Bar|r") Toggle:SetValue(PowerBarDB.Enabled) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - PowerBarDB.Enabled = value - updateCallback() - RefreshPowerBarGUI() - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) PowerBarDB.Enabled = value updateCallback() RefreshPowerBarGUI() end) Toggle:SetRelativeWidth(0.33) LayoutContainer:AddChild(Toggle) local InverseGrowthDirectionToggle = AG:Create("CheckBox") InverseGrowthDirectionToggle:SetLabel("Inverse Growth Direction") InverseGrowthDirectionToggle:SetValue(PowerBarDB.Inverse) - InverseGrowthDirectionToggle:SetCallback("OnValueChanged", - function(_, _, value) - PowerBarDB.Inverse = value - updateCallback() - end) + InverseGrowthDirectionToggle:SetCallback("OnValueChanged", function(_, _, value) PowerBarDB.Inverse = value updateCallback() end) InverseGrowthDirectionToggle:SetRelativeWidth(0.33) LayoutContainer:AddChild(InverseGrowthDirectionToggle) @@ -1675,10 +1153,7 @@ local function CreatePowerBarSettings(containerParent, unit, updateCallback) HeightSlider:SetValue(PowerBarDB.Height) HeightSlider:SetSliderValues(1, FrameDB.Height - 2, 0.1) HeightSlider:SetRelativeWidth(0.33) - HeightSlider:SetCallback("OnValueChanged", function(_, _, value) - PowerBarDB.Height = value - updateCallback() - end) + HeightSlider:SetCallback("OnValueChanged", function(_, _, value) PowerBarDB.Height = value updateCallback() end) LayoutContainer:AddChild(HeightSlider) local ColourContainer = GUIWidgets.CreateInlineGroup(containerParent, "Colours & Toggles") @@ -1686,35 +1161,21 @@ local function CreatePowerBarSettings(containerParent, unit, updateCallback) local SmoothUpdatesToggle = AG:Create("CheckBox") SmoothUpdatesToggle:SetLabel("Smooth Updates") SmoothUpdatesToggle:SetValue(PowerBarDB.Smooth) - SmoothUpdatesToggle:SetCallback("OnValueChanged", - function(_, _, value) - PowerBarDB.Smooth = value - updateCallback() - end) + SmoothUpdatesToggle:SetCallback("OnValueChanged", function(_, _, value) PowerBarDB.Smooth = value updateCallback() end) SmoothUpdatesToggle:SetRelativeWidth(0.33) ColourContainer:AddChild(SmoothUpdatesToggle) local ColourByTypeToggle = AG:Create("CheckBox") ColourByTypeToggle:SetLabel("Colour By Type") ColourByTypeToggle:SetValue(PowerBarDB.ColourByType) - ColourByTypeToggle:SetCallback("OnValueChanged", - function(_, _, value) - PowerBarDB.ColourByType = value - updateCallback() - RefreshPowerBarGUI() - end) + ColourByTypeToggle:SetCallback("OnValueChanged", function(_, _, value) PowerBarDB.ColourByType = value updateCallback() RefreshPowerBarGUI() end) ColourByTypeToggle:SetRelativeWidth(0.33) ColourContainer:AddChild(ColourByTypeToggle) local ColourByClassToggle = AG:Create("CheckBox") ColourByClassToggle:SetLabel("Colour By Class") ColourByClassToggle:SetValue(PowerBarDB.ColourByClass) - ColourByClassToggle:SetCallback("OnValueChanged", - function(_, _, value) - PowerBarDB.ColourByClass = value - updateCallback() - RefreshPowerBarGUI() - end) + ColourByClassToggle:SetCallback("OnValueChanged", function(_, _, value) PowerBarDB.ColourByClass = value updateCallback() RefreshPowerBarGUI() end) ColourByClassToggle:SetRelativeWidth(0.33) ColourContainer:AddChild(ColourByClassToggle) @@ -1730,11 +1191,7 @@ local function CreatePowerBarSettings(containerParent, unit, updateCallback) ForegroundColourPicker:SetLabel("Foreground Colour") local R, G, B, A = unpack(PowerBarDB.Foreground) ForegroundColourPicker:SetColor(R, G, B, A) - ForegroundColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b, a) - PowerBarDB.Foreground = { r, g, b, a } - updateCallback() - end) + ForegroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) PowerBarDB.Foreground = {r, g, b, a} updateCallback() end) ForegroundColourPicker:SetHasAlpha(true) ForegroundColourPicker:SetRelativeWidth(0.5) ForegroundColourPicker:SetDisabled(PowerBarDB.ColourByClass or PowerBarDB.ColourByType) @@ -1744,11 +1201,7 @@ local function CreatePowerBarSettings(containerParent, unit, updateCallback) BackgroundColourPicker:SetLabel("Background Colour") local R2, G2, B2, A2 = unpack(PowerBarDB.Background) BackgroundColourPicker:SetColor(R2, G2, B2, A2) - BackgroundColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b, a) - PowerBarDB.Background = { r, g, b, a } - updateCallback() - end) + BackgroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) PowerBarDB.Background = {r, g, b, a} updateCallback() end) BackgroundColourPicker:SetHasAlpha(true) BackgroundColourPicker:SetRelativeWidth(0.5) BackgroundColourPicker:SetDisabled(PowerBarDB.ColourBackgroundByType) @@ -1787,31 +1240,21 @@ end local function CreateAlternativePowerBarSettings(containerParent, unit, updateCallback) local AlternativePowerBarDB = UUF.db.profile.Units[unit].AlternativePowerBar - GUIWidgets.CreateInformationTag(containerParent, - "The |cFF8080FFAlternative Power Bar|r will display |cFF4080FFMana|r for classes that have an alternative resource.") + GUIWidgets.CreateInformationTag(containerParent, "The |cFF8080FFAlternative Power Bar|r will display |cFF4080FFMana|r for classes that have an alternative resource.") local AlternativePowerBarSettings = GUIWidgets.CreateInlineGroup(containerParent, "Alternative Power Bar Settings") local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFAlternative Power Bar|r") Toggle:SetValue(AlternativePowerBarDB.Enabled) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - AlternativePowerBarDB.Enabled = value - updateCallback() - RefreshAlternativePowerBarGUI() - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Enabled = value updateCallback() RefreshAlternativePowerBarGUI() end) Toggle:SetRelativeWidth(0.5) AlternativePowerBarSettings:AddChild(Toggle) local InverseGrowthDirectionToggle = AG:Create("CheckBox") InverseGrowthDirectionToggle:SetLabel("Inverse Growth Direction") InverseGrowthDirectionToggle:SetValue(AlternativePowerBarDB.Inverse) - InverseGrowthDirectionToggle:SetCallback("OnValueChanged", - function(_, _, value) - AlternativePowerBarDB.Inverse = value - updateCallback() - end) + InverseGrowthDirectionToggle:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Inverse = value updateCallback() end) InverseGrowthDirectionToggle:SetRelativeWidth(0.5) AlternativePowerBarSettings:AddChild(InverseGrowthDirectionToggle) @@ -1822,11 +1265,7 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa WidthSlider:SetValue(AlternativePowerBarDB.Width) WidthSlider:SetSliderValues(1, 1000, 0.1) WidthSlider:SetRelativeWidth(0.5) - WidthSlider:SetCallback("OnValueChanged", - function(_, _, value) - AlternativePowerBarDB.Width = value - updateCallback() - end) + WidthSlider:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Width = value updateCallback() end) LayoutContainer:AddChild(WidthSlider) local HeightSlider = AG:Create("Slider") @@ -1834,11 +1273,7 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa HeightSlider:SetValue(AlternativePowerBarDB.Height) HeightSlider:SetSliderValues(1, 64, 0.1) HeightSlider:SetRelativeWidth(0.5) - HeightSlider:SetCallback("OnValueChanged", - function(_, _, value) - AlternativePowerBarDB.Height = value - updateCallback() - end) + HeightSlider:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Height = value updateCallback() end) LayoutContainer:AddChild(HeightSlider) local AnchorFromDropdown = AG:Create("Dropdown") @@ -1846,11 +1281,7 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(AlternativePowerBarDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", - function(_, _, value) - AlternativePowerBarDB.Layout[1] = value - updateCallback() - end) + AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Layout[1] = value updateCallback() end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -1858,11 +1289,7 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(AlternativePowerBarDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", - function(_, _, value) - AlternativePowerBarDB.Layout[2] = value - updateCallback() - end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Layout[2] = value updateCallback() end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -1870,11 +1297,7 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa XPosSlider:SetValue(AlternativePowerBarDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.5) - XPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - AlternativePowerBarDB.Layout[3] = value - updateCallback() - end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Layout[3] = value updateCallback() end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -1882,11 +1305,7 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa YPosSlider:SetValue(AlternativePowerBarDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.5) - YPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - AlternativePowerBarDB.Layout[4] = value - updateCallback() - end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.Layout[4] = value updateCallback() end) LayoutContainer:AddChild(YPosSlider) local ColourContainer = GUIWidgets.CreateInlineGroup(containerParent, "Colours & Toggles") @@ -1894,12 +1313,7 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa local ColourByTypeToggle = AG:Create("CheckBox") ColourByTypeToggle:SetLabel("Colour By Type") ColourByTypeToggle:SetValue(AlternativePowerBarDB.ColourByType) - ColourByTypeToggle:SetCallback("OnValueChanged", - function(_, _, value) - AlternativePowerBarDB.ColourByType = value - updateCallback() - RefreshAlternativePowerBarGUI() - end) + ColourByTypeToggle:SetCallback("OnValueChanged", function(_, _, value) AlternativePowerBarDB.ColourByType = value updateCallback() RefreshAlternativePowerBarGUI() end) ColourByTypeToggle:SetRelativeWidth(0.33) ColourContainer:AddChild(ColourByTypeToggle) @@ -1907,11 +1321,7 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa ForegroundColourPicker:SetLabel("Foreground Colour") local R, G, B, A = unpack(AlternativePowerBarDB.Foreground) ForegroundColourPicker:SetColor(R, G, B, A) - ForegroundColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b, a) - AlternativePowerBarDB.Foreground = { r, g, b, a } - updateCallback() - end) + ForegroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) AlternativePowerBarDB.Foreground = {r, g, b, a} updateCallback() end) ForegroundColourPicker:SetHasAlpha(true) ForegroundColourPicker:SetRelativeWidth(0.33) ForegroundColourPicker:SetDisabled(AlternativePowerBarDB.ColourByType) @@ -1921,11 +1331,7 @@ local function CreateAlternativePowerBarSettings(containerParent, unit, updateCa BackgroundColourPicker:SetLabel("Background Colour") local R2, G2, B2, A2 = unpack(AlternativePowerBarDB.Background) BackgroundColourPicker:SetColor(R2, G2, B2, A2) - BackgroundColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b, a) - AlternativePowerBarDB.Background = { r, g, b, a } - updateCallback() - end) + BackgroundColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b, a) AlternativePowerBarDB.Background = {r, g, b, a} updateCallback() end) BackgroundColourPicker:SetHasAlpha(true) BackgroundColourPicker:SetRelativeWidth(0.33) ColourContainer:AddChild(BackgroundColourPicker) @@ -1956,23 +1362,14 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFPortrait|r") Toggle:SetValue(PortraitDB.Enabled) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - PortraitDB.Enabled = value - updateCallback() - RefreshPortraitGUI() - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Enabled = value updateCallback() RefreshPortraitGUI() end) Toggle:SetRelativeWidth(0.5) ToggleContainer:AddChild(Toggle) local UseClassPortraitToggle = AG:Create("CheckBox") UseClassPortraitToggle:SetLabel("Use Class Portrait") UseClassPortraitToggle:SetValue(PortraitDB.UseClassPortrait) - UseClassPortraitToggle:SetCallback("OnValueChanged", - function(_, _, value) - PortraitDB.UseClassPortrait = value - updateCallback() - end) + UseClassPortraitToggle:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.UseClassPortrait = value updateCallback() end) UseClassPortraitToggle:SetRelativeWidth(0.5) ToggleContainer:AddChild(UseClassPortraitToggle) @@ -1983,11 +1380,7 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(PortraitDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", - function(_, _, value) - PortraitDB.Layout[1] = value - updateCallback() - end) + AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Layout[1] = value updateCallback() end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -1995,11 +1388,7 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(PortraitDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", - function(_, _, value) - PortraitDB.Layout[2] = value - updateCallback() - end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Layout[2] = value updateCallback() end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -2007,10 +1396,7 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) XPosSlider:SetValue(PortraitDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) - PortraitDB.Layout[3] = value - updateCallback() - end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Layout[3] = value updateCallback() end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -2018,10 +1404,7 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) YPosSlider:SetValue(PortraitDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) - PortraitDB.Layout[4] = value - updateCallback() - end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Layout[4] = value updateCallback() end) LayoutContainer:AddChild(YPosSlider) local ZoomSlider = AG:Create("Slider") @@ -2029,10 +1412,7 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) ZoomSlider:SetValue(PortraitDB.Zoom) ZoomSlider:SetSliderValues(0, 1, 0.01) ZoomSlider:SetRelativeWidth(0.33) - ZoomSlider:SetCallback("OnValueChanged", function(_, _, value) - PortraitDB.Zoom = value - updateCallback() - end) + ZoomSlider:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Zoom = value updateCallback() end) ZoomSlider:SetIsPercent(true) LayoutContainer:AddChild(ZoomSlider) @@ -2041,10 +1421,7 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) WidthSlider:SetValue(PortraitDB.Width) WidthSlider:SetSliderValues(8, 64, 0.1) WidthSlider:SetRelativeWidth(0.5) - WidthSlider:SetCallback("OnValueChanged", function(_, _, value) - PortraitDB.Width = value - updateCallback() - end) + WidthSlider:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Width = value updateCallback() end) LayoutContainer:AddChild(WidthSlider) local HeightSlider = AG:Create("Slider") @@ -2052,10 +1429,7 @@ local function CreatePortraitSettings(containerParent, unit, updateCallback) HeightSlider:SetValue(PortraitDB.Height) HeightSlider:SetSliderValues(8, 64, 0.1) HeightSlider:SetRelativeWidth(0.5) - HeightSlider:SetCallback("OnValueChanged", function(_, _, value) - PortraitDB.Height = value - updateCallback() - end) + HeightSlider:SetCallback("OnValueChanged", function(_, _, value) PortraitDB.Height = value updateCallback() end) LayoutContainer:AddChild(HeightSlider) function RefreshPortraitGUI() @@ -2079,12 +1453,7 @@ local function CreateRaidTargetMarkerSettings(containerParent, unit, updateCallb local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFRaid Target Marker|r Indicator") Toggle:SetValue(RaidTargetMarkerDB.Enabled) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - RaidTargetMarkerDB.Enabled = value - updateCallback() - RefreshStatusGUI() - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) RaidTargetMarkerDB.Enabled = value updateCallback() RefreshStatusGUI() end) Toggle:SetRelativeWidth(1) ToggleContainer:AddChild(Toggle) @@ -2095,11 +1464,7 @@ local function CreateRaidTargetMarkerSettings(containerParent, unit, updateCallb AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(RaidTargetMarkerDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", - function(_, _, value) - RaidTargetMarkerDB.Layout[1] = value - updateCallback() - end) + AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) RaidTargetMarkerDB.Layout[1] = value updateCallback() end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -2107,11 +1472,7 @@ local function CreateRaidTargetMarkerSettings(containerParent, unit, updateCallb AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(RaidTargetMarkerDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", - function(_, _, value) - RaidTargetMarkerDB.Layout[2] = value - updateCallback() - end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) RaidTargetMarkerDB.Layout[2] = value updateCallback() end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -2119,11 +1480,7 @@ local function CreateRaidTargetMarkerSettings(containerParent, unit, updateCallb XPosSlider:SetValue(RaidTargetMarkerDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - RaidTargetMarkerDB.Layout[3] = value - updateCallback() - end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) RaidTargetMarkerDB.Layout[3] = value updateCallback() end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -2131,11 +1488,7 @@ local function CreateRaidTargetMarkerSettings(containerParent, unit, updateCallb YPosSlider:SetValue(RaidTargetMarkerDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - RaidTargetMarkerDB.Layout[4] = value - updateCallback() - end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) RaidTargetMarkerDB.Layout[4] = value updateCallback() end) LayoutContainer:AddChild(YPosSlider) local SizeSlider = AG:Create("Slider") @@ -2143,10 +1496,7 @@ local function CreateRaidTargetMarkerSettings(containerParent, unit, updateCallb SizeSlider:SetValue(RaidTargetMarkerDB.Size) SizeSlider:SetSliderValues(8, 64, 1) SizeSlider:SetRelativeWidth(0.33) - SizeSlider:SetCallback("OnValueChanged", function(_, _, value) - RaidTargetMarkerDB.Size = value - updateCallback() - end) + SizeSlider:SetCallback("OnValueChanged", function(_, _, value) RaidTargetMarkerDB.Size = value updateCallback() end) LayoutContainer:AddChild(SizeSlider) function RefreshStatusGUI() @@ -2170,12 +1520,7 @@ local function CreateLeaderAssistaintSettings(containerParent, unit, updateCallb local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFLeader|r & |cFF8080FFAssistant|r Indicator") Toggle:SetValue(LeaderAssistantDB.Enabled) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - LeaderAssistantDB.Enabled = value - updateCallback() - RefreshStatusGUI() - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) LeaderAssistantDB.Enabled = value updateCallback() RefreshStatusGUI() end) Toggle:SetRelativeWidth(1) ToggleContainer:AddChild(Toggle) @@ -2186,11 +1531,7 @@ local function CreateLeaderAssistaintSettings(containerParent, unit, updateCallb AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(LeaderAssistantDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", - function(_, _, value) - LeaderAssistantDB.Layout[1] = value - updateCallback() - end) + AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) LeaderAssistantDB.Layout[1] = value updateCallback() end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -2198,11 +1539,7 @@ local function CreateLeaderAssistaintSettings(containerParent, unit, updateCallb AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(LeaderAssistantDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", - function(_, _, value) - LeaderAssistantDB.Layout[2] = value - updateCallback() - end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) LeaderAssistantDB.Layout[2] = value updateCallback() end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -2210,11 +1547,7 @@ local function CreateLeaderAssistaintSettings(containerParent, unit, updateCallb XPosSlider:SetValue(LeaderAssistantDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - LeaderAssistantDB.Layout[3] = value - updateCallback() - end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) LeaderAssistantDB.Layout[3] = value updateCallback() end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -2222,11 +1555,7 @@ local function CreateLeaderAssistaintSettings(containerParent, unit, updateCallb YPosSlider:SetValue(LeaderAssistantDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - LeaderAssistantDB.Layout[4] = value - updateCallback() - end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) LeaderAssistantDB.Layout[4] = value updateCallback() end) LayoutContainer:AddChild(YPosSlider) local SizeSlider = AG:Create("Slider") @@ -2234,10 +1563,7 @@ local function CreateLeaderAssistaintSettings(containerParent, unit, updateCallb SizeSlider:SetValue(LeaderAssistantDB.Size) SizeSlider:SetSliderValues(8, 64, 1) SizeSlider:SetRelativeWidth(0.33) - SizeSlider:SetCallback("OnValueChanged", function(_, _, value) - LeaderAssistantDB.Size = value - updateCallback() - end) + SizeSlider:SetCallback("OnValueChanged", function(_, _, value) LeaderAssistantDB.Size = value updateCallback() end) LayoutContainer:AddChild(SizeSlider) function RefreshStatusGUI() @@ -2264,14 +1590,9 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb end local Toggle = AG:Create("CheckBox") - Toggle:SetLabel("Enable |cFF8080FF" .. statusDB .. "|r Indicator") + Toggle:SetLabel("Enable |cFF8080FF"..statusDB.."|r Indicator") Toggle:SetValue(StatusDB.Enabled) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - StatusDB.Enabled = value - updateCallback() - RefreshStatusGUI() - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Enabled = value updateCallback() RefreshStatusGUI() end) Toggle:SetRelativeWidth(0.5) ToggleContainer:AddChild(Toggle) @@ -2280,11 +1601,7 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb StatusTextureDropdown:SetLabel(statusDB .. " Texture") StatusTextureDropdown:SetValue(StatusDB.Texture) StatusTextureDropdown:SetRelativeWidth(0.5) - StatusTextureDropdown:SetCallback("OnValueChanged", - function(_, _, value) - StatusDB.Texture = value - updateCallback() - end) + StatusTextureDropdown:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Texture = value updateCallback() end) ToggleContainer:AddChild(StatusTextureDropdown) local LayoutContainer = GUIWidgets.CreateInlineGroup(containerParent, "Layout & Positioning") @@ -2294,11 +1611,7 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(StatusDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", - function(_, _, value) - StatusDB.Layout[1] = value - updateCallback() - end) + AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Layout[1] = value updateCallback() end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -2306,10 +1619,7 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(StatusDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) - StatusDB.Layout[2] = value - updateCallback() - end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Layout[2] = value updateCallback() end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -2317,10 +1627,7 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb XPosSlider:SetValue(StatusDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", function(_, _, value) - StatusDB.Layout[3] = value - updateCallback() - end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Layout[3] = value updateCallback() end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -2328,10 +1635,7 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb YPosSlider:SetValue(StatusDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", function(_, _, value) - StatusDB.Layout[4] = value - updateCallback() - end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Layout[4] = value updateCallback() end) LayoutContainer:AddChild(YPosSlider) local SizeSlider = AG:Create("Slider") @@ -2339,10 +1643,7 @@ local function CreateStatusSettings(containerParent, unit, statusDB, updateCallb SizeSlider:SetValue(StatusDB.Size) SizeSlider:SetSliderValues(8, 64, 1) SizeSlider:SetRelativeWidth(0.33) - SizeSlider:SetCallback("OnValueChanged", function(_, _, value) - StatusDB.Size = value - updateCallback() - end) + SizeSlider:SetCallback("OnValueChanged", function(_, _, value) StatusDB.Size = value updateCallback() end) LayoutContainer:AddChild(SizeSlider) function RefreshStatusGUI() @@ -2366,23 +1667,14 @@ local function CreateMouseoverSettings(containerParent, unit, updateCallback) local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFMouseover|r Highlight") Toggle:SetValue(MouseoverDB.Enabled) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - MouseoverDB.Enabled = value - updateCallback() - RefreshMouseoverGUI() - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) MouseoverDB.Enabled = value updateCallback() RefreshMouseoverGUI() end) Toggle:SetRelativeWidth(1) ToggleContainer:AddChild(Toggle) local ColourPicker = AG:Create("ColorPicker") ColourPicker:SetLabel("Highlight Colour") ColourPicker:SetColor(MouseoverDB.Colour[1], MouseoverDB.Colour[2], MouseoverDB.Colour[3]) - ColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b) - MouseoverDB.Colour = { r, g, b } - updateCallback() - end) + ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) MouseoverDB.Colour = {r, g, b} updateCallback() end) ColourPicker:SetHasAlpha(false) ColourPicker:SetRelativeWidth(0.33) ToggleContainer:AddChild(ColourPicker) @@ -2392,23 +1684,16 @@ local function CreateMouseoverSettings(containerParent, unit, updateCallback) OpacitySlider:SetValue(MouseoverDB.HighlightOpacity) OpacitySlider:SetSliderValues(0, 1, 0.01) OpacitySlider:SetRelativeWidth(0.33) - OpacitySlider:SetCallback("OnValueChanged", - function(_, _, value) - MouseoverDB.HighlightOpacity = value - updateCallback() - end) + OpacitySlider:SetCallback("OnValueChanged", function(_, _, value) MouseoverDB.HighlightOpacity = value updateCallback() end) OpacitySlider:SetIsPercent(true) ToggleContainer:AddChild(OpacitySlider) local StyleDropdown = AG:Create("Dropdown") - StyleDropdown:SetList({ ["BORDER"] = "Border", ["OVERLAY"] = "Overlay", ["GRADIENT"] = "Gradient" }) + StyleDropdown:SetList({["BORDER"] = "Border", ["OVERLAY"] = "Overlay", ["GRADIENT"] = "Gradient" }) StyleDropdown:SetLabel("Highlight Style") StyleDropdown:SetValue(MouseoverDB.Style) StyleDropdown:SetRelativeWidth(0.33) - StyleDropdown:SetCallback("OnValueChanged", function(_, _, value) - MouseoverDB.Style = value - updateCallback() - end) + StyleDropdown:SetCallback("OnValueChanged", function(_, _, value) MouseoverDB.Style = value updateCallback() end) ToggleContainer:AddChild(StyleDropdown) function RefreshMouseoverGUI() @@ -2430,23 +1715,14 @@ local function CreateTargetIndicatorSettings(containerParent, unit, updateCallba local Toggle = AG:Create("CheckBox") Toggle:SetLabel("Enable |cFF8080FFTarget Indicator|r") Toggle:SetValue(TargetIndicatorDB.Enabled) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - TargetIndicatorDB.Enabled = value - updateCallback() - RefreshTargetIndicatorGUI() - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) TargetIndicatorDB.Enabled = value updateCallback() RefreshTargetIndicatorGUI() end) Toggle:SetRelativeWidth(0.5) ToggleContainer:AddChild(Toggle) local ColourPicker = AG:Create("ColorPicker") ColourPicker:SetLabel("Indicator Colour") ColourPicker:SetColor(TargetIndicatorDB.Colour[1], TargetIndicatorDB.Colour[2], TargetIndicatorDB.Colour[3]) - ColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b) - TargetIndicatorDB.Colour = { r, g, b } - updateCallback() - end) + ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) TargetIndicatorDB.Colour = {r, g, b} updateCallback() end) ColourPicker:SetHasAlpha(false) ColourPicker:SetRelativeWidth(0.5) ToggleContainer:AddChild(ColourPicker) @@ -2467,44 +1743,17 @@ local function CreateIndicatorSettings(containerParent, unit) SaveSubTab(unit, "Indicators", IndicatorTab) IndicatorContainer:ReleaseChildren() if IndicatorTab == "RaidTargetMarker" then - CreateRaidTargetMarkerSettings(IndicatorContainer, unit, - function() - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitRaidTargetMarker( - UUF[unit:upper()], unit) - end - end) + CreateRaidTargetMarkerSettings(IndicatorContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitRaidTargetMarker(UUF[unit:upper()], unit) end end) elseif IndicatorTab == "LeaderAssistant" then - CreateLeaderAssistaintSettings(IndicatorContainer, unit, - function() UUF:UpdateUnitLeaderAssistantIndicator(UUF[unit:upper()], unit) end) + CreateLeaderAssistaintSettings(IndicatorContainer, unit, function() UUF:UpdateUnitLeaderAssistantIndicator(UUF[unit:upper()], unit) end) elseif IndicatorTab == "Resting" then - CreateStatusSettings(IndicatorContainer, unit, "Resting", - function() UUF:UpdateUnitRestingIndicator(UUF[unit:upper()], unit) end) + CreateStatusSettings(IndicatorContainer, unit, "Resting", function() UUF:UpdateUnitRestingIndicator(UUF[unit:upper()], unit) end) elseif IndicatorTab == "Combat" then - CreateStatusSettings(IndicatorContainer, unit, "Combat", - function() UUF:UpdateUnitCombatIndicator(UUF[unit:upper()], unit) end) + CreateStatusSettings(IndicatorContainer, unit, "Combat", function() UUF:UpdateUnitCombatIndicator(UUF[unit:upper()], unit) end) elseif IndicatorTab == "Mouseover" then - CreateMouseoverSettings(IndicatorContainer, unit, - function() - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitMouseoverIndicator( - UUF[unit:upper()], unit) - end - end) + CreateMouseoverSettings(IndicatorContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitMouseoverIndicator(UUF[unit:upper()], unit) end end) elseif IndicatorTab == "TargetIndicator" then - CreateTargetIndicatorSettings(IndicatorContainer, unit, - function() - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitTargetGlowIndicator( - UUF[unit:upper()], unit) - end - end) + CreateTargetIndicatorSettings(IndicatorContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTargetGlowIndicator(UUF[unit:upper()], unit) end end) end end @@ -2515,23 +1764,23 @@ local function CreateIndicatorSettings(containerParent, unit) IndicatorContainerTabGroup:SetTabs({ { text = "Raid Target Marker", value = "RaidTargetMarker" }, { text = "Leader & Assistant", value = "LeaderAssistant" }, - { text = "Resting", value = "Resting" }, - { text = "Combat", value = "Combat" }, - { text = "Mouseover", value = "Mouseover" }, + { text = "Resting", value = "Resting" }, + { text = "Combat", value = "Combat" }, + { text = "Mouseover", value = "Mouseover" }, }) elseif unit == "target" then IndicatorContainerTabGroup:SetTabs({ { text = "Raid Target Marker", value = "RaidTargetMarker" }, { text = "Leader & Assistant", value = "LeaderAssistant" }, - { text = "Combat", value = "Combat" }, - { text = "Mouseover", value = "Mouseover" }, - { text = "Target Indicator", value = "TargetIndicator" }, + { text = "Combat", value = "Combat" }, + { text = "Mouseover", value = "Mouseover" }, + { text = "Target Indicator", value = "TargetIndicator" }, }) elseif unit == "targettarget" or unit == "focus" or unit == "focustarget" or unit == "pet" or unit == "boss" then IndicatorContainerTabGroup:SetTabs({ { text = "Raid Target Marker", value = "RaidTargetMarker" }, - { text = "Mouseover", value = "Mouseover" }, - { text = "Target Indicator", value = "TargetIndicator" }, + { text = "Mouseover", value = "Mouseover" }, + { text = "Target Indicator", value = "TargetIndicator" }, }) end IndicatorContainerTabGroup:SetCallback("OnGroupSelected", SelectIndicatorTab) @@ -2549,23 +1798,14 @@ local function CreateTagSetting(containerParent, unit, tagDB) EditBox:SetText(TagDB.Tag) EditBox:SetRelativeWidth(0.5) EditBox:DisableButton(true) - EditBox:SetCallback("OnEnterPressed", - function(_, _, value) - TagDB.Tag = value - EditBox:SetText(TagDB.Tag) - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end - end) + EditBox:SetCallback("OnEnterPressed", function(_, _, value) TagDB.Tag = value EditBox:SetText(TagDB.Tag) if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) TagContainer:AddChild(EditBox) local ColourPicker = AG:Create("ColorPicker") ColourPicker:SetLabel("Colour") ColourPicker:SetColor(TagDB.Colour[1], TagDB.Colour[2], TagDB.Colour[3], 1) ColourPicker:SetFullWidth(true) - ColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b) - TagDB.Colour = { r, g, b } - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end - end) + ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) TagDB.Colour = {r, g, b} if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) ColourPicker:SetHasAlpha(false) ColourPicker:SetRelativeWidth(0.5) TagContainer:AddChild(ColourPicker) @@ -2577,11 +1817,7 @@ local function CreateTagSetting(containerParent, unit, tagDB) AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(TagDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", - function(_, _, value) - TagDB.Layout[1] = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end - end) + AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) TagDB.Layout[1] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -2589,11 +1825,7 @@ local function CreateTagSetting(containerParent, unit, tagDB) AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(TagDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", - function(_, _, value) - TagDB.Layout[2] = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end - end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) TagDB.Layout[2] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -2601,11 +1833,7 @@ local function CreateTagSetting(containerParent, unit, tagDB) XPosSlider:SetValue(TagDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - TagDB.Layout[3] = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end - end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) TagDB.Layout[3] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -2613,11 +1841,7 @@ local function CreateTagSetting(containerParent, unit, tagDB) YPosSlider:SetValue(TagDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - TagDB.Layout[4] = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end - end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) TagDB.Layout[4] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) LayoutContainer:AddChild(YPosSlider) local FontSizeSlider = AG:Create("Slider") @@ -2625,36 +1849,18 @@ local function CreateTagSetting(containerParent, unit, tagDB) FontSizeSlider:SetValue(TagDB.FontSize) FontSizeSlider:SetSliderValues(8, 64, 1) FontSizeSlider:SetRelativeWidth(0.33) - FontSizeSlider:SetCallback("OnValueChanged", - function(_, _, value) - TagDB.FontSize = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end - end) + FontSizeSlider:SetCallback("OnValueChanged", function(_, _, value) TagDB.FontSize = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end end) LayoutContainer:AddChild(FontSizeSlider) local TagSelectionContainer = GUIWidgets.CreateInlineGroup(containerParent, "Tag Selection") - GUIWidgets.CreateInformationTag(TagSelectionContainer, - "You can use the dropdowns below to quickly add tags.\n|cFF8080FFPrefix|r indicates that this should be added to the start of the tag string.") + GUIWidgets.CreateInformationTag(TagSelectionContainer, "You can use the dropdowns below to quickly add tags.\n|cFF8080FFPrefix|r indicates that this should be added to the start of the tag string.") local HealthTagDropdown = AG:Create("Dropdown") HealthTagDropdown:SetList(UUF:FetchTagData("Health")[1], UUF:FetchTagData("Health")[2]) HealthTagDropdown:SetLabel("Health Tags") HealthTagDropdown:SetValue(nil) HealthTagDropdown:SetRelativeWidth(0.5) - HealthTagDropdown:SetCallback("OnValueChanged", - function(_, _, value) - local currentTag = TagDB.Tag - if currentTag and currentTag ~= "" then - currentTag = currentTag .. "[" .. value .. "]" - else - currentTag = "[" .. - value .. "]" - end - EditBox:SetText(currentTag) - UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag - UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) - HealthTagDropdown:SetValue(nil) - end) + HealthTagDropdown:SetCallback("OnValueChanged", function(_, _, value) local currentTag = TagDB.Tag if currentTag and currentTag ~= "" then currentTag = currentTag .. "[" .. value .. "]" else currentTag = "[" .. value .. "]" end EditBox:SetText(currentTag) UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) HealthTagDropdown:SetValue(nil) end) TagSelectionContainer:AddChild(HealthTagDropdown) local PowerTagDropdown = AG:Create("Dropdown") @@ -2662,20 +1868,7 @@ local function CreateTagSetting(containerParent, unit, tagDB) PowerTagDropdown:SetLabel("Power Tags") PowerTagDropdown:SetValue(nil) PowerTagDropdown:SetRelativeWidth(0.5) - PowerTagDropdown:SetCallback("OnValueChanged", - function(_, _, value) - local currentTag = TagDB.Tag - if currentTag and currentTag ~= "" then - currentTag = currentTag .. "[" .. value .. "]" - else - currentTag = "[" .. - value .. "]" - end - EditBox:SetText(currentTag) - UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end - PowerTagDropdown:SetValue(nil) - end) + PowerTagDropdown:SetCallback("OnValueChanged", function(_, _, value) local currentTag = TagDB.Tag if currentTag and currentTag ~= "" then currentTag = currentTag .. "[" .. value .. "]" else currentTag = "[" .. value .. "]" end EditBox:SetText(currentTag) UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end PowerTagDropdown:SetValue(nil) end) TagSelectionContainer:AddChild(PowerTagDropdown) local NameTagDropdown = AG:Create("Dropdown") @@ -2683,20 +1876,7 @@ local function CreateTagSetting(containerParent, unit, tagDB) NameTagDropdown:SetLabel("Name Tags") NameTagDropdown:SetValue(nil) NameTagDropdown:SetRelativeWidth(0.5) - NameTagDropdown:SetCallback("OnValueChanged", - function(_, _, value) - local currentTag = TagDB.Tag - if currentTag and currentTag ~= "" then - currentTag = currentTag .. "[" .. value .. "]" - else - currentTag = "[" .. - value .. "]" - end - EditBox:SetText(currentTag) - UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end - NameTagDropdown:SetValue(nil) - end) + NameTagDropdown:SetCallback("OnValueChanged", function(_, _, value) local currentTag = TagDB.Tag if currentTag and currentTag ~= "" then currentTag = currentTag .. "[" .. value .. "]" else currentTag = "[" .. value .. "]" end EditBox:SetText(currentTag) UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end NameTagDropdown:SetValue(nil) end) TagSelectionContainer:AddChild(NameTagDropdown) local MiscTagDropdown = AG:Create("Dropdown") @@ -2704,20 +1884,7 @@ local function CreateTagSetting(containerParent, unit, tagDB) MiscTagDropdown:SetLabel("Misc Tags") MiscTagDropdown:SetValue(nil) MiscTagDropdown:SetRelativeWidth(0.5) - MiscTagDropdown:SetCallback("OnValueChanged", - function(_, _, value) - local currentTag = TagDB.Tag - if currentTag and currentTag ~= "" then - currentTag = currentTag .. "[" .. value .. "]" - else - currentTag = "[" .. - value .. "]" - end - EditBox:SetText(currentTag) - UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end - MiscTagDropdown:SetValue(nil) - end) + MiscTagDropdown:SetCallback("OnValueChanged", function(_, _, value) local currentTag = TagDB.Tag if currentTag and currentTag ~= "" then currentTag = currentTag .. "[" .. value .. "]" else currentTag = "[" .. value .. "]" end EditBox:SetText(currentTag) UUF.db.profile.Units[unit].Tags[tagDB].Tag = currentTag if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitTag(UUF[unit:upper()], unit, tagDB) end MiscTagDropdown:SetValue(nil) end) MiscTagDropdown:SetDisabled(#UUF:FetchTagData("Misc") == 0) TagSelectionContainer:AddChild(MiscTagDropdown) @@ -2725,6 +1892,7 @@ local function CreateTagSetting(containerParent, unit, tagDB) end local function CreateTagsSettings(containerParent, unit) + local function SelectTagTab(TagContainer, _, TagTab) SaveSubTab(unit, "Tags", TagTab) TagContainer:ReleaseChildren() @@ -2736,11 +1904,11 @@ local function CreateTagsSettings(containerParent, unit) TagContainerTabGroup:SetLayout("Flow") TagContainerTabGroup:SetFullWidth(true) TagContainerTabGroup:SetTabs({ - { text = "Tag One", value = "TagOne" }, - { text = "Tag Two", value = "TagTwo" }, - { text = "Tag Three", value = "TagThree" }, - { text = "Tag Four", value = "TagFour" }, - { text = "Tag Five", value = "TagFive" }, + { text = "Tag One", value = "TagOne"}, + { text = "Tag Two", value = "TagTwo"}, + { text = "Tag Three", value = "TagThree"}, + { text = "Tag Four", value = "TagFour"}, + { text = "Tag Five", value = "TagFive"}, }) TagContainerTabGroup:SetCallback("OnGroupSelected", SelectTagTab) TagContainerTabGroup:SelectTab(GetSavedSubTab(unit, "Tags", "TagOne")) @@ -2755,36 +1923,23 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) local AuraContainer = GUIWidgets.CreateInlineGroup(containerParent, auraDB .. " Settings") local Toggle = AG:Create("CheckBox") - Toggle:SetLabel("Enable |cFF8080FF" .. auraDB .. "|r") + Toggle:SetLabel("Enable |cFF8080FF"..auraDB.."|r") Toggle:SetValue(AuraDB.Enabled) - Toggle:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Enabled = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - RefreshAuraGUI() - end) + Toggle:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Enabled = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end RefreshAuraGUI() end) Toggle:SetRelativeWidth(0.33) AuraContainer:AddChild(Toggle) local OnlyShowPlayerToggle = AG:Create("CheckBox") - OnlyShowPlayerToggle:SetLabel("Only Show Player " .. auraDB) + OnlyShowPlayerToggle:SetLabel("Only Show Player "..auraDB) OnlyShowPlayerToggle:SetValue(AuraDB.OnlyShowPlayer) - OnlyShowPlayerToggle:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.OnlyShowPlayer = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + OnlyShowPlayerToggle:SetCallback("OnValueChanged", function(_, _, value) AuraDB.OnlyShowPlayer = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) OnlyShowPlayerToggle:SetRelativeWidth(0.33) AuraContainer:AddChild(OnlyShowPlayerToggle) local ShowTypeCheckbox = AG:Create("CheckBox") ShowTypeCheckbox:SetLabel(auraDB .. " Type Border") ShowTypeCheckbox:SetValue(AuraDB.ShowType) - ShowTypeCheckbox:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.ShowType = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + ShowTypeCheckbox:SetCallback("OnValueChanged", function(_, _, value) AuraDB.ShowType = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) ShowTypeCheckbox:SetRelativeWidth(0.33) AuraContainer:AddChild(ShowTypeCheckbox) @@ -2795,11 +1950,7 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(AuraDB.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Layout[1] = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Layout[1] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) LayoutContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -2807,11 +1958,7 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(AuraDB.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Layout[2] = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Layout[2] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) LayoutContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -2819,11 +1966,7 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) XPosSlider:SetValue(AuraDB.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.25) - XPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Layout[3] = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Layout[3] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) LayoutContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -2831,11 +1974,7 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) YPosSlider:SetValue(AuraDB.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.25) - YPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Layout[4] = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Layout[4] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) LayoutContainer:AddChild(YPosSlider) local SizeSlider = AG:Create("Slider") @@ -2843,11 +1982,7 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) SizeSlider:SetValue(AuraDB.Size) SizeSlider:SetSliderValues(8, 64, 1) SizeSlider:SetRelativeWidth(0.25) - SizeSlider:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Size = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + SizeSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Size = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) LayoutContainer:AddChild(SizeSlider) local SpacingSlider = AG:Create("Slider") @@ -2855,11 +1990,7 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) SpacingSlider:SetValue(AuraDB.Layout[5]) SpacingSlider:SetSliderValues(-5, 5, 1) SpacingSlider:SetRelativeWidth(0.25) - SpacingSlider:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Layout[5] = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + SpacingSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Layout[5] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) LayoutContainer:AddChild(SpacingSlider) GUIWidgets.CreateHeader(LayoutContainer, "Layout") @@ -2869,11 +2000,7 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) NumAurasSlider:SetValue(AuraDB.Num) NumAurasSlider:SetSliderValues(1, 24, 1) NumAurasSlider:SetRelativeWidth(0.5) - NumAurasSlider:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Num = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + NumAurasSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Num = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) LayoutContainer:AddChild(NumAurasSlider) local PerRowSlider = AG:Create("Slider") @@ -2881,35 +2008,23 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) PerRowSlider:SetValue(AuraDB.Wrap) PerRowSlider:SetSliderValues(1, 24, 1) PerRowSlider:SetRelativeWidth(0.5) - PerRowSlider:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Wrap = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + PerRowSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Wrap = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) LayoutContainer:AddChild(PerRowSlider) local GrowthDirectionDropdown = AG:Create("Dropdown") - GrowthDirectionDropdown:SetList({ ["LEFT"] = "Left", ["RIGHT"] = "Right" }) + GrowthDirectionDropdown:SetList({ ["LEFT"] = "Left", ["RIGHT"] = "Right"}) GrowthDirectionDropdown:SetLabel("Growth Direction") GrowthDirectionDropdown:SetValue(AuraDB.GrowthDirection) GrowthDirectionDropdown:SetRelativeWidth(0.5) - GrowthDirectionDropdown:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.GrowthDirection = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + GrowthDirectionDropdown:SetCallback("OnValueChanged", function(_, _, value) AuraDB.GrowthDirection = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) LayoutContainer:AddChild(GrowthDirectionDropdown) local WrapDirectionDropdown = AG:Create("Dropdown") - WrapDirectionDropdown:SetList({ ["UP"] = "Up", ["DOWN"] = "Down" }) + WrapDirectionDropdown:SetList({ ["UP"] = "Up", ["DOWN"] = "Down"}) WrapDirectionDropdown:SetLabel("Wrap Direction") WrapDirectionDropdown:SetValue(AuraDB.WrapDirection) WrapDirectionDropdown:SetRelativeWidth(0.5) - WrapDirectionDropdown:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.WrapDirection = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + WrapDirectionDropdown:SetCallback("OnValueChanged", function(_, _, value) AuraDB.WrapDirection = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) LayoutContainer:AddChild(WrapDirectionDropdown) local CountContainer = GUIWidgets.CreateInlineGroup(containerParent, "Count Settings") @@ -2919,11 +2034,7 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) CountAnchorFromDropdown:SetLabel("Anchor From") CountAnchorFromDropdown:SetValue(AuraDB.Count.Layout[1]) CountAnchorFromDropdown:SetRelativeWidth(0.5) - CountAnchorFromDropdown:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Count.Layout[1] = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + CountAnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Count.Layout[1] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) CountContainer:AddChild(CountAnchorFromDropdown) local CountAnchorToDropdown = AG:Create("Dropdown") @@ -2931,11 +2042,7 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) CountAnchorToDropdown:SetLabel("Anchor To") CountAnchorToDropdown:SetValue(AuraDB.Count.Layout[2]) CountAnchorToDropdown:SetRelativeWidth(0.5) - CountAnchorToDropdown:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Count.Layout[2] = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + CountAnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Count.Layout[2] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) CountContainer:AddChild(CountAnchorToDropdown) local CountXPosSlider = AG:Create("Slider") @@ -2943,11 +2050,7 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) CountXPosSlider:SetValue(AuraDB.Count.Layout[3]) CountXPosSlider:SetSliderValues(-1000, 1000, 0.1) CountXPosSlider:SetRelativeWidth(0.25) - CountXPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Count.Layout[3] = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + CountXPosSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Count.Layout[3] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) CountContainer:AddChild(CountXPosSlider) local CountYPosSlider = AG:Create("Slider") @@ -2955,11 +2058,7 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) CountYPosSlider:SetValue(AuraDB.Count.Layout[4]) CountYPosSlider:SetSliderValues(-1000, 1000, 0.1) CountYPosSlider:SetRelativeWidth(0.25) - CountYPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Count.Layout[4] = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + CountYPosSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Count.Layout[4] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) CountContainer:AddChild(CountYPosSlider) local FontSizeSlider = AG:Create("Slider") @@ -2967,21 +2066,13 @@ local function CreateSpecificAuraSettings(containerParent, unit, auraDB) FontSizeSlider:SetValue(AuraDB.Count.FontSize) FontSizeSlider:SetSliderValues(8, 64, 1) FontSizeSlider:SetRelativeWidth(0.25) - FontSizeSlider:SetCallback("OnValueChanged", - function(_, _, value) - AuraDB.Count.FontSize = value - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + FontSizeSlider:SetCallback("OnValueChanged", function(_, _, value) AuraDB.Count.FontSize = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) CountContainer:AddChild(FontSizeSlider) local ColourPicker = AG:Create("ColorPicker") ColourPicker:SetLabel("Colour") ColourPicker:SetColor(AuraDB.Count.Colour[1], AuraDB.Count.Colour[2], AuraDB.Count.Colour[3], 1) - ColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b) - AuraDB.Count.Colour = { r, g, b } - if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end - end) + ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) AuraDB.Count.Colour = {r, g, b} if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, auraDB) end end) ColourPicker:SetHasAlpha(false) ColourPicker:SetRelativeWidth(0.25) CountContainer:AddChild(ColourPicker) @@ -3009,19 +2100,8 @@ local function CreateAuraSettings(containerParent, unit) local ColourPicker = AG:Create("ColorPicker") ColourPicker:SetLabel("Cooldown Text Colour") - ColourPicker:SetColor(UUF.db.profile.Units[unit].Auras.AuraDuration.Colour[1], - UUF.db.profile.Units[unit].Auras.AuraDuration.Colour[2], UUF.db.profile.Units[unit].Auras.AuraDuration.Colour[3], - 1) - ColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b) - UUF.db.profile.Units[unit].Auras.AuraDuration.Colour = { r, g, b } - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitAuras(UUF[unit:upper()], unit, - "AuraDuration") - end - end) + ColourPicker:SetColor(UUF.db.profile.Units[unit].Auras.AuraDuration.Colour[1], UUF.db.profile.Units[unit].Auras.AuraDuration.Colour[2], UUF.db.profile.Units[unit].Auras.AuraDuration.Colour[3], 1) + ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) UUF.db.profile.Units[unit].Auras.AuraDuration.Colour = {r, g, b} if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end end) ColourPicker:SetHasAlpha(false) ColourPicker:SetRelativeWidth(0.5) AuraDurationContainer:AddChild(ColourPicker) @@ -3029,17 +2109,7 @@ local function CreateAuraSettings(containerParent, unit) local ScaleByIconSizeCheckbox = AG:Create("CheckBox") ScaleByIconSizeCheckbox:SetLabel("Scale Cooldown Text By Icon Size") ScaleByIconSizeCheckbox:SetValue(UUF.db.profile.Units[unit].Auras.AuraDuration.ScaleByIconSize) - ScaleByIconSizeCheckbox:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db.profile.Units[unit].Auras.AuraDuration.ScaleByIconSize = value - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitAuras(UUF[unit:upper()], unit, - "AuraDuration") - end - RefreshFontSizeSlider() - end) + ScaleByIconSizeCheckbox:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.Units[unit].Auras.AuraDuration.ScaleByIconSize = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end RefreshFontSizeSlider() end) ScaleByIconSizeCheckbox:SetRelativeWidth(0.5) AuraDurationContainer:AddChild(ScaleByIconSizeCheckbox) @@ -3048,16 +2118,7 @@ local function CreateAuraSettings(containerParent, unit) AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue(UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[1]) AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[1] = value - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitAuras(UUF[unit:upper()], unit, - "AuraDuration") - end - end) + AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[1] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end end) AuraDurationContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -3065,16 +2126,7 @@ local function CreateAuraSettings(containerParent, unit) AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue(UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[2]) AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[2] = value - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitAuras(UUF[unit:upper()], unit, - "AuraDuration") - end - end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[2] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end end) AuraDurationContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -3082,16 +2134,7 @@ local function CreateAuraSettings(containerParent, unit) XPosSlider:SetValue(UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[3]) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[3] = value - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitAuras(UUF[unit:upper()], unit, - "AuraDuration") - end - end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[3] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end end) AuraDurationContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -3099,16 +2142,7 @@ local function CreateAuraSettings(containerParent, unit) YPosSlider:SetValue(UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[4]) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[4] = value - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitAuras(UUF[unit:upper()], unit, - "AuraDuration") - end - end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.Units[unit].Auras.AuraDuration.Layout[4] = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end end) AuraDurationContainer:AddChild(YPosSlider) local FontSizeSlider = AG:Create("Slider") @@ -3116,16 +2150,7 @@ local function CreateAuraSettings(containerParent, unit) FontSizeSlider:SetValue(UUF.db.profile.Units[unit].Auras.AuraDuration.FontSize) FontSizeSlider:SetSliderValues(8, 64, 1) FontSizeSlider:SetRelativeWidth(0.33) - FontSizeSlider:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db.profile.Units[unit].Auras.AuraDuration.FontSize = value - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitAuras(UUF[unit:upper()], unit, - "AuraDuration") - end - end) + FontSizeSlider:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.Units[unit].Auras.AuraDuration.FontSize = value if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAuras(UUF[unit:upper()], unit, "AuraDuration") end end) FontSizeSlider:SetDisabled(UUF.db.profile.Units[unit].Auras.AuraDuration.ScaleByIconSize) AuraDurationContainer:AddChild(FontSizeSlider) @@ -3134,11 +2159,7 @@ local function CreateAuraSettings(containerParent, unit) FrameStrataDropdown:SetLabel("Frame Strata") FrameStrataDropdown:SetValue(AurasDB.FrameStrata) FrameStrataDropdown:SetRelativeWidth(1) - FrameStrataDropdown:SetCallback("OnValueChanged", - function(_, _, value) - AurasDB.FrameStrata = value - UUF:UpdateUnitAurasStrata(unit) - end) + FrameStrataDropdown:SetCallback("OnValueChanged", function(_, _, value) AurasDB.FrameStrata = value UUF:UpdateUnitAurasStrata(unit) end) containerParent:AddChild(FrameStrataDropdown) function RefreshFontSizeSlider() @@ -3164,7 +2185,7 @@ local function CreateAuraSettings(containerParent, unit) local AuraContainerTabGroup = AG:Create("TabGroup") AuraContainerTabGroup:SetLayout("Flow") AuraContainerTabGroup:SetFullWidth(true) - AuraContainerTabGroup:SetTabs({ { text = "Buffs", value = "Buffs" }, { text = "Debuffs", value = "Debuffs" }, }) + AuraContainerTabGroup:SetTabs({ { text = "Buffs", value = "Buffs"}, { text = "Debuffs", value = "Debuffs"}, }) AuraContainerTabGroup:SetCallback("OnGroupSelected", SelectAuraTab) AuraContainerTabGroup:SelectTab(GetSavedSubTab(unit, "Auras", "Buffs")) containerParent:AddChild(AuraContainerTabGroup) @@ -3178,11 +2199,7 @@ local function CreateAuraDurationSettings(containerParent) local ColourPicker = AG:Create("ColorPicker") ColourPicker:SetLabel("Cooldown Text Colour") ColourPicker:SetColor(1, 1, 1, 1) - ColourPicker:SetCallback("OnValueChanged", - function(_, _, r, g, b) - for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Colour = { r, g, b } end - UUF:UpdateAllUnitFrames() - end) + ColourPicker:SetCallback("OnValueChanged", function(_, _, r, g, b) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Colour = {r, g, b} end UUF:UpdateAllUnitFrames() end) ColourPicker:SetHasAlpha(false) ColourPicker:SetRelativeWidth(0.5) AuraDurationContainer:AddChild(ColourPicker) @@ -3190,11 +2207,7 @@ local function CreateAuraDurationSettings(containerParent) local ScaleByIconSizeCheckbox = AG:Create("CheckBox") ScaleByIconSizeCheckbox:SetLabel("Scale Cooldown Text By Icon Size") ScaleByIconSizeCheckbox:SetValue(false) - ScaleByIconSizeCheckbox:SetCallback("OnValueChanged", - function(_, _, value) - for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.ScaleByIconSize = value end - UUF:UpdateAllUnitFrames() - end) + ScaleByIconSizeCheckbox:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.ScaleByIconSize = value end UUF:UpdateAllUnitFrames() end) ScaleByIconSizeCheckbox:SetRelativeWidth(0.5) AuraDurationContainer:AddChild(ScaleByIconSizeCheckbox) @@ -3203,11 +2216,7 @@ local function CreateAuraDurationSettings(containerParent) AnchorFromDropdown:SetLabel("Anchor From") AnchorFromDropdown:SetValue("CENTER") AnchorFromDropdown:SetRelativeWidth(0.5) - AnchorFromDropdown:SetCallback("OnValueChanged", - function(_, _, value) - for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[1] = value end - UUF:UpdateAllUnitFrames() - end) + AnchorFromDropdown:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[1] = value end UUF:UpdateAllUnitFrames() end) AuraDurationContainer:AddChild(AnchorFromDropdown) local AnchorToDropdown = AG:Create("Dropdown") @@ -3215,11 +2224,7 @@ local function CreateAuraDurationSettings(containerParent) AnchorToDropdown:SetLabel("Anchor To") AnchorToDropdown:SetValue("CENTER") AnchorToDropdown:SetRelativeWidth(0.5) - AnchorToDropdown:SetCallback("OnValueChanged", - function(_, _, value) - for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[2] = value end - UUF:UpdateAllUnitFrames() - end) + AnchorToDropdown:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[2] = value end UUF:UpdateAllUnitFrames() end) AuraDurationContainer:AddChild(AnchorToDropdown) local XPosSlider = AG:Create("Slider") @@ -3227,11 +2232,7 @@ local function CreateAuraDurationSettings(containerParent) XPosSlider:SetValue(0) XPosSlider:SetSliderValues(-1000, 1000, 0.1) XPosSlider:SetRelativeWidth(0.33) - XPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[3] = value end - UUF:UpdateAllUnitFrames() - end) + XPosSlider:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[3] = value end UUF:UpdateAllUnitFrames() end) AuraDurationContainer:AddChild(XPosSlider) local YPosSlider = AG:Create("Slider") @@ -3239,11 +2240,7 @@ local function CreateAuraDurationSettings(containerParent) YPosSlider:SetValue(0) YPosSlider:SetSliderValues(-1000, 1000, 0.1) YPosSlider:SetRelativeWidth(0.33) - YPosSlider:SetCallback("OnValueChanged", - function(_, _, value) - for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[4] = value end - UUF:UpdateAllUnitFrames() - end) + YPosSlider:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.Layout[4] = value end UUF:UpdateAllUnitFrames() end) AuraDurationContainer:AddChild(YPosSlider) local FontSizeSlider = AG:Create("Slider") @@ -3251,22 +2248,16 @@ local function CreateAuraDurationSettings(containerParent) FontSizeSlider:SetValue(12) FontSizeSlider:SetSliderValues(8, 64, 1) FontSizeSlider:SetRelativeWidth(0.33) - FontSizeSlider:SetCallback("OnValueChanged", - function(_, _, value) - for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.FontSize = value end - UUF:UpdateAllUnitFrames() - end) + FontSizeSlider:SetCallback("OnValueChanged", function(_, _, value) for _, unitDB in pairs(UUF.db.profile.Units) do unitDB.Auras.AuraDuration.FontSize = value end UUF:UpdateAllUnitFrames() end) FontSizeSlider:SetDisabled(false) AuraDurationContainer:AddChild(FontSizeSlider) end local function CreateGlobalSettings(containerParent) + local GlobalContainer = GUIWidgets.CreateInlineGroup(containerParent, "Global Settings") - GUIWidgets.CreateInformationTag(GlobalContainer, - "The settings below will apply to all unit frames within" .. - UUF.PRETTY_ADDON_NAME .. - ".\nOptions are not dynamic. They are static but will apply to all unit frames when changed.") + GUIWidgets.CreateInformationTag(GlobalContainer, "The settings below will apply to all unit frames within" .. UUF.PRETTY_ADDON_NAME .. ".\nOptions are not dynamic. They are static but will apply to all unit frames when changed.") local ToggleContainer = GUIWidgets.CreateInlineGroup(GlobalContainer, "Toggles") @@ -3298,20 +2289,16 @@ local function CreateGlobalSettings(containerParent) CreateFontSettings(GlobalContainer) CreateTextureSettings(GlobalContainer) + CreateGlobalOutOfCombatFadeSettings(GlobalContainer) -- CreateRangeSettings(GlobalContainer) CreateAuraDurationSettings(GlobalContainer) - CreateGlobalOutOfCombatFadeSettings(GlobalContainer) local TagContainer = GUIWidgets.CreateInlineGroup(GlobalContainer, "Tag Settings") local UseCustomAbbreviationsCheckbox = AG:Create("CheckBox") UseCustomAbbreviationsCheckbox:SetLabel("Custom Abbreviations") UseCustomAbbreviationsCheckbox:SetValue(UUF.db.profile.General.UseCustomAbbreviations) - UseCustomAbbreviationsCheckbox:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db.profile.General.UseCustomAbbreviations = value - UUF:UpdateUnitTags() - end) + UseCustomAbbreviationsCheckbox:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.UseCustomAbbreviations = value UUF:UpdateUnitTags() end) UseCustomAbbreviationsCheckbox:SetRelativeWidth(0.33) TagContainer:AddChild(UseCustomAbbreviationsCheckbox) @@ -3320,13 +2307,7 @@ local function CreateGlobalSettings(containerParent) TagIntervalSlider:SetValue(1 / UUF.db.profile.General.TagUpdateInterval) TagIntervalSlider:SetSliderValues(1, 10, 0.5) TagIntervalSlider:SetRelativeWidth(0.33) - TagIntervalSlider:SetCallback("OnValueChanged", - function(_, _, value) - UUF.TAG_UPDATE_INTERVAL = 1 / value - UUF.db.profile.General.TagUpdateInterval = 1 / value - UUF:SetTagUpdateInterval() - UUF:UpdateUnitTags() - end) + TagIntervalSlider:SetCallback("OnValueChanged", function(_, _, value) UUF.TAG_UPDATE_INTERVAL = 1 / value UUF.db.profile.General.TagUpdateInterval = 1 / value UUF:SetTagUpdateInterval() UUF:UpdateUnitTags() end) TagContainer:AddChild(TagIntervalSlider) local SeparatorDropdown = AG:Create("Dropdown") @@ -3334,19 +2315,8 @@ local function CreateGlobalSettings(containerParent) SeparatorDropdown:SetLabel("Tag Separator") SeparatorDropdown:SetValue(UUF.db.profile.General.Separator) SeparatorDropdown:SetRelativeWidth(0.33) - SeparatorDropdown:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db.profile.General.Separator = value - UUF:UpdateUnitTags() - end) - SeparatorDropdown:SetCallback("OnEnter", - function() - GameTooltip:SetOwner(SeparatorDropdown.frame, "ANCHOR_BOTTOM") - GameTooltip:AddLine( - "The separator chosen here is only applied to custom tags which are combined. Such as |cFF8080FF[curhpperhp]|r or |cFF8080FF[curhpperhp:abbr]|r", - 1, 1, 1) - GameTooltip:Show() - end) + SeparatorDropdown:SetCallback("OnValueChanged", function(_, _, value) UUF.db.profile.General.Separator = value UUF:UpdateUnitTags() end) + SeparatorDropdown:SetCallback("OnEnter", function() GameTooltip:SetOwner(SeparatorDropdown.frame, "ANCHOR_BOTTOM") GameTooltip:AddLine("The separator chosen here is only applied to custom tags which are combined. Such as |cFF8080FF[curhpperhp]|r or |cFF8080FF[curhpperhp:abbr]|r", 1, 1, 1) GameTooltip:Show() end) SeparatorDropdown:SetCallback("OnLeave", function() GameTooltip:Hide() end) TagContainer:AddChild(SeparatorDropdown) @@ -3355,7 +2325,7 @@ end local function CreateUnitSettings(containerParent, unit) EnableUnitFrameToggle = AG:Create("CheckBox") - EnableUnitFrameToggle:SetLabel("Enable |cFFFFCC00" .. (UnitDBToUnitPrettyName[unit] or unit) .. "|r") + EnableUnitFrameToggle:SetLabel("Enable |cFFFFCC00"..(UnitDBToUnitPrettyName[unit] or unit) .."|r") EnableUnitFrameToggle:SetValue(UUF.db.profile.Units[unit].Enabled) EnableUnitFrameToggle:SetCallback("OnValueChanged", function(_, _, value) StaticPopupDialogs["UUF_RELOAD_UI"] = { @@ -3363,14 +2333,8 @@ local function CreateUnitSettings(containerParent, unit) button1 = "Reload Now", button2 = "Later", showAlert = true, - OnAccept = function() - UUF.db.profile.Units[unit].Enabled = value - ReloadUI() - end, - OnCancel = function() - EnableUnitFrameToggle:SetValue(UUF.db.profile.Units[unit].Enabled) - containerParent:DoLayout() - end, + OnAccept = function() UUF.db.profile.Units[unit].Enabled= value ReloadUI() end, + OnCancel = function() EnableUnitFrameToggle:SetValue(UUF.db.profile.Units[unit].Enabled) containerParent:DoLayout() end, timeout = 0, whileDead = true, hideOnEscape = true, @@ -3381,22 +2345,16 @@ local function CreateUnitSettings(containerParent, unit) containerParent:AddChild(EnableUnitFrameToggle) EnableUnitFrameToggle = AG:Create("CheckBox") - EnableUnitFrameToggle:SetLabel("Hide Blizzard |cFFFFCC00" .. (UnitDBToUnitPrettyName[unit] or unit) .. "|r") + EnableUnitFrameToggle:SetLabel("Hide Blizzard |cFFFFCC00"..(UnitDBToUnitPrettyName[unit] or unit) .."|r") EnableUnitFrameToggle:SetValue(UUF.db.profile.Units[unit].ForceHideBlizzard) EnableUnitFrameToggle:SetCallback("OnValueChanged", function(_, _, value) - StaticPopupDialogs["UUF_RELOAD_UI"] = { + StaticPopupDialogs["UUF_RELOAD_UI"] = { text = "You must reload to apply this change, do you want to reload now?", button1 = "Reload Now", button2 = "Later", showAlert = true, - OnAccept = function() - UUF.db.profile.Units[unit].ForceHideBlizzard = value - ReloadUI() - end, - OnCancel = function() - EnableUnitFrameToggle:SetValue(UUF.db.profile.Units[unit].ForceHideBlizzard) - containerParent:DoLayout() - end, + OnAccept = function() UUF.db.profile.Units[unit].ForceHideBlizzard = value ReloadUI() end, + OnCancel = function() EnableUnitFrameToggle:SetValue(UUF.db.profile.Units[unit].ForceHideBlizzard) containerParent:DoLayout() end, timeout = 0, whileDead = true, hideOnEscape = true, @@ -3412,52 +2370,19 @@ local function CreateUnitSettings(containerParent, unit) lastSelectedUnitTabs[unit].mainTab = UnitTab SubContainer:ReleaseChildren() if UnitTab == "Frame" then - CreateFrameSettings(SubContainer, unit, UUF.db.profile.Units[unit].Frame.AnchorParent and true or false, - function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitFrame(UUF[unit:upper()], unit) end end) + CreateFrameSettings(SubContainer, unit, UUF.db.profile.Units[unit].Frame.AnchorParent and true or false, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitFrame(UUF[unit:upper()], unit) end end) elseif UnitTab == "HealPrediction" then - CreateHealPredictionSettings(SubContainer, unit, - function() - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitHealPrediction( - UUF[unit:upper()], unit) - end - end) + CreateHealPredictionSettings(SubContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitHealPrediction(UUF[unit:upper()], unit) end end) elseif UnitTab == "Auras" then CreateAuraSettings(SubContainer, unit) elseif UnitTab == "PowerBar" then - CreatePowerBarSettings(SubContainer, unit, - function() - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitPowerBar(UUF[unit:upper()], - unit) - end - end) + CreatePowerBarSettings(SubContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitPowerBar(UUF[unit:upper()], unit) end end) elseif UnitTab == "AlternativePowerBar" then - CreateAlternativePowerBarSettings(SubContainer, unit, - function() - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitAlternativePowerBar( - UUF[unit:upper()], unit) - end - end) + CreateAlternativePowerBarSettings(SubContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitAlternativePowerBar(UUF[unit:upper()], unit) end end) elseif UnitTab == "CastBar" then CreateCastBarSettings(SubContainer, unit) elseif UnitTab == "Portrait" then - CreatePortraitSettings(SubContainer, unit, - function() - if unit == "boss" then - UUF:UpdateBossFrames() - else - UUF:UpdateUnitPortrait(UUF[unit:upper()], - unit) - end - end) + CreatePortraitSettings(SubContainer, unit, function() if unit == "boss" then UUF:UpdateBossFrames() else UUF:UpdateUnitPortrait(UUF[unit:upper()], unit) end end) elseif UnitTab == "Indicators" then CreateIndicatorSettings(SubContainer, unit) elseif UnitTab == "Tags" then @@ -3473,35 +2398,35 @@ local function CreateUnitSettings(containerParent, unit) SubContainerTabGroup:SetFullWidth(true) if unit == "player" and UUF:RequiresAlternativePowerBar() then SubContainerTabGroup:SetTabs({ - { text = "Frame", value = "Frame" }, - { text = "Heal Prediction", value = "HealPrediction" }, - { text = "Auras", value = "Auras" }, - { text = "Power Bar", value = "PowerBar" }, - { text = "Alternative Power Bar", value = "AlternativePowerBar" }, - { text = "Cast Bar", value = "CastBar" }, - { text = "Portrait", value = "Portrait" }, - { text = "Indicators", value = "Indicators" }, - { text = "Tags", value = "Tags" }, + { text = "Frame", value = "Frame"}, + { text = "Heal Prediction", value = "HealPrediction"}, + { text = "Auras", value = "Auras"}, + { text = "Power Bar", value = "PowerBar"}, + { text = "Alternative Power Bar", value = "AlternativePowerBar"}, + { text = "Cast Bar", value = "CastBar"}, + { text = "Portrait", value = "Portrait"}, + { text = "Indicators", value = "Indicators"}, + { text = "Tags", value = "Tags"}, }) elseif unit ~= "targettarget" and unit ~= "focustarget" then SubContainerTabGroup:SetTabs({ - { text = "Frame", value = "Frame" }, - { text = "Heal Prediction", value = "HealPrediction" }, - { text = "Auras", value = "Auras" }, - { text = "Power Bar", value = "PowerBar" }, - { text = "Cast Bar", value = "CastBar" }, - { text = "Portrait", value = "Portrait" }, - { text = "Indicators", value = "Indicators" }, - { text = "Tags", value = "Tags" }, + { text = "Frame", value = "Frame"}, + { text = "Heal Prediction", value = "HealPrediction"}, + { text = "Auras", value = "Auras"}, + { text = "Power Bar", value = "PowerBar"}, + { text = "Cast Bar", value = "CastBar"}, + { text = "Portrait", value = "Portrait"}, + { text = "Indicators", value = "Indicators"}, + { text = "Tags", value = "Tags"}, }) else SubContainerTabGroup:SetTabs({ - { text = "Frame", value = "Frame" }, - { text = "Heal Prediction", value = "HealPrediction" }, - { text = "Auras", value = "Auras" }, - { text = "Power Bar", value = "PowerBar" }, - { text = "Indicators", value = "Indicators" }, - { text = "Tags", value = "Tags" }, + { text = "Frame", value = "Frame"}, + { text = "Heal Prediction", value = "HealPrediction"}, + { text = "Auras", value = "Auras"}, + { text = "Power Bar", value = "PowerBar"}, + { text = "Indicators", value = "Indicators"}, + { text = "Tags", value = "Tags"}, }) end SubContainerTabGroup:SetCallback("OnGroupSelected", SelectUnitTab) @@ -3512,6 +2437,7 @@ local function CreateUnitSettings(containerParent, unit) end local function CreateTagSettings(containerParent) + local function DrawTagContainer(TagContainer, TagGroup) local TagsList, TagOrder = UUF:FetchTagData(TagGroup)[1], UUF:FetchTagData(TagGroup)[2] @@ -3532,11 +2458,7 @@ local function CreateTagSettings(containerParent) local TagValue = AG:Create("EditBox") TagValue:SetText("[" .. Tag .. "]") - TagValue:SetCallback("OnTextChanged", - function(widget, event, value) - TagValue:ClearFocus() - TagValue:SetText("[" .. Tag .. "]") - end) + TagValue:SetCallback("OnTextChanged", function(widget, event, value) TagValue:ClearFocus() TagValue:SetText("[" .. Tag .. "]") end) TagValue:SetRelativeWidth(0.5) TagContainer:AddChild(TagValue) end @@ -3559,9 +2481,9 @@ local function CreateTagSettings(containerParent) local GUIContainerTabGroup = AG:Create("TabGroup") GUIContainerTabGroup:SetLayout("Flow") GUIContainerTabGroup:SetTabs({ - { text = "Health", value = "Health" }, - { text = "Name", value = "Name" }, - { text = "Power", value = "Power" }, + { text = "Health", value = "Health" }, + { text = "Name", value = "Name" }, + { text = "Power", value = "Power" }, { text = "Miscellaneous", value = "Misc" }, }) GUIContainerTabGroup:SetCallback("OnGroupSelected", SelectedGroup) @@ -3607,8 +2529,7 @@ local function CreateProfileSettings(containerParent) end ResetProfileButton:SetText("Reset |cFF8080FF" .. UUF.db:GetCurrentProfile() .. "|r Profile") local isUsingGlobal = UUF.db.global.UseGlobalProfile - ActiveProfileHeading:SetText("Active Profile: |cFFFFFFFF" .. - UUF.db:GetCurrentProfile() .. (isUsingGlobal and " (|cFFFFCC00Global|r)" or "") .. "|r") + ActiveProfileHeading:SetText( "Active Profile: |cFFFFFFFF" .. UUF.db:GetCurrentProfile() .. (isUsingGlobal and " (|cFFFFCC00Global|r)" or "") .. "|r" ) if UUF.db:IsDualSpecEnabled() then SelectProfileDropdown:SetDisabled(true) CopyFromProfileDropdown:SetDisabled(true) @@ -3631,60 +2552,25 @@ local function CreateProfileSettings(containerParent) SelectProfileDropdown = AG:Create("Dropdown") SelectProfileDropdown:SetLabel("Select...") SelectProfileDropdown:SetRelativeWidth(0.25) - SelectProfileDropdown:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db:SetProfile(value) - UUF:SetUIScale() - UUF:UpdateAllUnitFrames() - RefreshProfiles() - end) + SelectProfileDropdown:SetCallback("OnValueChanged", function(_, _, value) UUF.db:SetProfile(value) UUF:SetUIScale() UUF:UpdateAllUnitFrames() RefreshProfiles() end) ProfileContainer:AddChild(SelectProfileDropdown) CopyFromProfileDropdown = AG:Create("Dropdown") CopyFromProfileDropdown:SetLabel("Copy From...") CopyFromProfileDropdown:SetRelativeWidth(0.25) - CopyFromProfileDropdown:SetCallback("OnValueChanged", - function(_, _, value) - UUF:CreatePrompt("Copy Profile", - "Are you sure you want to copy from |cFF8080FF" .. - value .. "|r?\nThis will |cFFFF4040overwrite|r your current profile settings.", - function() - UUF.db:CopyProfile(value) - UUF:SetUIScale() - UUF:UpdateAllUnitFrames() - RefreshProfiles() - end) - end) + CopyFromProfileDropdown:SetCallback("OnValueChanged", function(_, _, value) UUF:CreatePrompt("Copy Profile", "Are you sure you want to copy from |cFF8080FF" .. value .. "|r?\nThis will |cFFFF4040overwrite|r your current profile settings.", function() UUF.db:CopyProfile(value) UUF:SetUIScale() UUF:UpdateAllUnitFrames() RefreshProfiles() end) end) ProfileContainer:AddChild(CopyFromProfileDropdown) DeleteProfileDropdown = AG:Create("Dropdown") DeleteProfileDropdown:SetLabel("Delete...") DeleteProfileDropdown:SetRelativeWidth(0.25) - DeleteProfileDropdown:SetCallback("OnValueChanged", - function(_, _, value) - if value ~= UUF.db:GetCurrentProfile() then - UUF:CreatePrompt("Delete Profile", - "Are you sure you want to delete |cFF8080FF" .. value .. "|r?", - function() - UUF.db:DeleteProfile(value) - UUF:UpdateAllUnitFrames() - RefreshProfiles() - end) - end - end) + DeleteProfileDropdown:SetCallback("OnValueChanged", function(_, _, value) if value ~= UUF.db:GetCurrentProfile() then UUF:CreatePrompt("Delete Profile", "Are you sure you want to delete |cFF8080FF" .. value .. "|r?", function() UUF.db:DeleteProfile(value) UUF:UpdateAllUnitFrames() RefreshProfiles() end) end end) ProfileContainer:AddChild(DeleteProfileDropdown) ResetProfileButton = AG:Create("Button") ResetProfileButton:SetText("Reset |cFF8080FF" .. UUF.db:GetCurrentProfile() .. "|r Profile") ResetProfileButton:SetRelativeWidth(0.25) - ResetProfileButton:SetCallback("OnClick", - function() - UUF.db:ResetProfile() - UUF:ResolveLSM() - UUF:SetUIScale() - UUF:UpdateAllUnitFrames() - RefreshProfiles() - end) + ResetProfileButton:SetCallback("OnClick", function() UUF.db:ResetProfile() UUF:ResolveLSM() UUF:SetUIScale() UUF:UpdateAllUnitFrames() RefreshProfiles() end) ProfileContainer:AddChild(ResetProfileButton) local CreateProfileEditBox = AG:Create("EditBox") @@ -3698,17 +2584,7 @@ local function CreateProfileSettings(containerParent) local CreateProfileButton = AG:Create("Button") CreateProfileButton:SetText("Create Profile") CreateProfileButton:SetRelativeWidth(0.5) - CreateProfileButton:SetCallback("OnClick", - function() - local profileName = strtrim(CreateProfileEditBox:GetText() or "") - if profileName ~= "" then - UUF.db:SetProfile(profileName) - UUF:SetUIScale() - UUF:UpdateAllUnitFrames() - RefreshProfiles() - CreateProfileEditBox:SetText("") - end - end) + CreateProfileButton:SetCallback("OnClick", function() local profileName = strtrim(CreateProfileEditBox:GetText() or "") if profileName ~= "" then UUF.db:SetProfile(profileName) UUF:SetUIScale() UUF:UpdateAllUnitFrames() RefreshProfiles() CreateProfileEditBox:SetText("") end end) ProfileContainer:AddChild(CreateProfileButton) local GlobalProfileHeading = AG:Create("Heading") @@ -3716,30 +2592,13 @@ local function CreateProfileSettings(containerParent) GlobalProfileHeading:SetFullWidth(true) ProfileContainer:AddChild(GlobalProfileHeading) - GUIWidgets.CreateInformationTag(ProfileContainer, - "If |cFF8080FFUse Global Profile Settings|r is enabled, the profile selected below will be used as your active profile.\nThis is useful if you want to use the same profile across multiple characters.") + GUIWidgets.CreateInformationTag(ProfileContainer, "If |cFF8080FFUse Global Profile Settings|r is enabled, the profile selected below will be used as your active profile.\nThis is useful if you want to use the same profile across multiple characters.") UseGlobalProfileToggle = AG:Create("CheckBox") UseGlobalProfileToggle:SetLabel("Use Global Profile Settings") UseGlobalProfileToggle:SetValue(UUF.db.global.UseGlobalProfile) UseGlobalProfileToggle:SetRelativeWidth(0.5) - UseGlobalProfileToggle:SetCallback("OnValueChanged", - function(_, _, value) - RefreshProfiles() - UUF.db.global.UseGlobalProfile = value - if value and UUF.db.global.GlobalProfile and UUF.db.global.GlobalProfile ~= "" then - UUF.db:SetProfile(UUF.db.global.GlobalProfile) - UUF:SetUIScale() - end - GlobalProfileDropdown:SetDisabled(not value) - for _, child in ipairs(ProfileContainer.children) do - if child ~= UseGlobalProfileToggle and child ~= GlobalProfileDropdown then - GUIWidgets.DeepDisable(child, value) - end - end - UUF:UpdateAllUnitFrames() - RefreshProfiles() - end) + UseGlobalProfileToggle:SetCallback("OnValueChanged", function(_, _, value) RefreshProfiles() UUF.db.global.UseGlobalProfile = value if value and UUF.db.global.GlobalProfile and UUF.db.global.GlobalProfile ~= "" then UUF.db:SetProfile(UUF.db.global.GlobalProfile) UUF:SetUIScale() end GlobalProfileDropdown:SetDisabled(not value) for _, child in ipairs(ProfileContainer.children) do if child ~= UseGlobalProfileToggle and child ~= GlobalProfileDropdown then GUIWidgets.DeepDisable(child, value) end end UUF:UpdateAllUnitFrames() RefreshProfiles() end) ProfileContainer:AddChild(UseGlobalProfileToggle) GlobalProfileDropdown = AG:Create("Dropdown") @@ -3747,14 +2606,7 @@ local function CreateProfileSettings(containerParent) GlobalProfileDropdown:SetRelativeWidth(0.5) GlobalProfileDropdown:SetList(profileKeys) GlobalProfileDropdown:SetValue(UUF.db.global.GlobalProfile) - GlobalProfileDropdown:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db:SetProfile(value) - UUF.db.global.GlobalProfile = value - UUF:SetUIScale() - UUF:UpdateAllUnitFrames() - RefreshProfiles() - end) + GlobalProfileDropdown:SetCallback("OnValueChanged", function(_, _, value) UUF.db:SetProfile(value) UUF.db.global.GlobalProfile = value UUF:SetUIScale() UUF:UpdateAllUnitFrames() RefreshProfiles() end) ProfileContainer:AddChild(GlobalProfileDropdown) local SpecProfileContainer = GUIWidgets.CreateInlineGroup(ProfileContainer, "Specialization Profiles") @@ -3763,13 +2615,7 @@ local function CreateProfileSettings(containerParent) UseDualSpecializationToggle:SetLabel("Enable Specialization Profiles") UseDualSpecializationToggle:SetValue(UUF.db:IsDualSpecEnabled()) UseDualSpecializationToggle:SetRelativeWidth(1) - UseDualSpecializationToggle:SetCallback("OnValueChanged", - function(_, _, value) - UUF.db:SetDualSpecEnabled(value) - for i = 1, numSpecs do specProfilesList[i]:SetDisabled(not value) end - UUF:UpdateAllUnitFrames() - RefreshProfiles() - end) + UseDualSpecializationToggle:SetCallback("OnValueChanged", function(_, _, value) UUF.db:SetDualSpecEnabled(value) for i = 1, numSpecs do specProfilesList[i]:SetDisabled(not value) end UUF:UpdateAllUnitFrames() RefreshProfiles() end) UseDualSpecializationToggle:SetDisabled(UUF.db.global.UseGlobalProfile) SpecProfileContainer:AddChild(UseDualSpecializationToggle) @@ -3778,8 +2624,7 @@ local function CreateProfileSettings(containerParent) specProfilesList[i] = AG:Create("Dropdown") specProfilesList[i]:SetLabel(string.format("%s", specName or ("Spec %d"):format(i))) specProfilesList[i]:SetList(profileKeys) - specProfilesList[i]:SetCallback("OnValueChanged", - function(widget, event, value) UUF.db:SetDualSpecProfile(value, i) end) + specProfilesList[i]:SetCallback("OnValueChanged", function(widget, event, value) UUF.db:SetDualSpecProfile(value, i) end) specProfilesList[i]:SetRelativeWidth(numSpecs == 2 and 0.5 or numSpecs == 3 and 0.33 or 0.25) specProfilesList[i]:SetDisabled(not UUF.db:IsDualSpecEnabled() or UUF.db.global.UseGlobalProfile) SpecProfileContainer:AddChild(specProfilesList[i]) @@ -3794,8 +2639,7 @@ local function CreateProfileSettings(containerParent) ExportingHeading:SetFullWidth(true) SharingContainer:AddChild(ExportingHeading) - GUIWidgets.CreateInformationTag(SharingContainer, - "You can export your profile by pressing |cFF8080FFExport Profile|r button below & share the string with other |cFF8080FFUnhalted|r Unit Frame users.") + GUIWidgets.CreateInformationTag(SharingContainer, "You can export your profile by pressing |cFF8080FFExport Profile|r button below & share the string with other |cFF8080FFUnhalted|r Unit Frame users.") local ExportingEditBox = AG:Create("EditBox") ExportingEditBox:SetLabel("Export String...") @@ -3809,12 +2653,7 @@ local function CreateProfileSettings(containerParent) local ExportProfileButton = AG:Create("Button") ExportProfileButton:SetText("Export Profile") ExportProfileButton:SetRelativeWidth(0.3) - ExportProfileButton:SetCallback("OnClick", - function() - ExportingEditBox:SetText(UUF:ExportSavedVariables()) - ExportingEditBox:HighlightText() - ExportingEditBox:SetFocus() - end) + ExportProfileButton:SetCallback("OnClick", function() ExportingEditBox:SetText(UUF:ExportSavedVariables()) ExportingEditBox:HighlightText() ExportingEditBox:SetFocus() end) SharingContainer:AddChild(ExportProfileButton) local ImportingHeading = AG:Create("Heading") @@ -3822,8 +2661,7 @@ local function CreateProfileSettings(containerParent) ImportingHeading:SetFullWidth(true) SharingContainer:AddChild(ImportingHeading) - GUIWidgets.CreateInformationTag(SharingContainer, - "If you have an exported string, paste it in the |cFF8080FFImport String|r box below & press |cFF8080FFImport Profile|r.") + GUIWidgets.CreateInformationTag(SharingContainer, "If you have an exported string, paste it in the |cFF8080FFImport String|r box below & press |cFF8080FFImport Profile|r.") local ImportingEditBox = AG:Create("EditBox") ImportingEditBox:SetLabel("Import String...") @@ -3837,22 +2675,10 @@ local function CreateProfileSettings(containerParent) local ImportProfileButton = AG:Create("Button") ImportProfileButton:SetText("Import Profile") ImportProfileButton:SetRelativeWidth(0.3) - ImportProfileButton:SetCallback("OnClick", - function() - if ImportingEditBox:GetText() ~= "" then - UUF:ImportSavedVariables(ImportingEditBox:GetText()) - ImportingEditBox:SetText("") - end - end) + ImportProfileButton:SetCallback("OnClick", function() if ImportingEditBox:GetText() ~= "" then UUF:ImportSavedVariables(ImportingEditBox:GetText()) ImportingEditBox:SetText("") end end) SharingContainer:AddChild(ImportProfileButton) GlobalProfileDropdown:SetDisabled(not UUF.db.global.UseGlobalProfile) - if UUF.db.global.UseGlobalProfile then - for _, child in ipairs(ProfileContainer.children) do - if child ~= UseGlobalProfileToggle and child ~= GlobalProfileDropdown then - GUIWidgets.DeepDisable(child, true) - end - end - end + if UUF.db.global.UseGlobalProfile then for _, child in ipairs(ProfileContainer.children) do if child ~= UseGlobalProfileToggle and child ~= GlobalProfileDropdown then GUIWidgets.DeepDisable(child, true) end end end end function UUF:CreateGUI() @@ -3867,11 +2693,7 @@ function UUF:CreateGUI() Container:SetWidth(900) Container:SetHeight(600) Container:EnableResize(false) - Container:SetCallback("OnClose", function(widget) - AG:Release(widget) - isGUIOpen = false - DisableAllTestModes() - end) + Container:SetCallback("OnClose", function(widget) AG:Release(widget) isGUIOpen = false DisableAllTestModes() end) local function SelectTab(GUIContainer, _, MainTab) GUIContainer:ReleaseChildren() @@ -3889,131 +2711,69 @@ function UUF:CreateGUI() CreateColourSettings(ScrollFrame) local SupportMeContainer = AG:Create("InlineGroup") - SupportMeContainer:SetTitle( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Emotes\\peepoLove.png:18:18|t How To Support " .. - UUF.PRETTY_ADDON_NAME .. " Development") + SupportMeContainer:SetTitle("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Emotes\\peepoLove.png:18:18|t How To Support " .. UUF.PRETTY_ADDON_NAME .. " Development") SupportMeContainer:SetLayout("Flow") SupportMeContainer:SetFullWidth(true) ScrollFrame:AddChild(SupportMeContainer) - local KoFiInteractive = AG:Create("InteractiveLabel") - KoFiInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:16:21|t |cFF8080FFKo-Fi|r") - KoFiInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") - KoFiInteractive:SetJustifyV("MIDDLE") - KoFiInteractive:SetRelativeWidth(0.33) - KoFiInteractive:SetCallback("OnClick", - function() UUF:OpenURL("Support Me on Ko-Fi", "https://ko-fi.com/unhalted") end) - KoFiInteractive:SetCallback("OnEnter", - function() - KoFiInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:16:21|t |cFFFFFFFFKo-Fi|r") - end) - KoFiInteractive:SetCallback("OnLeave", - function() - KoFiInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:16:21|t |cFF8080FFKo-Fi|r") - end) - SupportMeContainer:AddChild(KoFiInteractive) - - local PayPalInteractive = AG:Create("InteractiveLabel") - PayPalInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:23:21|t |cFF8080FFPayPal|r") - PayPalInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") - PayPalInteractive:SetJustifyV("MIDDLE") - PayPalInteractive:SetRelativeWidth(0.33) - PayPalInteractive:SetCallback("OnClick", - function() UUF:OpenURL("Support Me on PayPal", "https://www.paypal.com/paypalme/dhunt1911") end) - PayPalInteractive:SetCallback("OnEnter", - function() - PayPalInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:23:21|t |cFFFFFFFFPayPal|r") - end) - PayPalInteractive:SetCallback("OnLeave", - function() - PayPalInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:23:21|t |cFF8080FFPayPal|r") - end) - SupportMeContainer:AddChild(PayPalInteractive) + -- local KoFiInteractive = AG:Create("InteractiveLabel") + -- KoFiInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:16:21|t |cFF8080FFKo-Fi|r") + -- KoFiInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") + -- KoFiInteractive:SetJustifyV("MIDDLE") + -- KoFiInteractive:SetRelativeWidth(0.33) + -- KoFiInteractive:SetCallback("OnClick", function() UUF:OpenURL("Support Me on Ko-Fi", "https://ko-fi.com/unhalted") end) + -- KoFiInteractive:SetCallback("OnEnter", function() KoFiInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:16:21|t |cFFFFFFFFKo-Fi|r") end) + -- KoFiInteractive:SetCallback("OnLeave", function() KoFiInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Ko-Fi.png:16:21|t |cFF8080FFKo-Fi|r") end) + -- SupportMeContainer:AddChild(KoFiInteractive) + + -- local PayPalInteractive = AG:Create("InteractiveLabel") + -- PayPalInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:23:21|t |cFF8080FFPayPal|r") + -- PayPalInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") + -- PayPalInteractive:SetJustifyV("MIDDLE") + -- PayPalInteractive:SetRelativeWidth(0.33) + -- PayPalInteractive:SetCallback("OnClick", function() UUF:OpenURL("Support Me on PayPal", "https://www.paypal.com/paypalme/dhunt1911") end) + -- PayPalInteractive:SetCallback("OnEnter", function() PayPalInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:23:21|t |cFFFFFFFFPayPal|r") end) + -- PayPalInteractive:SetCallback("OnLeave", function() PayPalInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\PayPal.png:23:21|t |cFF8080FFPayPal|r") end) + -- SupportMeContainer:AddChild(PayPalInteractive) local TwitchInteractive = AG:Create("InteractiveLabel") - TwitchInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:25:21|t |cFF8080FFTwitch|r") + TwitchInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:25:21|t |cFF8080FFTwitch|r") TwitchInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") TwitchInteractive:SetJustifyV("MIDDLE") TwitchInteractive:SetRelativeWidth(0.33) - TwitchInteractive:SetCallback("OnClick", - function() UUF:OpenURL("Support Me on Twitch", "https://www.twitch.tv/unhaltedgb") end) - TwitchInteractive:SetCallback("OnEnter", - function() - TwitchInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:25:21|t |cFFFFFFFFTwitch|r") - end) - TwitchInteractive:SetCallback("OnLeave", - function() - TwitchInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:25:21|t |cFF8080FFTwitch|r") - end) + TwitchInteractive:SetCallback("OnClick", function() UUF:OpenURL("Support Me on Twitch", "https://www.twitch.tv/unhaltedgb") end) + TwitchInteractive:SetCallback("OnEnter", function() TwitchInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:25:21|t |cFFFFFFFFTwitch|r") end) + TwitchInteractive:SetCallback("OnLeave", function() TwitchInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Twitch.png:25:21|t |cFF8080FFTwitch|r") end) SupportMeContainer:AddChild(TwitchInteractive) local DiscordInteractive = AG:Create("InteractiveLabel") - DiscordInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:21:21|t |cFF8080FFDiscord|r") + DiscordInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:21:21|t |cFF8080FFDiscord|r") DiscordInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") DiscordInteractive:SetJustifyV("MIDDLE") DiscordInteractive:SetRelativeWidth(0.33) - DiscordInteractive:SetCallback("OnClick", - function() UUF:OpenURL("Support Me on Discord", "https://discord.gg/UZCgWRYvVE") end) - DiscordInteractive:SetCallback("OnEnter", - function() - DiscordInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:21:21|t |cFFFFFFFFDiscord|r") - end) - DiscordInteractive:SetCallback("OnLeave", - function() - DiscordInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:21:21|t |cFF8080FFDiscord|r") - end) + DiscordInteractive:SetCallback("OnClick", function() UUF:OpenURL("Support Me on Discord", "https://discord.gg/UZCgWRYvVE") end) + DiscordInteractive:SetCallback("OnEnter", function() DiscordInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:21:21|t |cFFFFFFFFDiscord|r") end) + DiscordInteractive:SetCallback("OnLeave", function() DiscordInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Discord.png:21:21|t |cFF8080FFDiscord|r") end) SupportMeContainer:AddChild(DiscordInteractive) - local PatreonInteractive = AG:Create("InteractiveLabel") - PatreonInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:21:21|t |cFF8080FFPatreon|r") - PatreonInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") - PatreonInteractive:SetJustifyV("MIDDLE") - PatreonInteractive:SetRelativeWidth(0.33) - PatreonInteractive:SetCallback("OnClick", - function() UUF:OpenURL("Support Me on Patreon", "https://www.patreon.com/unhalted") end) - PatreonInteractive:SetCallback("OnEnter", - function() - PatreonInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:21:21|t |cFFFFFFFFPatreon|r") - end) - PatreonInteractive:SetCallback("OnLeave", - function() - PatreonInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:21:21|t |cFF8080FFPatreon|r") - end) - SupportMeContainer:AddChild(PatreonInteractive) + -- local PatreonInteractive = AG:Create("InteractiveLabel") + -- PatreonInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:21:21|t |cFF8080FFPatreon|r") + -- PatreonInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") + -- PatreonInteractive:SetJustifyV("MIDDLE") + -- PatreonInteractive:SetRelativeWidth(0.33) + -- PatreonInteractive:SetCallback("OnClick", function() UUF:OpenURL("Support Me on Patreon", "https://www.patreon.com/unhalted") end) + -- PatreonInteractive:SetCallback("OnEnter", function() PatreonInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:21:21|t |cFFFFFFFFPatreon|r") end) + -- PatreonInteractive:SetCallback("OnLeave", function() PatreonInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Patreon.png:21:21|t |cFF8080FFPatreon|r") end) + -- SupportMeContainer:AddChild(PatreonInteractive) local GithubInteractive = AG:Create("InteractiveLabel") - GithubInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Github.png:21:21|t |cFF8080FFGithub|r") + GithubInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Github.png:21:21|t |cFF8080FFGithub|r") GithubInteractive:SetFont("Fonts\\FRIZQT__.TTF", 13, "OUTLINE") GithubInteractive:SetJustifyV("MIDDLE") GithubInteractive:SetRelativeWidth(0.33) - GithubInteractive:SetCallback("OnClick", - function() UUF:OpenURL("Support Me on Github", "https://github.com/dalehuntgb/UnhaltedUnitFrames") end) - GithubInteractive:SetCallback("OnEnter", - function() - GithubInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Github.png:21:21|t |cFFFFFFFFGithub|r") - end) - GithubInteractive:SetCallback("OnLeave", - function() - GithubInteractive:SetText( - "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Github.png:21:21|t |cFF8080FFGithub|r") - end) + GithubInteractive:SetCallback("OnClick", function() UUF:OpenURL("Support Me on Github", "https://github.com/dalehuntgb/UnhaltedUnitFrames") end) + GithubInteractive:SetCallback("OnEnter", function() GithubInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Github.png:21:21|t |cFFFFFFFFGithub|r") end) + GithubInteractive:SetCallback("OnLeave", function() GithubInteractive:SetText("|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Support\\Github.png:21:21|t |cFF8080FFGithub|r") end) SupportMeContainer:AddChild(GithubInteractive) ScrollFrame:DoLayout() @@ -4084,17 +2844,17 @@ function UUF:CreateGUI() ContainerTabGroup:SetLayout("Flow") ContainerTabGroup:SetFullWidth(true) ContainerTabGroup:SetTabs({ - { text = "General", value = "General" }, - { text = "Global", value = "Global" }, - { text = "Player", value = "Player" }, - { text = "Target", value = "Target" }, - { text = "Target of Target", value = "TargetTarget" }, - { text = "Pet", value = "Pet" }, - { text = "Focus", value = "Focus" }, - { text = "Focus Target", value = "FocusTarget" }, - { text = "Boss", value = "Boss" }, - { text = "Tags", value = "Tags" }, - { text = "Profiles", value = "Profiles" }, + { text = "General", value = "General"}, + { text = "Global", value = "Global"}, + { text = "Player", value = "Player"}, + { text = "Target", value = "Target"}, + { text = "Target of Target", value = "TargetTarget"}, + { text = "Pet", value = "Pet"}, + { text = "Focus", value = "Focus"}, + { text = "Focus Target", value = "FocusTarget"}, + { text = "Boss", value = "Boss"}, + { text = "Tags", value = "Tags"}, + { text = "Profiles", value = "Profiles"}, }) ContainerTabGroup:SetCallback("OnGroupSelected", SelectTab) ContainerTabGroup:SelectTab("General") @@ -4109,4 +2869,4 @@ function UUFG:CloseUUFGUI() if isGUIOpen and Container then Container:Hide() end -end +end \ No newline at end of file diff --git a/Core/Core.lua b/Core/Core.lua index c4464a9..60cd21e 100755 --- a/Core/Core.lua +++ b/Core/Core.lua @@ -19,13 +19,7 @@ function UnhaltedUnitFrames:OnInitialize() local playerSpecalizationChangedEventFrame = CreateFrame("Frame") playerSpecalizationChangedEventFrame:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED") - playerSpecalizationChangedEventFrame:SetScript("OnEvent", - function(_, event, ...) - if event == "PLAYER_SPECIALIZATION_CHANGED" then - local unit = ... - if unit == "player" then UUF:UpdateAllUnitFrames() end - end - end) + playerSpecalizationChangedEventFrame:SetScript("OnEvent", function(_, event, ...) if event == "PLAYER_SPECIALIZATION_CHANGED" then local unit = ... if unit == "player" then UUF:UpdateAllUnitFrames() end end end) -- Combat fade event handler UUF.CombatFadeEventFrame = CreateFrame("Frame") @@ -49,4 +43,4 @@ function UnhaltedUnitFrames:OnEnable() UUF:SpawnUnitFrame("boss") -- Initial fade setup UUF:UpdateOutOfCombatFade() -end +end \ No newline at end of file diff --git a/Core/Defaults.lua b/Core/Defaults.lua index afcb3d7..b4e38e9 100755 --- a/Core/Defaults.lua +++ b/Core/Defaults.lua @@ -34,33 +34,33 @@ local Defaults = { FontFlag = "OUTLINE", Shadow = { Enabled = false, - Colour = { 0, 0, 0, 1 }, + Colour = {0, 0, 0, 1}, XPos = 1, YPos = -1, } }, Colours = { Reaction = { - [1] = { 204 / 255, 64 / 255, 64 / 255 }, -- Hated - [2] = { 204 / 255, 64 / 255, 64 / 255 }, -- Hostile - [3] = { 204 / 255, 128 / 255, 64 / 255 }, -- Unfriendly - [4] = { 204 / 255, 204 / 255, 64 / 255 }, -- Neutral - [5] = { 64 / 255, 204 / 255, 64 / 255 }, -- Friendly - [6] = { 64 / 255, 204 / 255, 64 / 255 }, -- Honored - [7] = { 64 / 255, 204 / 255, 64 / 255 }, -- Revered - [8] = { 64 / 255, 204 / 255, 64 / 255 }, -- Exalted + [1] = {204/255, 64/255, 64/255}, -- Hated + [2] = {204/255, 64/255, 64/255}, -- Hostile + [3] = {204/255, 128/255, 64/255}, -- Unfriendly + [4] = {204/255, 204/255, 64/255}, -- Neutral + [5] = {64/255, 204/255, 64/255}, -- Friendly + [6] = {64/255, 204/255, 64/255}, -- Honored + [7] = {64/255, 204/255, 64/255}, -- Revered + [8] = {64/255, 204/255, 64/255}, -- Exalted }, Power = { - [0] = { 0, 0, 1 }, -- Mana - [1] = { 1, 0, 0 }, -- Rage - [2] = { 1, 0.5, 0.25 }, -- Focus - [3] = { 1, 1, 0 }, -- Energy - [6] = { 0, 0.82, 1 }, -- Runic Power - [8] = { 0.75, 0.52, 0.9 }, -- Astral Power - [11] = { 0, 0.5, 1 }, -- Maelstrom - [13] = { 0.4, 0, 0.8 }, -- Insanity - [17] = { 0.79, 0.26, 0.99 }, -- Fury - [18] = { 1, 0.61, 0 } -- Pain + [0] = {0, 0, 1}, -- Mana + [1] = {1, 0, 0}, -- Rage + [2] = {1, 0.5, 0.25}, -- Focus + [3] = {1, 1, 0}, -- Energy + [6] = {0, 0.82, 1}, -- Runic Power + [8] = {0.75, 0.52, 0.9}, -- Astral Power + [11] = {0, 0.5, 1}, -- Maelstrom + [13] = {0.4, 0, 0.8}, -- Insanity + [17] = {0.79, 0.26, 0.99}, -- Fury + [18] = {1, 0.61, 0} -- Pain }, } }, @@ -71,7 +71,7 @@ local Defaults = { Frame = { Width = 244, Height = 42, - Layout = { "CENTER", "CENTER", -425.1, -275.1 }, + Layout = {"CENTER", "CENTER", -425.1, -275.1}, FrameStrata = "LOW", OutOfCombatFade = { Enabled = false, @@ -86,30 +86,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Foreground = {8/255, 8/255, 8/255}, ForegroundOpacity = 0.8, - Background = { 34 / 255, 34 / 255, 34 / 255 }, + Background = {34/255, 34/255, 34/255}, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, + Colour = {255/255, 204/255, 0/255, 1.0}, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, + Colour = {128/255, 64/255, 255/255, 1.0}, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, - Background = { 128 / 255, 128 / 255, 128 / 255 }, + Foreground = {8/255, 8/255, 8/255}, + Background = {128/255, 128/255, 128/255}, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -121,20 +121,20 @@ local Defaults = { Enabled = true, Height = 5, Width = 100, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, - Background = { 34 / 255, 34 / 255, 34 / 255 }, + Foreground = {8/255, 8/255, 8/255}, + Background = {34/255, 34/255, 34/255}, ColourByType = true, Inverse = false, - Layout = { "LEFT", "BOTTOMLEFT", 3, 1 }, + Layout = {"LEFT", "BOTTOMLEFT", 3, 1}, }, CastBar = { Enabled = true, Width = 244, Height = 24, - Layout = { "TOPLEFT", "BOTTOMLEFT", 0, -1 }, - Foreground = { 128 / 255, 128 / 255, 255 / 255 }, - Background = { 34 / 255, 34 / 255, 34 / 255 }, - NotInterruptibleColour = { 255 / 255, 64 / 255, 64 / 255 }, + Layout = {"TOPLEFT", "BOTTOMLEFT", 0, -1}, + Foreground = {128/255, 128/255, 255/255}, + Background = {34/255, 34/255, 34/255}, + NotInterruptibleColour = {255/255, 64/255, 64/255}, MatchParentWidth = true, ColourByClass = false, Inverse = false, @@ -147,15 +147,15 @@ local Defaults = { SpellName = { Enabled = true, FontSize = 12, - Layout = { "LEFT", "LEFT", 3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"LEFT", "LEFT", 3, 0}, + Colour = {1, 1, 1}, MaxChars = 15, }, Duration = { Enabled = true, FontSize = 12, - Layout = { "RIGHT", "RIGHT", -3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"RIGHT", "RIGHT", -3, 0}, + Colour = {1, 1, 1}, } } }, @@ -163,7 +163,7 @@ local Defaults = { Enabled = false, Width = 42, Height = 42, - Layout = { "RIGHT", "LEFT", -1, 0 }, + Layout = {"RIGHT", "LEFT", -1, 0}, Zoom = 0.3, UseClassPortrait = false, }, @@ -171,28 +171,28 @@ local Defaults = { RaidTargetMarker = { Enabled = true, Size = 24, - Layout = { "CENTER", "TOP", 0, 0 }, + Layout = {"CENTER", "TOP", 0, 0}, }, LeaderAssistantIndicator = { Enabled = true, Size = 16, - Layout = { "TOPLEFT", "TOPLEFT", 3, -3 }, + Layout = {"TOPLEFT", "TOPLEFT", 3, -3}, }, Resting = { Enabled = true, Size = 16, - Layout = { "LEFT", "TOPLEFT", 3, 0 }, + Layout = {"LEFT", "TOPLEFT", 3, 0}, Texture = "RESTING0" }, Combat = { Enabled = true, Size = 16, - Layout = { "CENTER", "TOP", 0, 0 }, + Layout = {"CENTER", "TOP", 0, 0}, Texture = "COMBAT0" }, Mouseover = { Enabled = true, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, HighlightOpacity = 0.75, Style = "GRADIENT" }, @@ -200,71 +200,71 @@ local Defaults = { Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = { "CENTER", "CENTER", 0, 0 }, + Layout = {"CENTER", "CENTER", 0, 0}, FontSize = 12, ScaleByIconSize = false, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, }, Buffs = { Enabled = true, OnlyShowPlayer = false, Size = 34, - Layout = { "BOTTOMRIGHT", "TOPRIGHT", 0, 1, 1 }, + Layout = {"BOTTOMRIGHT", "TOPRIGHT", 0, 1, 1}, Num = 4, Wrap = 4, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, Debuffs = { Enabled = true, OnlyShowPlayer = false, Size = 34, - Layout = { "BOTTOMLEFT", "TOPLEFT", 0, 1, 1 }, + Layout = {"BOTTOMLEFT", "TOPLEFT", 0, 1, 1}, Num = 3, Wrap = 3, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, }, Tags = { TagOne = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagTwo = { FontSize = 12, - Layout = { "RIGHT", "RIGHT", -3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"RIGHT", "RIGHT", -3, 0}, + Colour = {1, 1, 1}, Tag = "[curhp:abbr]", }, TagThree = { FontSize = 12, - Layout = { "RIGHT", "BOTTOMRIGHT", -3, 2 }, - Colour = { 1, 1, 1 }, + Layout = {"RIGHT", "BOTTOMRIGHT", -3, 2}, + Colour = {1, 1, 1}, Tag = "[powercolor][curpp]", }, TagFour = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagFive = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, } @@ -275,7 +275,7 @@ local Defaults = { Frame = { Width = 244, Height = 42, - Layout = { "CENTER", "CENTER", 425.1, -275.1 }, + Layout = {"CENTER", "CENTER", 425.1, -275.1}, FrameStrata = "LOW", OutOfCombatFade = { Enabled = false, @@ -290,30 +290,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Foreground = {8/255, 8/255, 8/255}, ForegroundOpacity = 0.8, - Background = { 34 / 255, 34 / 255, 34 / 255 }, + Background = {34/255, 34/255, 34/255}, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, + Colour = {255/255, 204/255, 0/255, 1.0}, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, + Colour = {128/255, 64/255, 255/255, 1.0}, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, - Background = { 128 / 255, 128 / 255, 128 / 255 }, + Foreground = {8/255, 8/255, 8/255}, + Background = {128/255, 128/255, 128/255}, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -325,10 +325,10 @@ local Defaults = { Enabled = true, Width = 244, Height = 24, - Layout = { "TOPLEFT", "BOTTOMLEFT", 0, -1 }, - Foreground = { 128 / 255, 128 / 255, 255 / 255 }, - Background = { 34 / 255, 34 / 255, 34 / 255 }, - NotInterruptibleColour = { 255 / 255, 64 / 255, 64 / 255 }, + Layout = {"TOPLEFT", "BOTTOMLEFT", 0, -1}, + Foreground = {128/255, 128/255, 255/255}, + Background = {34/255, 34/255, 34/255}, + NotInterruptibleColour = {255/255, 64/255, 64/255}, MatchParentWidth = true, ColourByClass = false, Inverse = false, @@ -341,15 +341,15 @@ local Defaults = { SpellName = { Enabled = true, FontSize = 12, - Layout = { "LEFT", "LEFT", 3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"LEFT", "LEFT", 3, 0}, + Colour = {1, 1, 1}, MaxChars = 15, }, Duration = { Enabled = true, FontSize = 12, - Layout = { "RIGHT", "RIGHT", -3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"RIGHT", "RIGHT", -3, 0}, + Colour = {1, 1, 1}, } } }, @@ -357,7 +357,7 @@ local Defaults = { Enabled = false, Width = 42, Height = 42, - Layout = { "LEFT", "RIGHT", 1, 0 }, + Layout = {"LEFT", "RIGHT", 1, 0}, Zoom = 0.3, UseClassPortrait = false, }, @@ -365,28 +365,28 @@ local Defaults = { RaidTargetMarker = { Enabled = true, Size = 24, - Layout = { "CENTER", "TOP", 0, 0 }, + Layout = {"CENTER", "TOP", 0, 0}, }, LeaderAssistantIndicator = { Enabled = true, Size = 16, - Layout = { "TOPRIGHT", "TOPRIGHT", -3, -3 }, + Layout = {"TOPRIGHT", "TOPRIGHT", -3, -3}, }, Combat = { Enabled = true, Size = 16, - Layout = { "CENTER", "TOP", 0, 0 }, + Layout = {"CENTER", "TOP", 0, 0}, Texture = "COMBAT0" }, Mouseover = { Enabled = true, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, HighlightOpacity = 0.75, Style = "GRADIENT" }, Target = { Enabled = false, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, } }, Range = { @@ -397,71 +397,71 @@ local Defaults = { Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = { "CENTER", "CENTER", 0, 0 }, + Layout = {"CENTER", "CENTER", 0, 0}, FontSize = 12, ScaleByIconSize = false, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, }, Buffs = { Enabled = true, OnlyShowPlayer = false, Size = 34, - Layout = { "BOTTOMLEFT", "TOPLEFT", 0, 1, 1 }, + Layout = {"BOTTOMLEFT", "TOPLEFT", 0, 1, 1}, Num = 3, Wrap = 3, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, Debuffs = { Enabled = true, OnlyShowPlayer = false, Size = 34, - Layout = { "BOTTOMRIGHT", "TOPRIGHT", 0, 1, 1 }, + Layout = {"BOTTOMRIGHT", "TOPRIGHT", 0, 1, 1}, Num = 4, Wrap = 4, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, }, Tags = { TagOne = { FontSize = 12, - Layout = { "LEFT", "LEFT", 3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"LEFT", "LEFT", 3, 0}, + Colour = {1, 1, 1}, Tag = "[name]", }, TagTwo = { FontSize = 12, - Layout = { "RIGHT", "RIGHT", -3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"RIGHT", "RIGHT", -3, 0}, + Colour = {1, 1, 1}, Tag = "[curhp:abbr]", }, TagThree = { FontSize = 12, - Layout = { "RIGHT", "BOTTOMRIGHT", -3, 2 }, - Colour = { 1, 1, 1 }, + Layout = {"RIGHT", "BOTTOMRIGHT", -3, 2}, + Colour = {1, 1, 1}, Tag = "[powercolor][curpp]", }, TagFour = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagFive = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, } @@ -473,7 +473,7 @@ local Defaults = { Width = 122, Height = 22, AnchorParent = "UUF_Target", - Layout = { "TOPRIGHT", "BOTTOMRIGHT", 0, -26.1 }, + Layout = {"TOPRIGHT", "BOTTOMRIGHT", 0, -26.1}, FrameStrata = "LOW", OutOfCombatFade = { Enabled = false, @@ -488,30 +488,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Foreground = {8/255, 8/255, 8/255}, ForegroundOpacity = 0.8, - Background = { 34 / 255, 34 / 255, 34 / 255 }, + Background = {34/255, 34/255, 34/255}, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, + Colour = {255/255, 204/255, 0/255, 1.0}, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, + Colour = {128/255, 64/255, 255/255, 1.0}, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, - Background = { 128 / 255, 128 / 255, 128 / 255 }, + Foreground = {8/255, 8/255, 8/255}, + Background = {128/255, 128/255, 128/255}, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -554,7 +554,7 @@ local Defaults = { Enabled = false, Width = 22, Height = 22, - Layout = { "RIGHT", "LEFT", -1, 0 }, + Layout = {"RIGHT", "LEFT", -1, 0}, Zoom = 0.3, UseClassPortrait = false, }, @@ -562,87 +562,87 @@ local Defaults = { RaidTargetMarker = { Enabled = true, Size = 16, - Layout = { "LEFT", "TOPLEFT", 3, 0 }, + Layout = {"LEFT", "TOPLEFT", 3, 0}, }, Mouseover = { Enabled = true, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, HighlightOpacity = 0.75, Style = "GRADIENT" }, Target = { Enabled = false, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, } }, Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = { "CENTER", "CENTER", 0, 0 }, + Layout = {"CENTER", "CENTER", 0, 0}, FontSize = 12, ScaleByIconSize = false, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, }, Buffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = { "RIGHT", "LEFT", -1, 0, 1 }, + Layout = {"RIGHT", "LEFT", -1, 0, 1}, Num = 3, Wrap = 3, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, Debuffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = { "LEFT", "RIGHT", 1, 0, 1 }, + Layout = {"LEFT", "RIGHT", 1, 0, 1}, Num = 3, Wrap = 3, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, }, Tags = { TagOne = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "[name]", }, TagTwo = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER",0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagThree = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER",0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagFour = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagFive = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, } @@ -654,7 +654,7 @@ local Defaults = { Width = 122, Height = 22, AnchorParent = "UUF_Player", - Layout = { "BOTTOMLEFT", "TOPLEFT", 0, 36.1 }, + Layout = {"BOTTOMLEFT", "TOPLEFT", 0, 36.1}, FrameStrata = "LOW", OutOfCombatFade = { Enabled = false, @@ -669,30 +669,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Foreground = {8/255, 8/255, 8/255}, ForegroundOpacity = 0.8, - Background = { 34 / 255, 34 / 255, 34 / 255 }, + Background = {34/255, 34/255, 34/255}, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, + Colour = {255/255, 204/255, 0/255, 1.0}, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, + Colour = {128/255, 64/255, 255/255, 1.0}, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, - Background = { 128 / 255, 128 / 255, 128 / 255 }, + Foreground = {8/255, 8/255, 8/255}, + Background = {128/255, 128/255, 128/255}, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -704,10 +704,10 @@ local Defaults = { Enabled = true, Width = 244, Height = 24, - Layout = { "BOTTOMLEFT", "TOPLEFT", 0, 1 }, - Foreground = { 128 / 255, 128 / 255, 255 / 255 }, - Background = { 34 / 255, 34 / 255, 34 / 255 }, - NotInterruptibleColour = { 255 / 255, 64 / 255, 64 / 255 }, + Layout = {"BOTTOMLEFT", "TOPLEFT", 0, 1}, + Foreground = {128/255, 128/255, 255/255}, + Background = {34/255, 34/255, 34/255}, + NotInterruptibleColour = {255/255, 64/255, 64/255}, MatchParentWidth = true, ColourByClass = false, Inverse = false, @@ -720,15 +720,15 @@ local Defaults = { SpellName = { Enabled = true, FontSize = 12, - Layout = { "LEFT", "LEFT", 3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"LEFT", "LEFT", 3, 0}, + Colour = {1, 1, 1}, MaxChars = 15, }, Duration = { Enabled = true, FontSize = 12, - Layout = { "RIGHT", "RIGHT", -3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"RIGHT", "RIGHT", -3, 0}, + Colour = {1, 1, 1}, } } }, @@ -736,7 +736,7 @@ local Defaults = { Enabled = false, Width = 22, Height = 22, - Layout = { "LEFT", "RIGHT", 1, 0 }, + Layout = {"LEFT", "RIGHT", 1, 0}, Zoom = 0.3, UseClassPortrait = false, }, @@ -744,87 +744,87 @@ local Defaults = { RaidTargetMarker = { Enabled = true, Size = 16, - Layout = { "RIGHT", "TOPRIGHT", -3, 0 }, + Layout = {"RIGHT", "TOPRIGHT", -3, 0}, }, Mouseover = { Enabled = true, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, HighlightOpacity = 0.75, Style = "GRADIENT" }, Target = { Enabled = false, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, } }, Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = { "CENTER", "CENTER", 0, 0 }, + Layout = {"CENTER", "CENTER", 0, 0}, FontSize = 12, ScaleByIconSize = false, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, }, Buffs = { Enabled = true, OnlyShowPlayer = false, Size = 22, - Layout = { "RIGHT", "LEFT", -1, 0, 1 }, + Layout = {"RIGHT", "LEFT", -1, 0, 1}, Num = 1, Wrap = 1, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, Debuffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = { "LEFT", "RIGHT", 1, 0, 1 }, + Layout = {"LEFT", "RIGHT", 1, 0, 1}, Num = 3, Wrap = 3, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, }, Tags = { TagOne = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "[name]", }, TagTwo = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER",0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagThree = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER",0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagFour = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagFive = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, } @@ -836,7 +836,7 @@ local Defaults = { Width = 122, Height = 22, AnchorParent = "UUF_Focus", - Layout = { "LEFT", "RIGHT", 1, 0 }, + Layout = {"LEFT", "RIGHT", 1, 0}, FrameStrata = "LOW", OutOfCombatFade = { Enabled = false, @@ -851,30 +851,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Foreground = {8/255, 8/255, 8/255}, ForegroundOpacity = 0.8, - Background = { 34 / 255, 34 / 255, 34 / 255 }, + Background = {34/255, 34/255, 34/255}, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, + Colour = {255/255, 204/255, 0/255, 1.0}, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, + Colour = {128/255, 64/255, 255/255, 1.0}, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, - Background = { 128 / 255, 128 / 255, 128 / 255 }, + Foreground = {8/255, 8/255, 8/255}, + Background = {128/255, 128/255, 128/255}, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -917,7 +917,7 @@ local Defaults = { Enabled = false, Width = 22, Height = 22, - Layout = { "RIGHT", "LEFT", -1, 0 }, + Layout = {"RIGHT", "LEFT", -1, 0}, Zoom = 0.3, UseClassPortrait = false, }, @@ -925,87 +925,87 @@ local Defaults = { RaidTargetMarker = { Enabled = true, Size = 16, - Layout = { "LEFT", "TOPLEFT", 3, 0 }, + Layout = {"LEFT", "TOPLEFT", 3, 0}, }, Mouseover = { Enabled = true, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, HighlightOpacity = 0.75, Style = "GRADIENT" }, Target = { Enabled = false, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, } }, Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = { "CENTER", "CENTER", 0, 0 }, + Layout = {"CENTER", "CENTER", 0, 0}, FontSize = 12, ScaleByIconSize = false, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, }, Buffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = { "RIGHT", "LEFT", -1, 0, 1 }, + Layout = {"RIGHT", "LEFT", -1, 0, 1}, Num = 3, Wrap = 3, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, Debuffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = { "LEFT", "RIGHT", 1, 0, 1 }, + Layout = {"LEFT", "RIGHT", 1, 0, 1}, Num = 3, Wrap = 3, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, }, Tags = { TagOne = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "[name]", }, TagTwo = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER",0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagThree = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER",0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagFour = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagFive = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, } @@ -1017,7 +1017,7 @@ local Defaults = { Width = 122, Height = 22, AnchorParent = "UUF_Player", - Layout = { "TOPLEFT", "BOTTOMLEFT", 0, -26.1 }, + Layout = {"TOPLEFT", "BOTTOMLEFT", 0, -26.1}, FrameStrata = "LOW", OutOfCombatFade = { Enabled = false, @@ -1032,30 +1032,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Foreground = {8/255, 8/255, 8/255}, ForegroundOpacity = 0.8, - Background = { 34 / 255, 34 / 255, 34 / 255 }, + Background = {34/255, 34/255, 34/255}, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, + Colour = {255/255, 204/255, 0/255, 1.0}, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, + Colour = {128/255, 64/255, 255/255, 1.0}, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, - Background = { 128 / 255, 128 / 255, 128 / 255 }, + Foreground = {8/255, 8/255, 8/255}, + Background = {128/255, 128/255, 128/255}, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -1067,10 +1067,10 @@ local Defaults = { Enabled = false, Width = 244, Height = 24, - Layout = { "TOPLEFT", "BOTTOMLEFT", 0, -1 }, - Foreground = { 128 / 255, 128 / 255, 255 / 255 }, - Background = { 34 / 255, 34 / 255, 34 / 255 }, - NotInterruptibleColour = { 255 / 255, 64 / 255, 64 / 255 }, + Layout = {"TOPLEFT", "BOTTOMLEFT", 0, -1}, + Foreground = {128/255, 128/255, 255/255}, + Background = {34/255, 34/255, 34/255}, + NotInterruptibleColour = {255/255, 64/255, 64/255}, MatchParentWidth = true, ColourByClass = false, Inverse = false, @@ -1083,15 +1083,15 @@ local Defaults = { SpellName = { Enabled = true, FontSize = 12, - Layout = { "LEFT", "LEFT", 3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"LEFT", "LEFT", 3, 0}, + Colour = {1, 1, 1}, MaxChars = 15, }, Duration = { Enabled = true, FontSize = 12, - Layout = { "RIGHT", "RIGHT", -3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"RIGHT", "RIGHT", -3, 0}, + Colour = {1, 1, 1}, } } }, @@ -1099,7 +1099,7 @@ local Defaults = { Enabled = false, Width = 22, Height = 22, - Layout = { "LEFT", "RIGHT", 1, 0 }, + Layout = {"LEFT", "RIGHT", 1, 0}, Zoom = 0.3, UseClassPortrait = false, }, @@ -1107,87 +1107,87 @@ local Defaults = { RaidTargetMarker = { Enabled = false, Size = 16, - Layout = { "LEFT", "TOPLEFT", 3, 0 }, + Layout = {"LEFT", "TOPLEFT", 3, 0}, }, Mouseover = { Enabled = true, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, HighlightOpacity = 0.75, Style = "GRADIENT" }, Target = { Enabled = false, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, } }, Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = { "CENTER", "CENTER", 0, 0 }, + Layout = {"CENTER", "CENTER", 0, 0}, FontSize = 12, ScaleByIconSize = false, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, }, Buffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = { "LEFT", "RIGHT", 1, 0, 1 }, + Layout = {"LEFT", "RIGHT", 1, 0, 1}, Num = 1, Wrap = 1, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, Debuffs = { Enabled = false, OnlyShowPlayer = false, Size = 22, - Layout = { "RIGHT", "LEFT", -1, 0, 1 }, + Layout = {"RIGHT", "LEFT", -1, 0, 1}, Num = 3, Wrap = 3, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, }, Tags = { TagOne = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "[name]", }, TagTwo = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER",0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagThree = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER",0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagFour = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagFive = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, } @@ -1198,7 +1198,7 @@ local Defaults = { Frame = { Width = 244, Height = 42, - Layout = { "CENTER", "CENTER", 550.1, -0.1, 26 }, + Layout = {"CENTER", "CENTER", 550.1, -0.1, 26}, GrowthDirection = "DOWN", FrameStrata = "LOW", OutOfCombatFade = { @@ -1214,30 +1214,30 @@ local Defaults = { ColourWhenTapped = true, AnchorToCooldownViewer = false, Inverse = false, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, + Foreground = {8/255, 8/255, 8/255}, ForegroundOpacity = 0.8, - Background = { 34 / 255, 34 / 255, 34 / 255 }, + Background = {34/255, 34/255, 34/255}, BackgroundOpacity = 1.0, }, HealPrediction = { Absorbs = { Enabled = true, UseStripedTexture = true, - Colour = { 255 / 255, 204 / 255, 0 / 255, 1.0 }, + Colour = {255/255, 204/255, 0/255, 1.0}, Position = "LEFT", }, HealAbsorbs = { Enabled = true, UseStripedTexture = false, - Colour = { 128 / 255, 64 / 255, 255 / 255, 1.0 }, + Colour = {128/255, 64/255, 255/255, 1.0}, Position = "RIGHT", }, }, PowerBar = { Enabled = false, Height = 3, - Foreground = { 8 / 255, 8 / 255, 8 / 255 }, - Background = { 128 / 255, 128 / 255, 128 / 255 }, + Foreground = {8/255, 8/255, 8/255}, + Background = {128/255, 128/255, 128/255}, ColourByType = true, ColourBackgroundByType = false, ColourByClass = false, @@ -1249,10 +1249,10 @@ local Defaults = { Enabled = true, Width = 244, Height = 24, - Layout = { "TOPLEFT", "BOTTOMLEFT", 0, -1 }, - Foreground = { 128 / 255, 128 / 255, 255 / 255 }, - Background = { 34 / 255, 34 / 255, 34 / 255 }, - NotInterruptibleColour = { 255 / 255, 64 / 255, 64 / 255 }, + Layout = {"TOPLEFT", "BOTTOMLEFT", 0, -1}, + Foreground = {128/255, 128/255, 255/255}, + Background = {34/255, 34/255, 34/255}, + NotInterruptibleColour = {255/255, 64/255, 64/255}, MatchParentWidth = true, ColourByClass = false, Inverse = false, @@ -1265,15 +1265,15 @@ local Defaults = { SpellName = { Enabled = true, FontSize = 12, - Layout = { "LEFT", "LEFT", 3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"LEFT", "LEFT", 3, 0}, + Colour = {1, 1, 1}, MaxChars = 15, }, Duration = { Enabled = true, FontSize = 12, - Layout = { "RIGHT", "RIGHT", -3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"RIGHT", "RIGHT", -3, 0}, + Colour = {1, 1, 1}, } } }, @@ -1281,7 +1281,7 @@ local Defaults = { Enabled = true, Width = 42, Height = 42, - Layout = { "RIGHT", "LEFT", -1, 0 }, + Layout = {"RIGHT", "LEFT", -1, 0}, Zoom = 0.3, UseClassPortrait = false, }, @@ -1289,87 +1289,87 @@ local Defaults = { RaidTargetMarker = { Enabled = true, Size = 24, - Layout = { "CENTER", "TOP", 0, 0 }, + Layout = {"CENTER", "TOP", 0, 0}, }, Mouseover = { Enabled = true, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, HighlightOpacity = 0.75, Style = "GRADIENT" }, Target = { Enabled = true, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, } }, Auras = { FrameStrata = "LOW", AuraDuration = { - Layout = { "CENTER", "CENTER", 0, 0 }, + Layout = {"CENTER", "CENTER", 0, 0}, FontSize = 12, ScaleByIconSize = false, - Colour = { 1, 1, 1 }, + Colour = {1, 1, 1}, }, Buffs = { Enabled = true, OnlyShowPlayer = false, Size = 42, - Layout = { "LEFT", "RIGHT", 1, 0, 1 }, + Layout = {"LEFT", "RIGHT", 1, 0, 1}, Num = 3, Wrap = 3, GrowthDirection = "RIGHT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, Debuffs = { Enabled = false, OnlyShowPlayer = false, Size = 34, - Layout = { "BOTTOMRIGHT", "TOPRIGHT", 0, 1, 1 }, + Layout = {"BOTTOMRIGHT", "TOPRIGHT", 0, 1, 1}, Num = 4, Wrap = 4, GrowthDirection = "LEFT", WrapDirection = "UP", Count = { - Layout = { "BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2 }, + Layout = {"BOTTOMRIGHT", "BOTTOMRIGHT", 0, 2}, FontSize = 12, - Colour = { 1, 1, 1, 1 } + Colour = {1, 1, 1, 1} } }, }, Tags = { TagOne = { FontSize = 12, - Layout = { "LEFT", "LEFT", 3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"LEFT", "LEFT", 3, 0}, + Colour = {1, 1, 1}, Tag = "[name]", }, TagTwo = { FontSize = 12, - Layout = { "RIGHT", "RIGHT", -3, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"RIGHT", "RIGHT", -3, 0}, + Colour = {1, 1, 1}, Tag = "[curhp:abbr]", }, TagThree = { FontSize = 12, - Layout = { "RIGHT", "BOTTOMRIGHT", -3, 2 }, - Colour = { 1, 1, 1 }, + Layout = {"RIGHT", "BOTTOMRIGHT", -3, 2}, + Colour = {1, 1, 1}, Tag = "[powercolor][curpp]", }, TagFour = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, TagFive = { FontSize = 12, - Layout = { "CENTER", "CENTER", 0, 0 }, - Colour = { 1, 1, 1 }, + Layout = {"CENTER", "CENTER", 0, 0}, + Colour = {1, 1, 1}, Tag = "", }, } @@ -1379,4 +1379,4 @@ local Defaults = { } ---@return table Defaults Returns the Default Table. -function UUF:GetDefaultDB() return Defaults end +function UUF:GetDefaultDB() return Defaults end \ No newline at end of file diff --git a/Core/Globals.lua b/Core/Globals.lua index 7c386a5..2ce7ef8 100755 --- a/Core/Globals.lua +++ b/Core/Globals.lua @@ -10,7 +10,7 @@ UUF.MAX_BOSS_FRAMES = 10 UUF.LSM = LibStub("LibSharedMedia-3.0") UUF.LDS = LibStub("LibDualSpec-1.0") UUF.AG = LibStub("AceGUI-3.0") -UUF.BACKDROP = { bgFile = "Interface\\Buttons\\WHITE8X8", edgeFile = "Interface\\Buttons\\WHITE8X8", edgeSize = 1, insets = { left = 0, right = 0, top = 0, bottom = 0 } } +UUF.BACKDROP = { bgFile = "Interface\\Buttons\\WHITE8X8", edgeFile = "Interface\\Buttons\\WHITE8X8", edgeSize = 1, insets = {left = 0, right = 0, top = 0, bottom = 0} } UUF.INFOBUTTON = "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\InfoButton.png:16:16|t " UUF.ADDON_NAME = C_AddOns.GetAddOnMetadata("UnhaltedUnitFrames", "Title") UUF.ADDON_VERSION = C_AddOns.GetAddOnMetadata("UnhaltedUnitFrames", "Version") @@ -18,24 +18,20 @@ UUF.ADDON_AUTHOR = C_AddOns.GetAddOnMetadata("UnhaltedUnitFrames", "Author") UUF.ADDON_LOGO = "|TInterface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\Logo:11:12|t" UUF.PRETTY_ADDON_NAME = UUF.ADDON_LOGO .. " " .. UUF.ADDON_NAME -UUF.LSM:Register("statusbar", "Better Blizzard", - "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\BetterBlizzard.blp") +UUF.LSM:Register("statusbar", "Better Blizzard", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\BetterBlizzard.blp") UUF.LSM:Register("statusbar", "Dragonflight", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\Dragonflight.tga") UUF.LSM:Register("statusbar", "Skyline", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\Skyline.tga") UUF.LSM:Register("statusbar", "Stripes", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\Stripes.png") UUF.LSM:Register("statusbar", "Thin Stripes", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\ThinStripes.png") -UUF.LSM:Register("background", "Dragonflight", - "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\Backgrounds\\Dragonflight_BG.tga") +UUF.LSM:Register("background", "Dragonflight", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Textures\\Backgrounds\\Dragonflight_BG.tga") UUF.LSM:Register("font", "Expressway", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\Expressway.ttf") UUF.LSM:Register("font", "Avante", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\Avante.ttf") UUF.LSM:Register("font", "Avantgarde (Book)", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\AvantGarde\\Book.ttf") -UUF.LSM:Register("font", "Avantgarde (Book Oblique)", - "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\AvantGarde\\BookOblique.ttf") +UUF.LSM:Register("font", "Avantgarde (Book Oblique)", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\AvantGarde\\BookOblique.ttf") UUF.LSM:Register("font", "Avantgarde (Demi)", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\AvantGarde\\Demi.ttf") -UUF.LSM:Register("font", "Avantgarde (Regular)", - "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\AvantGarde\\Regular.ttf") +UUF.LSM:Register("font", "Avantgarde (Regular)", "Interface\\AddOns\\UnhaltedUnitFrames\\Media\\Fonts\\AvantGarde\\Regular.ttf") UUF.StatusTextures = { Combat = { @@ -75,10 +71,7 @@ function UUF:FetchFrameName(unit) ["boss"] = "UUF_Boss", } if not unit then return end - if unit:match("^boss(%d+)$") then - local unitID = unit:match("^boss(%d+)$") - return "UUF_Boss" .. unitID - end + if unit:match("^boss(%d+)$") then local unitID = unit:match("^boss(%d+)$") return "UUF_Boss" .. unitID end return UnitToFrame[unit] end @@ -87,8 +80,7 @@ function UUF:ResolveLSM() local General = UUF.db.profile.General UUF.Media = UUF.Media or {} UUF.Media.Font = LSM:Fetch("font", General.Fonts.Font) or STANDARD_TEXT_FONT - UUF.Media.Foreground = LSM:Fetch("statusbar", General.Textures.Foreground) or - "Interface\\RaidFrame\\Raid-Bar-Hp-Fill" + UUF.Media.Foreground = LSM:Fetch("statusbar", General.Textures.Foreground) or "Interface\\RaidFrame\\Raid-Bar-Hp-Fill" UUF.Media.Background = LSM:Fetch("statusbar", General.Textures.Background) or "Interface\\Buttons\\WHITE8X8" end @@ -166,8 +158,7 @@ local function AddAnchorsToBCDM() ["UUF_Target"] = "|cFF8080FFUnhalted|rUnitFrames: Target Frame", ["UUF_Pet"] = "|cFF8080FFUnhalted|rUnitFrames: Pet Frame", } - BCDMG.AddAnchors("UnhaltedUnitFrames", { "Utility", "Custom", "AdditionalCustom", "Item", "ItemSpell", "Trinket" }, - UUF_Anchors) + BCDMG.AddAnchors("UnhaltedUnitFrames", {"Utility", "Custom", "AdditionalCustom", "Item", "ItemSpell", "Trinket"}, UUF_Anchors) end function UUF:Init() @@ -218,14 +209,14 @@ function UUF:GetClassColour(unitFrame) local _, class = UnitClass(unitFrame.unit) local classColour = RAID_CLASS_COLORS[class] if classColour then - return { classColour.r, classColour.g, classColour.b, 1 } + return {classColour.r, classColour.g, classColour.b, 1} end end function UUF:GetReactionColour(reaction) local reactionColour = oUF.colors.reaction[reaction] if reactionColour then - return { reactionColour.r, reactionColour.g, reactionColour.b, 1 } + return {reactionColour.r, reactionColour.g, reactionColour.b, 1} end end @@ -236,12 +227,12 @@ end function UUF:RequiresAlternativePowerBar() local SpecsNeedingAltPower = { - PRIEST = { 258 }, -- Shadow - MAGE = { 62, 63, 64 }, -- Fire, Frost - PALADIN = { 70 }, -- Ret - SHAMAN = { 262, 263 }, -- Ele, Enh - EVOKER = { 1467, 1473 }, -- Dev, Aug - DRUID = { 102, 103, 104 }, -- Balance, Feral, Guardian + PRIEST = { 258 }, -- Shadow + MAGE = { 62, 63, 64 }, -- Fire, Frost + PALADIN = { 70 }, -- Ret + SHAMAN = { 262, 263 }, -- Ele, Enh + EVOKER = { 1467, 1473 }, -- Dev, Aug + DRUID = { 102, 103, 104 }, -- Balance, Feral, Guardian } local class = select(2, UnitClass("player")) local specIndex = GetSpecialization() @@ -254,15 +245,15 @@ function UUF:RequiresAlternativePowerBar() end UUF.LayoutConfig = { - TOPLEFT = { anchor = "TOPLEFT", offsetMultiplier = 0 }, - TOP = { anchor = "TOP", offsetMultiplier = 0 }, - TOPRIGHT = { anchor = "TOPRIGHT", offsetMultiplier = 0 }, - BOTTOMLEFT = { anchor = "TOPLEFT", offsetMultiplier = 1 }, - BOTTOM = { anchor = "TOP", offsetMultiplier = 1 }, - BOTTOMRIGHT = { anchor = "TOPRIGHT", offsetMultiplier = 1 }, - CENTER = { anchor = "CENTER", offsetMultiplier = 0.5, isCenter = true }, - LEFT = { anchor = "LEFT", offsetMultiplier = 0.5, isCenter = true }, - RIGHT = { anchor = "RIGHT", offsetMultiplier = 0.5, isCenter = true }, + TOPLEFT = { anchor="TOPLEFT", offsetMultiplier=0 }, + TOP = { anchor="TOP", offsetMultiplier=0 }, + TOPRIGHT = { anchor="TOPRIGHT", offsetMultiplier=0 }, + BOTTOMLEFT = { anchor="TOPLEFT", offsetMultiplier=1 }, + BOTTOM = { anchor="TOP", offsetMultiplier=1 }, + BOTTOMRIGHT = { anchor="TOPRIGHT", offsetMultiplier=1 }, + CENTER = { anchor="CENTER", offsetMultiplier=0.5, isCenter=true }, + LEFT = { anchor="LEFT", offsetMultiplier=0.5, isCenter=true }, + RIGHT = { anchor="RIGHT", offsetMultiplier=0.5, isCenter=true }, } function UUF:SetTagUpdateInterval() @@ -424,4 +415,4 @@ function UUF:CleanTruncateUTF8String(text) return DetailsFramework:CleanTruncateUTF8String(text) end return text -end +end \ No newline at end of file