Skip to content

Commit

Permalink
update edit mode button styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Krealle committed Sep 9, 2024
1 parent ae09b73 commit 1d0115f
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions UnitFrames/EditMode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -249,35 +249,20 @@ local colors = {
---@param button CUFUnitButton
---@param unit Unit
local function CreateOverlayBox(button, unit)
---@class CUFOverlayBox: Button, BackdropTemplate
local overlay = CreateFrame("Button", nil, UIParent, "BackdropTemplate")
---@class CUFOverlayBox: CellButton
local overlay = CUF:CreateButton(UIParent, "", { 1, 1 },
function() ShowPositioningPopup(unit) end, "accent")
overlay:SetAllPoints(button)
overlay:SetFrameStrata("HIGH")
overlay:SetFrameLevel(overlay:GetFrameLevel() + 100)
overlay:Hide()

local border = CreateFrame("Frame", nil, overlay, "BackdropTemplate")
border:SetAllPoints()
border:SetBackdrop({
bgFile = nil,
edgeFile = "Interface\\Buttons\\WHITE8X8",
edgeSize = 1,
})
border:SetBackdropBorderColor(0, 0, 0, 1)

local tex = overlay:CreateTexture(nil, "ARTWORK")
tex:SetTexture(Cell.vars.whiteTexture)
tex:SetAllPoints()
local r, g, b = unpack(colors[unit])
tex:SetVertexColor(r, g, b, 0.5)

local label = overlay:CreateFontString(nil, "OVERLAY", const.FONTS.CELL_WIGET)
label:SetPoint("CENTER")
label:SetText(L[unit])

-- Register mouse and movable
overlay:RegisterForDrag("LeftButton")
overlay:RegisterForClicks("LeftButtonUp")
overlay:SetMovable(true)
button:SetMovable(true)

Expand Down Expand Up @@ -319,9 +304,6 @@ local function CreateOverlayBox(button, unit)

UpdatePositioningPopup()
end)
overlay:SetScript("OnClick", function()
ShowPositioningPopup(unit)
end)

-- Hooks
overlay:HookScript("OnShow", function()
Expand Down

0 comments on commit 1d0115f

Please sign in to comment.