Ejemplo n.º 1
0
        private void MenuItem_Click(object senderObject, RoutedEventArgs e)
        {
            MenuItem sender = (MenuItem)senderObject;

            if (sender.Name == "closeItem")
            {
                System.Windows.Application.Current.Shutdown();
            }
            else if (sender.Name == "fourD6FlatItem")
            {
                rollMode              = RollMode.FourDSixFlat;
                fourD6Item.IsChecked  = false;
                threeD6Item.IsChecked = false;
                randItem.IsChecked    = false;
            }
            else if (sender.Name == "fourD6Item")
            {
                rollMode = RollMode.FourDSixDropLowest;
                fourD6FlatItem.IsChecked = false;
                threeD6Item.IsChecked    = false;
                randItem.IsChecked       = false;
            }
            else if (sender.Name == "threeD6Item")
            {
                rollMode = RollMode.ThreeDSixStraight;
                fourD6FlatItem.IsChecked = false;
                fourD6Item.IsChecked     = false;
                randItem.IsChecked       = false;
            }
            else if (sender.Name == "randItem")
            {
                rollMode = RollMode.Random;
                fourD6FlatItem.IsChecked = false;
                fourD6Item.IsChecked     = false;
                threeD6Item.IsChecked    = false;
            }
            else if (sender.Name == "popItem")
            {
                ResetItesms();
            }
            else if (sender.Name == "gridItem")
            {
                GridStats gridStats = new GridStats(this);
                gridStats.Show();
            }
            else if (sender.Name == "rollerItem")
            {
                ExpressionRoller expressionRoller = new ExpressionRoller(this);
                expressionRoller.Show();
            }
        }
        //крен (roll)
        public void OnRoll(RollMode _mode, float _speedMod = 1.0f)
        {
            var direction = Vector3.zero;

            switch (_mode)
            {
            case RollMode.ToLeft:
                direction = Vector3.forward;
                break;

            case RollMode.ToRight:
                direction = -Vector3.forward;
                break;
            }

            AddCommand(new ManeuverCommandData(ManeuverCommand.OnRoll, ManeuverType.Rotate, direction * config.data.rollSpeed * _speedMod));
        }