public void RunTick() { // Get User Input PlayerInput input = Systems.localServer.MyCharacter.input; // Determine which option is selected: if (input.isDown(IKey.Right)) { this.opt = MenuOptionActive.Retry; } else if (input.isDown(IKey.Left)) { this.opt = MenuOptionActive.Restart; } else if (input.isDown(IKey.Up)) { this.opt = MenuOptionActive.ToMainMenu; } else if (input.isDown(IKey.Down)) { this.opt = MenuOptionActive.EndLevel; } // Check if the start button was released. if (input.isPressed(IKey.AButton)) { // Close the Menu UIHandler.SetMenu(null, false); //if (this.opt == MenuOptionActive.Continue) { return; } if (this.opt == MenuOptionActive.Retry) { this.retry.ActivateIcon(); return; } else if (this.opt == MenuOptionActive.Restart) { this.restart.ActivateIcon(); return; } else if (this.opt == MenuOptionActive.ToMainMenu) { this.toMain.ActivateIcon(); return; } else if (this.opt == MenuOptionActive.EndLevel) { this.endLevel.ActivateIcon(); return; } } else if (input.isPressed(IKey.Start)) { UIHandler.SetMenu(null, false); return; } // If the left mouse button was clicked, we leave the menu one way or another. // It might click on an object below, but if not, we clicked off of the menu. else if (Cursor.LeftMouseState == Cursor.MouseDownState.Clicked) { UIHandler.SetMenu(null, false); } // Center Menu //this.cont.RunTick(); this.retry.RunTick(); this.restart.RunTick(); this.toMain.RunTick(); this.endLevel.RunTick(); }
public void RunTick() { // Get User Input PlayerInput input = Systems.localServer.MyPlayer.input; // Determine which option is selected: if (input.isDown(IKey.Right)) { this.opt = MenuOptionActive.MyLevels; } else if (input.isDown(IKey.Left)) { if (input.isDown(IKey.Up)) { this.opt = MenuOptionActive.Controls; } else { this.opt = MenuOptionActive.Log; } } else if (input.isDown(IKey.Down)) { this.opt = MenuOptionActive.MyWorld; } else if (input.isDown(IKey.Up)) { this.opt = MenuOptionActive.Worlds; } // Check if the start button was pressed. if (input.isPressed(IKey.AButton)) { // Close the Menu UIHandler.SetMenu(null, false); //if (this.opt == MenuOptionActive.Return) { return; } if (this.opt == MenuOptionActive.Log) { this.log.ActivateIcon(); return; } else if (this.opt == MenuOptionActive.Controls) { this.controls.ActivateIcon(); return; } else if (this.opt == MenuOptionActive.Worlds) { this.worlds.ActivateIcon(); return; } else if (this.opt == MenuOptionActive.MyLevels) { this.myLevels.ActivateIcon(); return; } else if (this.opt == MenuOptionActive.MyWorld) { this.myWorld.ActivateIcon(); return; } } else if (input.isPressed(IKey.Start)) { UIHandler.SetMenu(null, false); return; } // If the left mouse button was clicked, we leave the menu unless it was opening the menu. // It might click on an object below, but if not, we clicked off of the menu. else if (Cursor.LeftMouseState == Cursor.MouseDownState.Clicked) { if (UIComponent.ComponentWithFocus is UICreoIcon) { return; } UIHandler.SetMenu(null, false); } // Center Menu //this.goBack.RunTick(); this.log.RunTick(); this.controls.RunTick(); this.worlds.RunTick(); this.myLevels.RunTick(); this.myWorld.RunTick(); }