MeerCaT Posted May 3, 2019 Posted May 3, 2019 Are there any known quirks or issues with the radio menu management functions? (missionCommands - addCommand, addSubMenu, removeItem) These functions are too mature and too widely used for them to contain any obvious flaws, so the root of the issue I'm having must surely reside in my own code. Nevertheless I've been stumped for two days on a particular strange behaviour I'm seeing. Without looking for the time being at any code that comes before it, can anyone make sense of what is happening in this small snippet described below: [color=SeaGreen]-- where: child = "ccc" and parent = { "aaa", "bbb" } -- ... output to log file the values of 'child' and 'parent' (simple serialised version of the 'parent' table) ...[/color] newMenu = missionCommands.addSubMenu(child, parent) [color=seagreen]-- ... output to log file the value of 'newMenu' (simple serialised version of the table) ...[/color]And what I see in the log are the correct values of 'child' and 'parent', but for the value of 'newMenu' instead of being { 1=aaa, 2=bbb, 3=ccc } is the same as 'parent' { 1=aaa, 2=bbb }. So at the moment immediately prior to calling addSubMenu() I can see the parameters I am passing are correct and sensible, but the returned value indicates the 'child' parameter has been ignored or something. Are there circumstance in which it might be valid for the addSubMenu() function to behave like this? (I.e. simply return the given parent, without actually adding the child to the path) It may be relevant that prior to the point at which this issue occurs there have been several submenus and commands added and a submenu removed, all of which appear to have been performed correctly with no such issue. One thought I have at the moment is that perhaps after having made a call to removeItem() (to remove a submenu), some kind of corruption has occurred to the radio menu data structure internal to the DCS environment. But like I said at the start, I imagine this code is far too mature by now to have any such issues gone unnoticed. So what factors on my side could be influencing this? Thoughts appreciated. Thanks.
MeerCaT Posted May 3, 2019 Author Posted May 3, 2019 [sOLVED] As suspected there was a small unintended, undocumented feature (zarro boogs in my code, I tell you!... Plenty of features though) in my menu item removal code. With that feature knocked on the head, the whole menu-management process is conforming a lot more to expectations. Thanks for listening!
Recommended Posts