I posted a barebone nameplate setup here:
http://www.wowinterface.com/forums/s...4&postcount=62
Most important are the following three.
- nameplate_create when we spawn the frame using a certain style.
- unit_added when we show the frame and set the unit of the frame.
- unit_removed when we hide the frame and remove the unit.
Is this possible with the default oUF core?
I need to be able to pass the nameplate base as an anchor frame into the Spawn function.
*edit*
Wooow. It actually works!
Fixed scaling:
magic bean:
Lua Code:
function W:NAME_PLATE_UNIT_ADDED(unit)
local nameplate = C_NamePlate.GetNamePlateForUnit(unit)
if not nameplate.unitFrame then
local unitFrame = oUF:Spawn(unit, A..nameplate:GetName())
unitFrame:SetParent(nameplate)
unitFrame:ClearAllPoints()
unitFrame:SetPoint("CENTER")
nameplate.unitFrame = unitFrame
--mix-in ubm table data
Mixin(unitFrame, UFM)
end
nameplate.unitFrame:UnitAdded(nameplate,unit)
end
Not perfect yet though. But it shows that it should be possible.
Currently I seem to struggle with the unit update. Nameplates shuffle units quite often and I need a way to tell oUF about the unit change.
Hasn't oUF a function to trigger a full update? Sth like UpdateAllElements.
If you want to test it here is the code I'm using atm:
https://github.com/zorker/rothui/blo...imple/core.lua
Units do not update properly and clicking on a unit does not activate the correct unit.