I created a simple popup context menu, invoked by a chat command, using an example from the Helm's Deep Lua API Documentation.
Code:
contextMenu=Turbine.UI.ContextMenu();
menuItems=contextMenu:GetItems();
menuItems:Add(Turbine.UI.MenuItem("Option 1"));
menuItems:Add(Turbine.UI.MenuItem("Option 2"));
local i;
for i=1,menuItems:GetCount() do
local menuItem=menuItems:Get(i);
function menuItem.Click(sender,args)
Turbine.Shell.WriteLine("You have selected "..sender:GetText()..".");
end
end
contextMenu:ShowMenu();
What I would like to do is detect when the menu closes without a menu option being selected. I assume this can be achieved with the use of a callback and/or update function, but I just can't figure how to do it.
Any advice please?
P.S. "Garan has exceeded their stored private messages quota and cannot accept further messages until they clear some space."