No actually it is exactly what I was looking for, a fix for my fps issues.
Another important point:
- Do not reparent anything from the Blizzard nameplate to the new nameplate. It will catch you a taint.
Sth that you can add is:
Lua Code:
plate.barFrame, plate.nameFrame = plate:GetChildren()
plate.barFrame:Hide()
plate.nameFrame:Hide()
This will hide every child of the Blizzard nameplate. So the only frames that will live are the ones on your newly created frame.
*edit*
Seems like reparenting some frames is possible. This worked without issues:
Lua Code:
plate.nameFrame:SetParent(Nameplates[plate])
Here are some other hooks that might come in handy later:
Lua Code:
plate:HookScript("OnShow", NamePlateOnShow)
plate.castbar:HookScript("OnShow", CastbarOnShow)
plate.castbar:HookScript("OnHide", CastbarOnHide)
plate.healthbar:HookScript("OnValueChanged", HealthbarOnValueChanged)
plate.castbar:HookScript("OnValueChanged", CastbarOnValueChanged)
If there is no script yet set change HookScript to SetScript.
So we could only change our castbar values if there is an actual change involved and not on every frame drawn.