/// <summary> /// Event wird aufgerufen wenn andere option markiert wurde. /// </summary> /// <param name="sender">Sender</param> /// <param name="e">Eventparameter</param> private void OptionValueChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs <double> e) { if (((SurfaceSlider)sender).Value == 49) { _chosenControl = ChosenControl.None; } else if (((SurfaceSlider)sender).Value == 41.5) { _chosenControl = ChosenControl.MarkAsSolved; } else if (((SurfaceSlider)sender).Value == 31.6) { _chosenControl = ChosenControl.Technician; } else if (((SurfaceSlider)sender).Value == 24.35) { _chosenControl = ChosenControl.Process1; } else if (((SurfaceSlider)sender).Value == 17.1) { _chosenControl = ChosenControl.Process2; } else if (((SurfaceSlider)sender).Value == 7.1) { _chosenControl = ChosenControl.Stop; } else if (((SurfaceSlider)sender).Value == 0) { _chosenControl = ChosenControl.Kill; } UpdateChosenMeasureText(); }
/// <summary> /// /// </summary> /// <param name="gdm"></param> /// <param name="cm"></param> /// <param name="firstPlayerControl"></param> public Lobby(GraphicsDeviceManager gdm, ContentManager cm, ChosenControl firstPlayerControl) { this.firstPlayerControl = firstPlayerControl; secondPlayerControl = ChosenControl.Unchosen; playerOne = Player.Chara.Unchosen; playerTwo = Player.Chara.Unchosen; gamepadTwoHighlighted = true; brontoOneHighlighted = true; rexTwoHighlighted = true; titleText = cm.Load<Texture2D>("Multiplayer Lobby/lobby-title-text"); playerOneOk = cm.Load<Texture2D>("Multiplayer Lobby/player-one-ok"); playerTwoOk = cm.Load<Texture2D>("Multiplayer Lobby/player-two-ok"); keyboardOne = cm.Load<Texture2D>("Multiplayer Lobby/keyboard-graphic"); keyboardTwo = cm.Load<Texture2D>("Multiplayer Lobby/keyboard-graphic"); gamepadOne = cm.Load<Texture2D>("Multiplayer Lobby/gamepad-graphic"); gamepadTwo = cm.Load<Texture2D>("Multiplayer Lobby/gamepad-graphic"); brontoBox = cm.Load<Texture2D>("Multiplayer Lobby/bronto-box"); rexBox = cm.Load<Texture2D>("Multiplayer Lobby/rex-box"); pteraBox = cm.Load<Texture2D>("Multiplayer Lobby/ptera-box"); triceraBox = cm.Load<Texture2D>("Multiplayer Lobby/tricera-box"); bront = cm.Load<Texture2D>("CharacterSelectionScreen/Bronto"); rex = cm.Load<Texture2D>("CharacterSelectionScreen/Trex"); ptery = cm.Load<Texture2D>("CharacterSelectionScreen/Pteradactyl"); cera = cm.Load<Texture2D>("CharacterSelectionScreen/Triceratops"); background = new Texture2D(gdm.GraphicsDevice, gdm.PreferredBackBufferWidth, gdm.PreferredBackBufferHeight); background.SetData(ColorPicker.setTexture(background.Width, background.Height, Color.Gray)); c.A = 180; c.R = 50; c.G = 50; c.B = 50; unselectedOne = new Texture2D(gdm.GraphicsDevice, 400, 400); unselectedTwo = new Texture2D(gdm.GraphicsDevice, 400, 400); unselectedOne.SetData(ColorPicker.setTexture(unselectedOne.Width, unselectedOne.Height, c)); unselectedTwo.SetData(ColorPicker.setTexture(unselectedTwo.Width, unselectedTwo.Height, c)); bgMusic = new BackgroundMusic(cm, BackgroundMusic.playAt.CharacterSelectScreen); moveMenuSound = cm.Load<SoundEffect>("Sounds/moveMenu"); menuDone = cm.Load<SoundEffect>("Sounds/menuDone"); PteraSound = cm.Load<SoundEffect>("Sounds/Ptera"); triSound = cm.Load<SoundEffect>("Sounds/tri"); brontoSound = cm.Load<SoundEffect>("Sounds/bronto"); trexSound = cm.Load<SoundEffect>("Sounds/trex"); }
/// <summary> /// Event wird aufgerufen wenn Nutzer einen der Slider bewegt hat. /// </summary> /// <param name="sender">Sender</param> /// <param name="e">Eventparameter</param> private void OptionValueChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs <double> e) { if (((SurfaceSlider)sender).Value == 49) { _chosenControl = ChosenControl.None; } else if (((SurfaceSlider)sender).Value == 29 || ((SurfaceSlider)sender).Value == 33.6) { _chosenControl = ChosenControl.PausePlay; } else if (((SurfaceSlider)sender).Value == 22.4) { _chosenControl = ChosenControl.Pause; } else if (((SurfaceSlider)sender).Value == 14.5 || ((SurfaceSlider)sender).Value == 11.2) { _chosenControl = ChosenControl.Stop; } else if (((SurfaceSlider)sender).Value == 0) { _chosenControl = ChosenControl.Kill; } UpdateChosenMeasureText(); }
/// <summary> /// Bindet Instanz an ControlWidget. /// </summary> /// <param name="instance">wenn <value>null</value> dann Widget zur Zeit ausgeblendet</param> public void BindInstance(ProcessInstance instance) //, UserControl ioc { _chosenControl = ChosenControl.None; OptionSlider.Value = 49; _instance = instance; //_startedByIOC = ioc; if (instance == null) { this.Visibility = System.Windows.Visibility.Hidden; CurrentNavigation = 0; CreateExpandStoryBoard(InstanceRect, InstanceText); CreateReduceStoryBoard(AllRect, AllText); var bc = new BrushConverter(); InstanceRect.Fill = (Brush)bc.ConvertFrom("#FFAF7648"); AllRect.Fill = new SolidColorBrush((Color)FindResource("InstanceColorFade1")); SwitchSlider(); } else { if (!instance.State.Equals(Enums.ProcessState.executing)) { PausePlayText.Text = "Start this instance"; PausePlayImage.Source = new BitmapImage(new Uri(@"Images/play_white.png", UriKind.Relative)); } else { PausePlayText.Text = "Pause this instance"; PausePlayImage.Source = new BitmapImage(new Uri(@"Images/pause_white.png", UriKind.Relative)); } TitleText.Text = instance.Name + " - ID " + instance.Id; InstanceText.Text = "Instance " + instance.Id; StopText.Text = "Stop this instance"; KillText.Text = "Kill this instance"; this.Visibility = System.Windows.Visibility.Visible; } }
/// <summary> /// Updates the selection for controls to determine if the focus changes to the characters /// </summary> /// <param name="firstPlayer"></param> private void UpdateControlVerificationSelection(bool firstPlayer = false) { if (firstPlayer) { if (keyboardOneHighlighted || gamepadOneHighlighted) { if (keyboardOneHighlighted) { firstPlayerControl = ChosenControl.Keyboard; } else if (gamepadOneHighlighted) { firstPlayerControl = ChosenControl.Gamepad; } keyboardOneHighlighted = false; gamepadOneHighlighted = false; } } else { if (keyboardTwoHighlighted || gamepadTwoHighlighted) { if (keyboardTwoHighlighted) { secondPlayerControl = ChosenControl.Keyboard; } else if (gamepadTwoHighlighted) { secondPlayerControl = ChosenControl.Gamepad; } keyboardTwoHighlighted = false; gamepadTwoHighlighted = false; } } }
public OptionChosenEventArgs(ProcessInstance instance, ChosenControl chosenOption) { Instance = instance; ChosenOption = chosenOption; }