How can I get a frame to show/hide itself based on a condition?
Code:
XML
<Button name="buttonA" hidden="false">
--Anchors, Sizes, and Layers--
<Scripts>
<OnUpdate>buttonA_OnUpdate()</OnUpdate>
</Scripts>
</Button>
LUA
function buttonA_OnUpdate()
if condition() then
buttonA:Show();
else
buttonA:Hide();
end
end
This does not work. I think because when the frame is hidden the OnUpdate handler does not fire. Could I just make a second frame to hold my OnUpdate and if condition() is true it will show my button?