public override void HandleInput(MenuInput input) { if (input.IsMenuCancel()) { Stage.ActiveStage.GetQB<AudioQB>().PlaySound("Uppercut"); ExitScreen(); } }
public override void HandleInput(MenuInput input) { if (input.IsMenuRight()) { Next(); } else if (input.IsMenuLeft()) { Previous(); } else if (input.IsMenuCancel()) { ExitScreen(); } }
public override void HandleInput(MenuInput input) { if (input.IsMenuCancel()) ExitScreen(); if (input.IsMenuSelect()) { if (quitGame) Stage.QuitGame = true; else LoadingScreen.Load(MenuSystem, true, "MainMenu"); } }
public override void HandleInput(MenuInput input) { if (input.IsMenuSelect()) { ExitScreen(); } //} else if (input.IsMenuCancel()) { // // Raise the cancelled event, then exit the message box. // if (Cancelled != null) // Cancelled(this, new EventArgs()); // ExitScreen(); //} }
KeyCode[] keyboardAxis; // Directional input with the keyboard. Used when time is frozen. void Awake() { if (instance == null) instance = this; myInputs = gameObject.GetComponents<StandaloneInputModule>(); inputHor = myInputs[0].horizontalAxis; inputHorJS = myInputs[1].horizontalAxis; inputVert = myInputs[0].verticalAxis; inputVertJS = myInputs[1].verticalAxis; inputSubmit = myInputs[0].submitButton; inputSubmitJS = myInputs[1].submitButton; inputStart = "PauseP" + playerNumber.ToString(); // These are the default movement keys I use for movement with player 1 and player 2. If yours are different, // change them here. if (playerNumber == 1 || playerNumber == 3) keyboardAxis = new KeyCode[4] { KeyCode.A, KeyCode.S, KeyCode.D, KeyCode.W }; else if(playerNumber == 2 || playerNumber == 4) keyboardAxis = new KeyCode[4] { KeyCode.LeftArrow, KeyCode.DownArrow, KeyCode.RightArrow, KeyCode.UpArrow }; }
public void UpdateInput() { keyState = Keyboard.GetState(); //ms = Mouse.GetState(); controlCode = MenuInput.NONE; if ( (keyState.IsKeyDown(Keys.S) || keyState.IsKeyDown(Keys.Down)) && !(prevState.IsKeyDown(Keys.Down) || prevState.IsKeyDown(Keys.S)) ) controlCode = MenuInput.DOWN; else if ( (keyState.IsKeyDown(Keys.Up) || keyState.IsKeyDown(Keys.W)) && !(prevState.IsKeyDown(Keys.Up) || prevState.IsKeyDown(Keys.W)) ) controlCode = MenuInput.UP; //else if ( (ms.LeftButton == ButtonState.Pressed && prevms.LeftButton != ButtonState.Pressed) || keyState.IsKeyDown(Keys.Enter) && !prevState.IsKeyDown(Keys.Enter)) else if (keyState.IsKeyDown(Keys.Enter) && !prevState.IsKeyDown(Keys.Enter)) controlCode = MenuInput.SELECT; //prevms = ms; prevState = keyState; }
public override void HandleInput(MenuInput input) { if (menuEntries.Count < 1) return; //don't null reference // Move to the previous menu entry? if (input.IsMenuUp()) { Stage.ActiveStage.GetQB<AudioQB>().PlaySound("knob-click-1"); int select = selectedEntry; selectedEntry--; if (selectedEntry < 0) selectedEntry = menuEntries.Count - 1; if (!menuEntries[selectedEntry].CanSelect) selectedEntry = select; }else if (input.IsMenuDown()) { Stage.ActiveStage.GetQB<AudioQB>().PlaySound("knob-click-1"); int select = selectedEntry; selectedEntry++; if (selectedEntry >= menuEntries.Count) selectedEntry = 0; if (!menuEntries[selectedEntry].CanSelect) selectedEntry = select; } else if (input.IsMenuSelect()) { Stage.ActiveStage.GetQB<AudioQB>().PlaySound("A"); if (selectedEntry >= menuEntries.Count) selectedEntry = 0; else if (selectedEntry < 0) selectedEntry = menuEntries.Count - 1; OnSelectEntry(selectedEntry); } else if (input.IsMenuCancel()) { Stage.ActiveStage.GetQB<AudioQB>().PlaySound("Uppercut"); OnCancel(); } }
public override void HandleInput(MenuInput input) { // Move to the previous menu entry? if (input.IsMenuUp()) { selectedEntry--; if (selectedEntry < 0) selectedEntry = menuEntries.Count - 1; } // Move to the next menu entry? if (input.IsMenuDown()) { selectedEntry++; if (selectedEntry >= menuEntries.Count) selectedEntry = 0; } if (input.IsMenuSelect()) { OnSelectEntry(selectedEntry); } else if (input.IsMenuCancel()) { OnCancel(); } }
public override void HandleInput(MenuInput input) { if (input.IsMenuSelect()) { //Stage.ActiveStage.GetQB<AudioQB>().PlaySound("Arail-attack2"); } }
public Task <int> AddMenuSection(MenuInput input) { throw new NotImplementedException(); }
public IActionResult Edit(MenuInput param) { var response = new ReponseOutPut(); response.Code = "success"; response.Message = "更新菜单成功"; if (!ModelState.IsValid) { response.Status = ReutnStatus.Error; response.Code = "param_vaild_error"; var errorProperty = ModelState.Values.First(m => m.ValidationState == ModelValidationState.Invalid); response.Message = errorProperty.Errors.First().ErrorMessage;//验证不通过的 //全局配置一个验证不通过就不在验证了,只存在一个错误信息 return(new JsonResult(JsonConvert.SerializeObject(response))); } //校验菜单系统名称是否存在 var isExistSystermName = _menuService.ExistMenuByMenuSystermName(param.MenuSystermName, param.Id); if (isExistSystermName) { response.Status = ReutnStatus.Error; response.Code = "menu_exsit_menuSystermName"; response.Message = "菜单系统名称已存在"; return(new JsonResult(JsonConvert.SerializeObject(response))); } SysMenu model = _mapper.Map <MenuInput, SysMenu>(param); model.LastUpdateBy = _context.Admin.Id; model.LastUpdateByName = _context.Admin.UserName; model.LastUpdateDate = DateTime.Now; if (param.FirstParentMenuId <= 0) { model.ParentMenuId = 0; } else { if (param.SecondParentMenuId <= 0) { model.ParentMenuId = param.FirstParentMenuId; } else { if (param.ThirdParentMenuId <= 0) { model.ParentMenuId = param.SecondParentMenuId; } else { model.ParentMenuId = param.ThirdParentMenuId; model.MenuType = MenuType.Function;//三级菜单选中,代表是功能 } } } var result = _menuService.Update(model); if (result < 0) { response.Status = ReutnStatus.Error; response.Code = "error"; response.Message = "更新菜单失败"; } return(new JsonResult(JsonConvert.SerializeObject(response))); }
public override void HandleInput(MenuInput input) { if (!doneLerpingScore) { if (input.IsGreen() || input.IsRed()) { score = baseScore + bonusPoints; doneLerpingScore = true; } } else if (doneLerpingScore) { if (input.IsGreen() || input.IsMenuSelect()) { Continue(this, new EventArgs()); } else if (input.IsRed() || input.IsMenuCancel()) { QuitGame(this, new EventArgs()); } } if (Microsoft.Xna.Framework.Input.Keyboard.GetState().IsKeyDown(Microsoft.Xna.Framework.Input.Keys.Home)) { ExitScreen(); } base.HandleInput(input); }
public override void HandleInput(MenuInput input) { }
void Update() { if (!this.AcceptingInput || PauseController.IsPaused()) { return; } if (MenuInput.AnyInput()) { IntegerVector newPosition = this.CurrentPosition; if (this.CurrentPosition.X > -_halfSize && MenuInput.NavLeft()) { newPosition.X -= 1; } else if (this.CurrentPosition.Y > -_halfSize && MenuInput.NavDown()) { newPosition.Y -= 1; } else if (this.CurrentPosition.X < _halfSize && MenuInput.NavRight()) { newPosition.X += 1; } else if (this.CurrentPosition.Y < _halfSize && MenuInput.NavUp()) { newPosition.Y += 1; } if ((newPosition.X != this.CurrentPosition.X || newPosition.Y != this.CurrentPosition.Y) && _grid[newPosition.X + _halfSize, newPosition.Y + _halfSize] != null) { moveCurrentTile(newPosition); } else if (MenuInput.SelectCurrentElement() && _grid[this.CurrentPosition.X + _halfSize, this.CurrentPosition.Y + _halfSize].State == TileState.Available) { int bossIndex = -1; for (int i = 0; i < this.BossTiles.Length; ++i) { IntegerVector tile = this.BossTiles[i]; if (this.CurrentPosition.X == tile.X && this.CurrentPosition.Y == tile.Y) { bossIndex = i; break; } } //TODO - Send input to level generation ProgressData.SelectTile(this.CurrentPosition); if (_allBossesDefeated && this.CurrentPosition.X == 0 && this.CurrentPosition.Y == 0) { SceneManager.LoadScene(this.FinalDialogSceneName); } else if (bossIndex == -1) { SceneManager.LoadScene(this.GameplaySceneName); } else { BossType boss = StaticData.BossData.BossTypes[ProgressData.GetCurrentBosses()[bossIndex]]; SceneManager.LoadScene(this.BossSceneName + boss.SceneKey); } } } else { if (!_currentBlinkingOff && _timeSinceBlink >= this.BlinkIntervalOn) { blinkCurrentTileOff(); } else if (_currentBlinkingOff && _timeSinceBlink >= this.BlinkIntervalOff) { blinkCurrentTileOn(); } else { _timeSinceBlink += Time.deltaTime; } } }
public override void HandleInput(MenuInput input) { bool isPrevious = false; bool isNext = false; if (Stage.ActiveStage.GetQB<ControlsQB>().GetGamePadType() == Microsoft.Xna.Framework.Input.GamePadType.Guitar || Stage.ActiveStage.GetQB<ControlsQB>().GetGamePadType() == Microsoft.Xna.Framework.Input.GamePadType.AlternateGuitar) { isPrevious = input.IsMenuUp(); isNext = input.IsMenuDown(); } else { isPrevious = input.IsMenuLeft(); isNext = input.IsMenuRight(); } // Move to the previous menu entry? if (isPrevious) { Stage.ActiveStage.GetQB<AudioQB>().PlaySound("knob-click-1"); index--; if (index < 0) index = options.Count - 1; } // Move to the next menu entry? if (isNext) { Stage.ActiveStage.GetQB<AudioQB>().PlaySound("knob-click-1"); index++; if (index >= options.Count) index = 0; } if (input.IsMenuSelect()) { Stage.ActiveStage.GetQB<AudioQB>().PlaySound("MeatSlap2_16"); options.Data[index](); } else if (input.IsMenuCancel()) { OnCancel(); } }
// Start is called before the first frame update void Start() { EventButton.SetActive(false); mi = FindObjectOfType <MenuInput>(); }
public void Hide() { MenuInput.DisableMenuInput(); _initialized = false; configureForEmptyState(); }
public override void HandleInput(MenuInput input) { base.HandleInput(input); }
public void Setup(MenuInput<ConfirmMovement.UnitAction> menuInput, ConfirmMovement.UnitAction choice) { this.menuInput = menuInput; this.choice = choice; }
public override void HandleInput(MenuInput input) { bool isPrevious = false; bool isNext = false; if (Stage.ActiveStage.GetQB<ControlsQB>().GetGamePadType() == Microsoft.Xna.Framework.Input.GamePadType.Guitar || Stage.ActiveStage.GetQB<ControlsQB>().GetGamePadType() == Microsoft.Xna.Framework.Input.GamePadType.AlternateGuitar) { isPrevious = input.IsMenuUp(); isNext = input.IsMenuDown(); } else { isPrevious = input.IsMenuLeft(); isNext = input.IsMenuRight(); } // Move to the previous menu entry? if (isPrevious) { Stage.ActiveStage.GetQB<AudioQB>().PlaySound("knob-click-1"); int select = selectedEntry; selectedEntry--; if (selectedEntry < 0) { selectedEntry = MenuEntries.Count - 1; } if (!MenuEntries[selectedEntry].CanSelect) { selectedEntry = select; } } else if (isNext) { Stage.ActiveStage.GetQB<AudioQB>().PlaySound("knob-click-1"); int select = selectedEntry; selectedEntry++; if (selectedEntry >= MenuEntries.Count) { selectedEntry = 0; } if (!MenuEntries[selectedEntry].CanSelect) { selectedEntry = select; } } else if (input.IsMenuSelect()) { Stage.ActiveStage.GetQB<AudioQB>().PlaySound("Arail-attack2"); OnSelectEntry(selectedEntry); } else if (input.IsMenuCancel()) { Stage.ActiveStage.GetQB<AudioQB>().PlaySound("Uppercut"); OnCancel(); } }
public override void HandleInput(MenuInput input) { if (input.IsMenuSelect()) ExitScreen(); }
void Update() { if (blockInputTimer >= 0) { blockInputTimer -= Time.deltaTime; return; } switch (state) { case MenuState.TitleScreen: Vector2 input = GenericInput.GetLeftStickMovement(gamepads); titleScreenMovement.Move(input.x, input.y, false); if (MenuInput.GetStartKeyDown(gamepads)) { PlayerShooting shooting = titleScreenMovement.GetComponent <PlayerShooting>(); shooting.Aim(mainMenuLocation.x, mainMenuLocation.y, 0, 0); shooting.Draw(); shooting.Shoot(); //Play camera script //Load menu state = MenuState.MainMenu; //TODO: Transition time blockInputTimer = .5f; Logger.Log("Player select", this, LogLevel.Log); } break; case MenuState.MainMenu: state = MenuState.PlayerSelect; break; case MenuState.PlayerSelect: for (int i = 0; i < GM.MAXPLAYERCOUNT; i++) { if (controllerPlayerIDMapping[i] == -1) { if (MenuInput.GetSelectKeyDown(gamepads[i])) { //register player controllerPlayerIDMapping[i] = GM.GameInstance.AddPlayer(i); Logger.Log("Added controller: " + i + " to player: " + controllerPlayerIDMapping[i], this, LogLevel.Log); } } else { if (MenuInput.GetStartKeyDown(gamepads[i])) { state = MenuState.LevelSelect; Logger.Log("Players confirmed: " + GM.GameInstance.Players.Capacity, this, LogLevel.Log); } //pass on input } } break; case MenuState.LevelSelect: if (MenuInput.GetSelectKeyDown(gamepads)) { Logger.Log("Loading DevLevel3.0", this, LogLevel.Log); SceneManager.LoadScene("DevLevel3.0"); //Get current stage //load current stage return; } //Pass on input break; } }