Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 

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