[DiscordArchive] Would you be able to lead me in the direction to add a tooltip to an item?
[DiscordArchive] Would you be able to lead me in the direction to add a tooltip to an item?
Archived author: syco • Posted: 2023-10-12T18:53:11.408000+00:00
Original source
Would you be able to lead me in the direction to add a tooltip to an item?
Archived author: Honey • Posted: 2023-10-12T18:55:04.039000+00:00
Original source
I haven't trid, but that sounds like a dbc related subject.
Archived author: Honey • Posted: 2023-10-12T18:55:39.343000+00:00
Original source
Yeah or that. Good one!
Archived author: iThorgrim • Posted: 2023-10-12T20:34:28.907000+00:00
Original source
Thanks again for this <@175631911450836993>, so I made a little script to just trigger when the unit is a player and it suits me just fine!
```lua
PlayerEvents = {}
function RegisterCustomPlayerEvent(event, callback)
if not PlayerEvents[event] then
PlayerEvents[event] = {}
end
table.insert(PlayerEvents[event], callback)
end
function TriggerPlayerEvent(event, player, aura)
if not PlayerEvents[event] then
return
end
for _, callback in ipairs(PlayerEvents[event]) do
callback(player, aura)
end
end
function OnUnitEvent(event, unit, aura)
if ( not unit ) then return end
local player = unit:ToPlayer()
if ( not player ) then return end
TriggerPlayerEvent(1, player, aura)
end
RegisterUnitEvent(1, OnUnitEvent)
```