View Single Post
12-08-19, 09:01 PM   #1
Wolly_44
A Defias Bandit
Join Date: Dec 2019
Posts: 3
kgPanels - Script Mouseover Combat

Hey guys,

First post here because I'm completely stuck trying to correctly script the following function in kgPanels.

I have a kgPanel for my chat, and I want to hide the panel & chat frame when I enter combat, that part was easy, I just used the following instructions to hide/show the panel when entering/leaving combat.


Code:
OnLoad

self:RegisterEvent("PLAYER_REGEN_DISABLED")
self:RegisterEvent("PLAYER_REGEN_ENABLED")

OnEvent

if event == "PLAYER_REGEN_ENABLED" then
  self:Hide()
elseif event == "PLAYER_REGEN_DISABLED" then
  self:Show()
end
But I still want to be able to reveal it via mousover during combat if needed, I have Details! damage meter and this has the function built in and it works perfectly, I can have the window hidden during combat but mousover to reveal it if needed during a fight.

I've tried adjusting the same
Code:
if event == "PLAYER_REGEN_DISABLED"
into the OnEnter/OnLeave sections of the panel so that if my regen is disabled (in combat) then OnEnter show the panel, or if regen is disabled then hide the panel.

I dont want to hide the panel on mouseover outside of combat, can anyone help me fill in the gaps i'm missing to get this working?

Thanks in advance for any help
  Reply With Quote