Don't want to open the submenu
-
Hi,
I have a Menu with submenus in it, when you press on an item, the submenu will ofcourse open. Down in the else statement i don't want it to be open, how can i do this?
MainMenuWeapons.OnItemSelect += MainMenuWeapons_OnItemSelect; private void MainMenuWeapons_OnItemSelect(UIMenu sender, UIMenuItem selectedItem, int index) { for (int i = 0; i < WeaponsSpecialList.Count; i++) { if (selectedItem == MenuWeaponsList[i].ParentItem) { if (MenuWeaponsItemListLevel[i] <= PlayerLevel) { if (!WeaponsSpecialList[i].Item5) { GivePlayerWeapon(WeaponsSpecialList[i].Item3, i, true); } break; } else { //Here i don't want to open the submenu, but how? Notification.Show("You need to be Level " + MenuWeaponsItemListLevel[i] + " to unlock this item"); break; } } } }
-
That's NativeUI, right? You should use LemonUI instead, NativeUI is deprecated.
-
Now for closing the Submenu, in LemonUI the menu class has the "Back()" (or GoBack, something like that) function, it does just what the name says, navigates to the previous menu. So, you would do something like
currentSubmenu.Back()
. I guess NativeUI has something like that, idk
-
@JustDancePC thank you it works, but i got a question, is LemonUI better then NativeUI, or is it just ur preference
-
@Youni NativeUI is deprecated, and LemonUI is recommended as a replacement. https://github.com/Guad/NativeUI