Thread Tools Display Modes
02-02-16, 04:41 PM   #1
FrozdY
A Murloc Raider
Join Date: Feb 2016
Posts: 8
Need KgPanels script help

Code:
--OnLoad
self:SetAlpha(0)

--OnEvent
if IsMouseOver then
self:SetAlpha(1)
end
What am I doing wrong? I'm trying to do a "show on hover-over" thing.

Edit:

I tried to have a separate like "button" for it to be able to hide show a panel so I did:
Code:
--OnClick
if pressed then
if KgPanels:FetchFrame("Quests"):IsVisible() then
KgPanels:FetchFrame("Quests"):Hide()
else
KgPanels:FetchFrame("Quests"):Show()
end
end
in the other panel that would act like a "button" for it, but that didn't work either, so please, could anypne help me?

Last edited by FrozdY : 02-02-16 at 05:11 PM.
  Reply With Quote
02-02-16, 05:19 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,877
You haven't registered any event as far as I can see. In any case you would be best served using the OnEnter/OnLeave scripts which fire when the mouse moves over (OnEnter) and again when it moves away (OnLeave) from a frame.
Code:
--OnLoad
self:SetAlpha(0) -- you could probably just set this as the default rather than using OnLoad

--OnEnter
self:SetAlpha(1)

--OnLeave
self:SetAlpha(0)
You haven't set pressed anywhere that I can see and your code doesn't set/reset it anywhere and it's not realy needed for a toggle.
Code:
--OnClick
if KgPanels:FetchFrame("Quests"):IsShown() then
    KgPanels:FetchFrame("Quests"):Hide()
else
    KgPanels:FetchFrame("Quests"):Show()
end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 02-02-16 at 10:54 PM.
  Reply With Quote
02-03-16, 04:23 AM   #3
FrozdY
A Murloc Raider
Join Date: Feb 2016
Posts: 8
Well, this is my first crack at .lua, so yeah, I don't really understand it, it makes sense to me, but not to the actual code it seems, anyway, I used your "hover" function and it worked, so thanks but yeah, sorry for any confusions I've coused you and so on, but it seemed like you understood what I tried to accomplish at least
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Need KgPanels script help

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off