private void MouseJustClickedSprite(MouseClickEntityEventArgs e) { if (_mouseClicked != null) { _mouseClicked(this, e); } }
private void MouseClickSprite(MouseClickEntityEventArgs e) { if (_mouseClick != null) { _mouseClick(this, e); } }
protected override void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e) { MenuItem item = (sender as MenuItem); if (item != null) { switch (item.ItemPosition) { case 0: YnG.SwitchState(new SelectShipState()); break; case 1: Registry.AudioManager.SpeakAsync("This section is disabled at this time"); //YnG.SwitchState(new MultiPlayerState(2)); break; case 2: YnG.SwitchState(new ScoreState()); break; case 3: YnG.SwitchState(new OptionsState()); break; case 4: YnG.SwitchState(new CreditsState()); break; case 5: YnG.Exit(); break; } } }
/// <summary> /// Action when a button is pressed /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void Pad_Click(object sender, MouseClickEntityEventArgs e) { YnSprite button = sender as YnSprite; if (button != null) { PadButtons direction = GetDirection(button.Name); VirtualPadPressedEventArgs vpEvent = new VirtualPadPressedEventArgs(direction); OnPressed(vpEvent); } }
protected override void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e) { YnEntity levelScreen = sender as YnEntity; if (levelScreen != null) { YnG.AudioManager.PlaySound(Assets.SoundCrystal); int levelId = int.Parse(levelScreen.Name.Split(new char[] { '_' })[1].ToString()); GameConfiguration.SetStartLevel(levelId); (YnG.Game as MazeGame).PrepareNewLevel(levelId, true); } }
protected override void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e) { MenuItem item = (sender as MenuItem); if (item != null) { if (item.ItemPosition == 2) { YnG.SwitchState(new SelectShipState()); } else { _selectedLevel = item.ItemPosition; Registry.AudioManager.StopMusic(); YnG.SwitchState(new SoloPlayerState((SpaceShipType)_selectedShip, (LevelType)_selectedLevel)); } } }
private void Pad_Click(object sender, MouseClickEntityEventArgs e) { YnSprite button = sender as YnSprite; if (button != null) { string [] temp = button.Name.Split(new char [] { '_' }); int index = int.Parse(temp [1].ToString()); ControlDirection direction = (ControlDirection)index; VirtualPadPressedEventArgs vpEvent = new VirtualPadPressedEventArgs(direction); if (e.JustClicked) { OnJustPressed(vpEvent); } else { OnPressed(vpEvent); } } }
protected override void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e) { MenuItem item = (sender as MenuItem); if (item != null) { if (item.ItemPosition < 4) { DesactiveAllShipProfile(shipProfileItem[item.ItemPosition]); shipProfileItem[item.ItemPosition].Active = true; _selectedShip = item.ItemPosition; Registry.AudioManager.SpeakAsync(shipProfileItem[item.ItemPosition].SpaceShipDescription.Model + ". " + shipProfileItem[item.ItemPosition].SpaceShipDescription.Description); } else if (item.ItemPosition == 4) { YnG.SwitchState(new MenuState()); } else if (item.ItemPosition == 5) { YnG.SwitchState(new SelectLevelState(_selectedShip)); } } }
protected override void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e) { }
// Lorsqu'on click sur un item du menu protected virtual void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e) { }
void MenuState_MouseClicked(object sender, MouseClickEntityEventArgs e) { _checkForNext = true; menuItemIndex = GetIndex(sender as YnText); }
protected override void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e) { YnG.SwitchState(new MenuState()); }
// Lorsqu'on click sur un item du menu protected abstract void item_MouseJustClicked(object sender, MouseClickEntityEventArgs e);