diff --git a/EllesmereUIQoL/EUI_QoL_Cursor_Options.lua b/EllesmereUIQoL/EUI_QoL_Cursor_Options.lua index c1d2cca7..cebf30ef 100644 --- a/EllesmereUIQoL/EUI_QoL_Cursor_Options.lua +++ b/EllesmereUIQoL/EUI_QoL_Cursor_Options.lua @@ -252,16 +252,16 @@ initFrame:SetScript("OnEvent", function(self) end } ); y = y - h - -- Only Show in Instances ---- Cursor Trail + -- Circle Opacity ---- Cursor Trail _, h = W:DualRow(parent, y, - { type="toggle", text="Only Show in Instances", + { type="slider", text="Circle Opacity", min=0, max=100, step=1, disabled=function() local p = DB(); return p and p.enabled == false end, disabledTooltip="Enable Cursor Circle", - getValue=function() local p = DB(); return p and p.instanceOnly end, + getValue=function() local p = DB(); return p and (p.alpha or 100) end, setValue=function(v) local p = DB(); if not p then return end - p.instanceOnly = v - if _G._ECL_UpdateVisibility then _G._ECL_UpdateVisibility() end + p.alpha = v + RefreshAddon() end }, { type="toggle", text="Cursor Trail", disabled=function() local p = DB(); return p and p.enabled == false end, @@ -274,6 +274,20 @@ initFrame:SetScript("OnEvent", function(self) end } ); y = y - h + -- Only Show in Instances + _, h = W:DualRow(parent, y, + { type="toggle", text="Only Show in Instances", + disabled=function() local p = DB(); return p and p.enabled == false end, + disabledTooltip="Enable Cursor Circle", + getValue=function() local p = DB(); return p and p.instanceOnly end, + setValue=function(v) + local p = DB(); if not p then return end + p.instanceOnly = v + if _G._ECL_UpdateVisibility then _G._ECL_UpdateVisibility() end + end }, + { type="label", text="" } + ); y = y - h + _, h = W:Spacer(parent, y, 20); y = y - h ----------------------------------------------------------------------- @@ -293,16 +307,15 @@ initFrame:SetScript("OnEvent", function(self) { type="multiSwatch", text="Color", swatches = { { tooltip = "Custom Color", - hasAlpha = true, + hasAlpha = false, getValue = function() local g = GCD_DB() local r, ng, b = HexToRGB(g.hex) - return r, ng, b, (g.alpha or 80) / 100 + return r, ng, b end, - setValue = function(r, g, b, a) + setValue = function(r, g, b) local gd = GCD_DB() gd.hex = RGBToHex(r, g, b) - if a then gd.alpha = floor(a * 100 + 0.5) end RefreshGCD() end, onClick = function(self) @@ -393,16 +406,13 @@ initFrame:SetScript("OnEvent", function(self) setValue=function(v) GCD_DB().radius = v; RefreshGCD() end } ); y = y - h - -- Only Show in Instances ---- Attach to Cursor + -- Circle Opacity ---- Attach to Cursor _, h = W:DualRow(parent, y, - { type="toggle", text="Only Show in Instances", + { type="slider", text="Circle Opacity", min=0, max=100, step=1, disabled=function() return not GCD_DB().enabled end, disabledTooltip="Enable GCD Circle", - getValue=function() return GCD_DB().instanceOnly or false end, - setValue=function(v) - GCD_DB().instanceOnly = v - if _G._ECL_UpdateVisibility then _G._ECL_UpdateVisibility() end - end }, + getValue=function() return GCD_DB().alpha or 80 end, + setValue=function(v) GCD_DB().alpha = v; RefreshGCD() end }, { type="toggle", text="Attach to Cursor", disabled=function() return not GCD_DB().enabled end, disabledTooltip="Enable GCD Circle", @@ -414,6 +424,19 @@ initFrame:SetScript("OnEvent", function(self) end } ); y = y - h + -- Only Show in Instances + _, h = W:DualRow(parent, y, + { type="toggle", text="Only Show in Instances", + disabled=function() return not GCD_DB().enabled end, + disabledTooltip="Enable GCD Circle", + getValue=function() return GCD_DB().instanceOnly or false end, + setValue=function(v) + GCD_DB().instanceOnly = v + if _G._ECL_UpdateVisibility then _G._ECL_UpdateVisibility() end + end }, + { type="label", text="" } + ); y = y - h + _, h = W:Spacer(parent, y, 20); y = y - h ----------------------------------------------------------------------- @@ -433,16 +456,15 @@ initFrame:SetScript("OnEvent", function(self) { type="multiSwatch", text="Color", swatches = { { tooltip = "Custom Color", - hasAlpha = true, + hasAlpha = false, getValue = function() local c = Cast_DB() local r, ng, b = HexToRGB(c.hex) - return r, ng, b, (c.alpha or 80) / 100 + return r, ng, b end, - setValue = function(r, g, b, a) + setValue = function(r, g, b) local cd = Cast_DB() cd.hex = RGBToHex(r, g, b) - if a then cd.alpha = floor(a * 100 + 0.5) end RefreshCast() end, onClick = function(self) @@ -566,16 +588,13 @@ initFrame:SetScript("OnEvent", function(self) setValue=function(v) Cast_DB().radius = v; RefreshCast() end } ); y = y - h - -- Only Show in Instances ---- Attach to Cursor + -- Circle Opacity ---- Attach to Cursor row, h = W:DualRow(parent, y, - { type="toggle", text="Only Show in Instances", + { type="slider", text="Circle Opacity", min=0, max=100, step=1, disabled=function() return not Cast_DB().enabled end, disabledTooltip="Enable Cast Bar Circle", - getValue=function() return Cast_DB().instanceOnly or false end, - setValue=function(v) - Cast_DB().instanceOnly = v - if _G._ECL_UpdateVisibility then _G._ECL_UpdateVisibility() end - end }, + getValue=function() return Cast_DB().alpha or 80 end, + setValue=function(v) Cast_DB().alpha = v; RefreshCast() end }, { type="toggle", text="Attach to Cursor", disabled=function() return not Cast_DB().enabled end, disabledTooltip="Enable Cast Bar Circle", @@ -587,6 +606,19 @@ initFrame:SetScript("OnEvent", function(self) end } ); y = y - h + -- Only Show in Instances + _, h = W:DualRow(parent, y, + { type="toggle", text="Only Show in Instances", + disabled=function() return not Cast_DB().enabled end, + disabledTooltip="Enable Cast Bar Circle", + getValue=function() return Cast_DB().instanceOnly or false end, + setValue=function(v) + Cast_DB().instanceOnly = v + if _G._ECL_UpdateVisibility then _G._ECL_UpdateVisibility() end + end }, + { type="label", text="" } + ); y = y - h + return math.abs(y) end diff --git a/EllesmereUIQoL/EllesmereUIQoL_Cursor.lua b/EllesmereUIQoL/EllesmereUIQoL_Cursor.lua index 25f49d03..edea825b 100644 --- a/EllesmereUIQoL/EllesmereUIQoL_Cursor.lua +++ b/EllesmereUIQoL/EllesmereUIQoL_Cursor.lua @@ -31,7 +31,7 @@ local UnitChannelInfo = UnitChannelInfo or ChannelInfo local f, t local lastX, lastY -local lastScale, lastHex, lastTex +local lastScale, lastHex, lastTex, lastAlpha local lastR, lastG, lastB local isVisible = true @@ -106,13 +106,13 @@ local function Apply() -- Recompute whenever hex, class mode, accent mode, or the mode flag -- changed. Accent mode also needs per-frame re-read since ELLESMERE_GREEN -- mutates in place when the user changes their accent color mid-session. - if hex ~= lastHex or p.useClassColor or p.useAccentColor or colorModeChanged then + local a = (p.alpha or 100) / 100 + if hex ~= lastHex or p.useClassColor or p.useAccentColor or colorModeChanged or a ~= lastAlpha then lastHex = hex + lastAlpha = a local r, g, b = ResolveColor(p) - if r ~= lastR or g ~= lastG or b ~= lastB or colorModeChanged then - lastR, lastG, lastB = r, g, b - t:SetVertexColor(r, g, b, 1) - end + lastR, lastG, lastB = r, g, b + t:SetVertexColor(r, g, b, a) end local tex = p.texture or DEF_TEX