Capt. PERO Posted January 4, 2023 Report Share Posted January 4, 2023 Hi Paul, happy new year and hope you are doing well. Looks like a new value in TextMenu.Message clears TextMenu.MenuItemCount and even TextMenu.MenuItems Lets say there is a SimConnect Window (GSX in my case) open which gives myTextmenu.MenuItemCount > 0 If now a new message appears TextMenu.Message <> "" it resets the MenuItemCount (and all items). For me it should stay > 0 as long as the menu is not shown any more or the items are different. Using FSUIPCClient.dll v3.2.25.395 Link to comment Share on other sites More sharing options...
Paul Henty Posted January 4, 2023 Report Share Posted January 4, 2023 Happy New Year to you too. This current behaviour is by design as it follows FSUIPC behaviour. The same offset is used to read single line messages and multiline menus, so menus get overwritten by messages in FSUIPC. This allow users to read the last message that was sent and also know when messages are removed from the screen. There might be something I can do/suggest, but are two things I'm not clear on... 1. When a menu is on the screen and a new single-line message arrives, does the menu disappear or is it still on the screen and functional? 2. Do you want the menu items available even when the menu has gone from the screen (But a new menu has not arrived)? Paul Link to comment Share on other sites More sharing options...
Capt. PERO Posted January 5, 2023 Author Report Share Posted January 5, 2023 Hi Paul, 1. The OnScreen Menu stays and is functional if a new single-message arrives but the TextMenu instance loses the menu. I would expect that .MenuItems stay (as they are still on the screen) and .Message changes 2. No, I just need a proof way to detect if the menu is still on the screen and which items are shown. If a new .Message clears .MenuItems I have no idea to detect if the TextMenu is still shown on the display. This is my application: Link to comment Share on other sites More sharing options...
Capt. PERO Posted January 5, 2023 Author Report Share Posted January 5, 2023 Other findings. Once a menu has been shown .isMenu stays True (is False unless Menu has been shown first time) .Changed stays True in any case I tested, even if the menu disappears Link to comment Share on other sites More sharing options...
Paul Henty Posted January 5, 2023 Report Share Posted January 5, 2023 I've made some changes to the TextMenu helper. The TextMenu class is just a helper for the 0xB000 offset in FSUIPC. I can only supply the information I get from that offset. The way this offset works is that it holds the LAST message that was sent to the screen (regardless of if it was single line or a menu). If a menu appears and then a single line message B000 will only contain the single line message. However, I have changed my DLL so that TextMenu will now keep the last Menu data until a new Menu message arrives. Same with single line messages. Note however that ToString() will still only return the last message, and IsMenu will still only refer to the last message. The menu data will only be cleared when a Menu message arrives with no text. On FSX this happens if the user clears the menu themselves, but not if the menu is closed by the application (eg. GSX). It might be different in P3D. If not, then there's no way you can tell when menus get closed by GSX. This is a limitation of either FSUIPC or SimConnect. Note also that in FSX the single line messages never receive a 'cleared' message. So the last single line message will stay until a new single line message arrives. The changes will be in the next version (3.3.0) which will be available in week or two. I'll let you know when it's out. Quote Once a menu has been shown .isMenu stays True (is False unless Menu has been shown first time) I can't see that with FSX/FSUIPC4. If it's happening with P3D it might be a problem with FSUIPC6. You can monitor offset 0xB004 (4 byte int) to test this yourself. Single line messages are 0 & 1, Menu = 2. I can only pass on what FSUIPC gives me. Quote Changed stays True in any case I tested, even if the menu disappears Again, not with FSUIPC4. The changed flag is true when the value in offset 0xB000 (4-byte int) changes. This indicates if a new message has arrived. It shouldn't be true all the time. If a menu get's cleared and a clear message is received then Changed should be true the next time you call RefreshData(). After that is should be false (until a new message arrives). You can monitor 0XB000 to see what FSUIPC is sending. Paul Link to comment Share on other sites More sharing options...
Paul Henty Posted January 11, 2023 Report Share Posted January 11, 2023 Version 3.3.0 is now on NuGet with the change to the TextMenu I mentioned (The menu is now kept when a single line message arrives). Note there are also extensive breaking changes to the Airports Database if you're using that feature. Also if you're using .NET 4 Framework, the DLL no longer supports 4.0 as it's now out of support. It now targets 4.6.2 instead. Paul Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now