Lua Code:
-- LCIres["Res1"] always be false when you reload ui for those code:
if type(LCIres) ~= "table" then
LCIres = {}
LCIres["Res1"] = false
else
if LCIres["Res1"] == true then
-- skip
end
end
When you reload the ui, the LCIres won't be existed in the _G, so you need put the LCIres in saved variables and check it when your add-on is loaded.