public override void AddToMenu(NativeMenu mainMenu, NativeMenuManager menuManager) { MainMenu = menuManager.AddSubMenu(mainMenu.Title, "LEVEL EDITOR", "Level Editor", "Create/Edit space levels.", mainMenu); MainMenu.Init(); OpenFileMenu = new OpenFileMenu(MenuManager); OpenFileMenu.AddToMenu(MainMenu, menuManager); }
private void Init() { NativeMenuManager = new NativeMenuManager(); MainMenu = new NativeMenu("Grand Theft Space", $"VERSION {CoreScript.VersionNum}", MenuBannerType.SmuglersHangar); MainMenu.Init(); NativeMenuManager.AddMenu(MainMenu); LevelSelectionMenu = new LevelSelectionMenu(this); LevelSelectionMenu.AddToMenu(MainMenu, NativeMenuManager); }
private void OnKeyUp(object sender, KeyEventArgs e) { if (e.KeyCode != MenuKey) { return; } if (NativeMenuManager.IsAnyMenuOpen()) { return; } MainMenu.Visible = !MainMenu.Visible; }
/// <summary> /// Use this when you want to initialize your menu items and add items/sub-menus. /// </summary> /// <param name="mainMenu"></param> /// <param name="menuManager"></param> public abstract void AddToMenu(NativeMenu mainMenu, NativeMenuManager menuManager);
public override void AddToMenu(NativeMenu mainMenu, NativeMenuManager menuManager) { MainMenu = menuManager.AddSubMenu(mainMenu.Title, "OPEN FILE", "Open", "Open a level xml file for editing.", mainMenu); MainMenu.Init(); MainMenu.MenuOpened += OnMenuOpened; }
private void OnTick(object sender, EventArgs e) { NativeMenuManager.ProcessMenus(); }