Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sampconrad committed Sep 27, 2024
1 parent b1aff96 commit f24bbee
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions NameplateContextMenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ NameplateContextFrame:RegisterEvent("LOADING_SCREEN_DISABLED")

-- Create buttons for the player's and enemy/target nameplates
local function CreatePlateButton(name)
local button = CreateFrame("BUTTON", name, UIParent, "SecureActionButtonTemplate")
local button = CreateFrame("BUTTON", name, UIParent, "SecureUnitButtonTemplate")
button:EnableMouse(true)
button:RegisterForClicks("LeftButtonUp", "RightButtonUp")
button:SetSize(300, 70)
button:RegisterForClicks('LeftButtonUp', 'LeftButtonDown', 'RightButtonUp', 'RightButtonDown')
button:Hide()
return button
end
Expand All @@ -31,8 +32,8 @@ local function AnchorBtn(Button, frame, unit)
Button:ClearAllPoints()
Button:SetPoint("CENTER", frame, "CENTER", -20, -10)
Button:SetAttribute('unit', unit)
Button:SetAttribute('*type1', 'target') -- Left-click to target the unit
Button:SetAttribute('*type2', 'togglemenu') -- Right-click for context menu
Button:SetAttribute('type1', 'target') -- Left-click to target the unit
Button:SetAttribute('type2', 'togglemenu') -- Right-click for context menu
Button:Show()
end

Expand Down

0 comments on commit f24bbee

Please sign in to comment.