WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   kgPanels script to show/hide panels when having a target (https://www.wowinterface.com/forums/showthread.php?t=57754)

matthenry 12-29-19 06:56 AM

kgPanels script to show/hide panels when having a target
 
Hey all!

I've been using kgPanels with Vanilla and TBC to outline my unitframes with a nice border.

Now the scripts I used with TBC don't work with the Classic version (1.13.x).

I used this to show and hide the border of the target unitframe when no target is selected:

OnLoad
Code:

self:RegisterEvent("UNIT_TARGET")
self:Hide()

OnEvent
Code:

if UnitExists("target") = nil then
  self:Show()
else
  self:Hide()
end

OnUpdate
Code:

if UnitExists("target") = nil then
  self:Show()
  return
else
  self:Hide()
  return
end

I've tried different variations and looked through the API but haven't been succesful. The frame is hidden when the game load, will show when I select a target but won't hide when I deselect it.

Please help :)

matthenry 12-29-19 11:59 AM

Has been solved. I forgot to put
Code:

= nil
in the code of this posting and that is actually the solution.

Thanks for reading. :D


All times are GMT -6. The time now is 02:00 PM.

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