Originally Posted by Grimsin
the hotspots on the target cave show up no mater what i have targeted even enemy's. in mazzle the hotspots only show up if your targeting something that they can be used on. IE the whisper button only shows up when targeting another player. its hidden when targeting a mob.
|
I have used scripts for each panel to do this
OnLoad:
Code:
self:RegisterEvent("UNIT_TARGET")
OnEvent:
Code:
if UnitIsFriend("player","target") then
self:Show()
else
self:Hide()
end
The OnEvent code checks that the target is friend to the player then shows the panel else hides it.
You can string togther multiple checks by adding "and", in between them, to the if statement such as
Code:
if (UnitIsFriend("player","target") and UnitIsPlayer("target")) then
This will check that the target is friend and target is a player (not a NPC)
another useful check is that you are not targeting urself
Code:
not UnitIsUnit("player","target"))
There is a little lag, in that the cave comes up right away but the buttons appear after.
Now if I could just figure out how to add range checking. If the target is too far away do not display the trade button.