Put the OnUpdate in Lua.
Lua Code:
f.TimeSinceLastUpdate = 0
f:SetScript("OnUpdate",function(self,elapsed)
local gwbutton = GwGarrisonButton
self.TimeSinceLastUpdate = self.TimeSinceLastUpdate + elapsed;
if (self.TimeSinceLastUpdate > UIMod_UpdateInterval) then
print("UIMOD OnUpdate");
if gwbutton then
print("UIMOD OnUpdate: GW2 UI Garrison Button is shown. Hiding.");
gwbutton:Hide();
end
--
self.TimeSinceLastUpdate = 0;
end
end)