WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Simple custom nameplates (https://www.wowinterface.com/forums/showthread.php?t=56997)

Ethly 01-25-19 01:43 PM

Simple custom nameplates
 
I'm trying to figure out how to replace Blizzard's enemy nameplates with my own ones. I know how to create frames, but I can't understand how to hook my frames, so they will replace Blizzard nameplates. Is there some article or simple addon I can look into? I tried to read Blizzard_NamePlates.lua but it seems that there's too much going on there. I need some simple code to start, just simple colored rectangle would be more than enough, then I can tinker from there.

Taudier 01-26-19 04:06 AM

1) kill everything : NamePlateDriverFrame:UnregisterAllEvents()
InterfaceOptionsNamesPanelUnitNameplatesMakeLarger.setFunc = nil

2) "NAME_PLATE_CREATED" function(self, event, frame )

3) "NAME_PLATE_UNIT_ADDED" function(self, event, unit)

local frame = C_NamePlate.GetNamePlateForUnit(unit)

4) "NAME_PLATE_UNIT_REMOVED" function(self, event, unit)

and look at blizzard source code

other important functions are :

C_NamePlate.SetNamePlateFriendlySize
C_NamePlate.SetNamePlateEnemySize

to set the clickable size of the nameplates

Ethly 01-26-19 06:38 AM

Thanks a lot, I'll look into it!


All times are GMT -6. The time now is 07:57 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI