Big issue I want to fix for a script to switch profiles for Grid with KgPanels!

Warning: This question is fairly technical so if you do not know a lot about lua then you may want to stop reading here!

I have a big issue with my UI for a KgPanels script. When I press the Panel (which is a button for my UI) it will switch from DPS / Tank layout to Healer. When this happens it changes a few profiles around for me including Grid. However my problem is that some times when I switch Grid profiles, the frames are showing when they should not be or hide when they should be. To fix this I used the following Script in the OnUpdate Script area of my KgPanel:

Code:

if IsInGroup() then
GridLayoutFrame:Show()
else
GridLayoutFrame:Hide()
end

and this one for the DPS frame:

Code:

if IsInRaid() then
GridLayoutFrame:Show()
else
GridLayoutFrame:Hide()
end

This works completely find and makes the frames show instantly when switching grid profiles like it should be. HOWEVER when I change the Solo Layout from None to "BY Group 25" or anything else (from the "/grid" and Layout tab options) which should at least show my own Grid frame, the script forces it to show nothing because I am not actually in a group.

I was wondering if there is anything I could do to work around this issue so for example a script to find out whether or not Solo is set to anything else besides "none" and if so the code above does not take effect but if Solo is on None then it does. That's just an idea.

I have contacted the author of the Grid addon but not sure he can help me. He said to ask on a forum as it is more to do with KgPanels and mmo-champion is usually good for this stuff. Thank you so much for taking the time to read this!

I'm not sure what the value would be if you set the profile to "None". It might be string "none", or just boolean false / nil. Just /dump it in various scenarios to be sure.

This is the exact same question I've been asking myself for a while. I thought it was a string of none after looking through the lua file but "if not" is working fine at the moment. Since the frames disappear randomly when I change profiles its hard to tell right now but if I find out that the code from my last post doesn't work then I will have to try checking if the value equals None or false/nil after.

Yep thank you, got it all sorted and it works perfectly now. Tested it under many conditions:

Code:

if IsAddOnLoaded("Grid") then
if LibStub("AceAddon-3.0"):GetAddon("Grid"):GetModule("GridLayout").db.profile.layouts.solo=="None" then
if IsInGroup() then
GridLayoutFrame:Show()
else
GridLayoutFrame:Hide()
end
else
GridLayoutFrame:Show()
end
end