08-04-24, 02:39 AM | #1 |
KuiNameplates Quest Icon Modification
Hello, I could use some help from someone familiar with modifying KuiNameplates. I'm trying to change the Y position of the Quest Icon depending on whether the creature is attackable (basically if it has a healthbar, as I've turned HP bars off on Friendlies) or not.
Here is the code from KNP Core/create.lua. Most of it is default KuiNameplates code. QUEST_ICON_Y is set to 10, for comparison. Lua Code:
Here's how it looks on mobs: Notice that even though the enemy mob is attackable, it's tripping as not frame.state.attackable. The neutral mob is unattackable so it executed correctly for him. Here's how it SHOULD look like for enemy mobs: My suspicion is that me calling 'frame' into Init(icon, frame) is not passing the correct information. I can provide the original code for comparison, if necessary. Last edited by dronerpine : 08-04-24 at 02:40 AM. Reason: Fixed function name |
|
08-05-24, 03:10 PM | #2 |
Got it working by creating separate functions that set the icon's points when Kui updates the icon rather than at creation. For some reason 'frame' returns nil for 'frame.state.attackable' and 'frame.IN_NAMEONLY' in the CreateQuestIcon function but returns actual values in the UpdateQuestIcon function. Maybe because CreateQuestIcon isn't self:.
I don't know if the code's optimal and I'm using numbers instead of config variables since it's just for my purposes, but here it is if anyone's interested: Lua Code:
|
|
WoWInterface » Developer Discussions » Lua/XML Help » KuiNameplates Quest Icon Modification |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|