private void CloseApp()
 {
     chosenOption = ChosenOption.ExitApp;
     hasControl   = false;
     blackBg.StartFade(FadeState.FadingIn, false);
     musicFader.StartFade(FadeState.FadingOut, false);
 }
 private void StartGame()
 {
     chosenOption = ChosenOption.StartGame;
     hasControl   = false;
     blackBg.StartFade(FadeState.FadingIn, false);
     musicFader.StartFade(FadeState.FadingOut, false);
 }
Example #3
0
        /// <summary>
        /// Event wird bei TouchMove auf Menüschaltfläche aufgerufen.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Eventparameter</param>
        protected override void ButtonTouchMove(object sender, TouchEventArgs e)
        {
            base.ButtonTouchMove(sender, e);

            // hier werden nun die Subklassen-spezifischen Dinge getan
            Point currentTouchPoint = e.TouchDevice.GetTouchPoint(this.MainGrid).Position;

            _touchLine.X2 = currentTouchPoint.X;
            _touchLine.Y2 = currentTouchPoint.Y;

            if ((currentTouchPoint.X >= ((230 - 155) + 25)) && (currentTouchPoint.X <= 230))
            {
                _touchLine.Stroke = new SolidColorBrush((Color)FindResource("TouchLineColor_Chosen"));
                _currentState     = State.Hold_Option;

                if ((currentTouchPoint.Y >= 0) && (currentTouchPoint.Y < 50))
                {
                    _optionImgTxtGrids[0].Background = new SolidColorBrush((Color)FindResource("OptionColorChosen"));
                    _chosenOption = ChosenOption.Option0;
                }
                else
                {
                    _optionImgTxtGrids[0].Background = new SolidColorBrush((Color)FindResource("Option0ColorStrong"));
                }

                if ((currentTouchPoint.Y >= 50) && (currentTouchPoint.Y <= 100))
                {
                    _optionImgTxtGrids[1].Background = new SolidColorBrush((Color)FindResource("OptionColorChosen"));
                    _chosenOption = ChosenOption.Option1;
                }
                else
                {
                    _optionImgTxtGrids[1].Background = new SolidColorBrush((Color)FindResource("Option1ColorStrong"));
                }

                if ((currentTouchPoint.Y > 100) && (currentTouchPoint.Y <= 150))
                {
                    _optionImgTxtGrids[2].Background = new SolidColorBrush((Color)FindResource("OptionColorChosen"));
                    _chosenOption = ChosenOption.Option2;
                }
                else
                {
                    _optionImgTxtGrids[2].Background = new SolidColorBrush((Color)FindResource("Option2ColorStrong"));
                }
            }
            else
            {
                _touchLine.Stroke = new SolidColorBrush((Color)FindResource("TouchLineColor_Base"));
                _currentState     = State.Hold_Base;
                _chosenOption     = ChosenOption.None;
                foreach (Grid grid in _optionImgTxtGrids)
                {
                    grid.Background = new SolidColorBrush((Color)FindResource("Option" + _optionImgTxtGrids.IndexOf(grid) + "ColorStrong"));
                }
            }

            // Mark this event as handled.
            e.Handled = true;
        }
    private void GoTutorial()
    {
        hasControl = false;

        chosenOption = ChosenOption.Tutorial;

        for (int i = 0; i < videoTutorialsFaders.Length; i++)
        {
            videoTutorialsFaders[i].StartFade(FadeState.FadingIn, false);
        }
    }
Example #5
0
        /// <summary>
        /// Event wird bei TouchUp auf Menüschaltfläche aufgerufen.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Eventparameter</param>
        protected override bool ButtonTouchUp(object sender, TouchEventArgs e)
        {
            // hier werden nun die Subklassen-spezifischen Dinge getan
            ChosenOption rememberChosenOption = _chosenOption;

            if (base.ButtonTouchUp(sender, e))
            {
                OptionWasChosenEvent(this, new ChosenOptionEventArgs(rememberChosenOption, e.TouchDevice.GetOrientation(null) + 90));
            }

            // Mark this event as handled.
            e.Handled = true;
            return(true);
        }
        public override FrameworkElement GetGUIElement()
        {
            var group = new GroupBox();

            group.Header = WpfName;

            var stackPanel = new StackPanel {
                Orientation = Orientation.Vertical
            };

            var comboBox = new ComboBox();


            //Convert to a combo box -------------
            foreach (var optionPair in options)
            {
                var comboItem = new ComboBoxItem()
                {
                    Content     = optionPair.Key,
                    DataContext = optionPair,
                };
                comboBox.Items.Add(comboItem);
                comboItem.Selected += (sender, args) =>
                {
                    var optPair = (KeyValuePair <string, TEnum>)(sender as ComboBoxItem).DataContext;
                    ChosenOption = optPair.Value;
                    TriggerAfterParsingEvent(optPair.Key);
                };
            }
            comboBox.SelectedIndex = ChosenOption.GetHashCode();
            stackPanel.Children.Add(comboBox);
            //Combo box end ----------------------
            group.Content = stackPanel;

            return(group);
        }
Example #7
0
 /// <summary>
 /// Je nach Menüzustand umschalten zwischen Menüeinträge sichtbar und nicht sichtbar.
 /// </summary>
 public override void UpdateOptionsVisibility()
 {
     base.UpdateOptionsVisibility();
     _chosenOption = ChosenOption.None;
 }
Example #8
0
        /// <summary>
        /// Events für Touch auf Menüschaltfläche registrieren.
        /// </summary>
        public override void RegisterEvents()
        {
            base.RegisterEvents();

            _chosenOption = ChosenOption.None;
        }
Example #9
0
 public ChosenOptionEventArgs(ChosenOption chosenOption, double touchOrientation)
 {
     ChosenOption     = chosenOption;
     TouchOrientation = touchOrientation;
 }