Thread Tools Display Modes
06-22-12, 12:10 PM   #1
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Help with Lua script - KgPanels

Hi, I hope this is not in the wrong forum section.

This code below does not work. I have tried using "if kgPanels:FetchFrame("Expandbutton"): IsVisible() then" instead of checking to see if the correct profile was selected on the class timer addon however that also did not work. I thought it was because the "Expandbutton" uses a "self:SetAlpha(0)". I want the button to only show if that panel is showing and not hidden regardless of what alpha its using so I thought maybe IsVisible is the wrong code to use? I'm not sure.

I am using this code:

if InCombatLockdown() then return end
if pressed then
if GetMouseButtonClicked() == "LeftButton" then
if ClassTimer.db:GetCurrentProfile() == "MyUI" then

ShadowUF.db:SetProfile("MyUI")
kgPanels:FetchFrame("Expandbutton"):Hide()
kgPanels:FetchFrame("ExpandbuttonH"):Show()
ClassTimer.db:SetProfile("MyUIH")
Grid.db:SetProfile("MyUIH")

elseif ClassTimer.db:GetCurrentProfile() == "2Bar" then

ShadowUF.db:SetProfile("My2Bar")
kgPanels:FetchFrame("Retract"):Hide()
kgPanels:FetchFrame("RetractH"):Show()
kgPanels:FetchFrame("DPS"):Hide()
kgPanels:FetchFrame("DPSOff"):Show()
ClassTimer.db:SetProfile("MyUIH2")
Grid.db:SetProfile("MyUIH2")

elseif ClassTimer.db:GetCurrentProfile() == "MyUIH" then
elseif ClassTimer.db:GetCurrentProfile() == "MyUIH2" then
end
end
end

It is also worth mentioning that it does not necessarily need to be "ClassTimer.db:GetCurrentProfile() == " it can also be used on another kgpanel such as ""kgPanels:FetchFrame("Retract"): IsVisible() then".


If anyone can help me with this, that would be amazing. Thank you!

Also I want a panel to change alpha depending on whether shadowed unit frames profile is set.

I use this code onLoad:
if ShadowUF.db:GetCurrentProfile() == "<profilename>" or ShadowUF.db:GetCurrentProfile() == "<profilename>" then
self:SetAlpha(1)
else
self:SetAlpha(0.5)
end

however this does not work either. Anyone know why?

Last edited by Mayron : 06-22-12 at 12:25 PM.
  Reply With Quote
06-22-12, 01:14 PM   #2
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
(mmo-champ crosspost, for reference)
  Reply With Quote
06-22-12, 02:40 PM   #3
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Do you have this in the OnClick section of the kgPanels scripts area? If so, I don't see anything in your code to specify up/down clicks. The script fires for both.

http://www.wowace.com/addons/kg-panels/
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
06-23-12, 03:49 AM   #4
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
Yes I have it on the OnClick.

And also Ketho I have posted it on mmo-champion but it was not getting replied to and was in a hurry so thought why not post here as well.

I got the code it work however I just wanted to ask if this code will work or is this incorrect?:

"if kgPanels:FetchFrame("Expandbutton"): IsVisible() then

Not sure if IsVisible is correct for a kgpanel because I am getting some bug issues and wanted to find out why.

Thank you!
  Reply With Quote
06-23-12, 04:19 AM   #5
Mayron
A Frostmaul Preserver
 
Mayron's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2010
Posts: 275
The problem has been fixed. Parts of the names used in the code was incorrect and because I'm still new to this, I over looked that and thought some of the terminology was wrong. Thanks anyway!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Help with Lua script - KgPanels


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