Hi,
I've been trying to get the Personal Resource Display to become unclickable. So far I've tried the following:
Lua Code:
local function func(frame, setupOptions, frameOptions)
local unit = frame.displayedUnit or "player"
if not UnitIsUnit(unit, "player") then return end
print(frame:HasScript("OnClick")) -- returns true
print(frame:IsProtected()) -- returns false
frame:Disable()
frame:EnableMouse(false)
frame:SetScript("OnClick", function() print("onclick1") end) -- just for testing purposes
frame:SetScript("OnEnter", function() print("onenter1") end) -- just for testing purposes
end
hooksecurefunc("DefaultCompactNamePlateFrameSetupInternal", func)
if I comment out
Lua Code:
frame:Disable()
frame:EnableMouse(false)
then the program prints "onenter1" when the mouse enters the Personal Resource Display and strangely also when I click on it (without moving the mouse). It never prints "onclick1" btw. If I keep the aforementioned two lines uncommented, then the program does not print either "onenter1" or "onclick" but still maintains mouse interactivity, i.e. I can click on it and it will select my toon. So basically I'm stuck atm.
Any help would be appreciated, thank you.