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? |
(mmo-champ crosspost, for reference)
|
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/ |
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! |
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!
|
All times are GMT -6. The time now is 03:19 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI