View Single Post
12-29-19, 06:56 AM   #1
matthenry
A Defias Bandit
Join Date: Nov 2019
Posts: 2
Question 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

Last edited by matthenry : 12-29-19 at 11:57 AM.
  Reply With Quote