Beispiel #1
0
        public static Crate createCrateWithButtons()
        {
            var crate = new Crate();

            crate.used_buttons.Add(CrateButton.A.clone());
            crate.used_buttons.Add(CrateButton.B.clone());
            crate.used_buttons.Add(CrateButton.X.clone());
            crate.used_buttons.Add(CrateButton.Y.clone());
            crate.used_buttons.Add(CrateButton.Z.clone());
            crate.used_buttons.Add(CrateButton.START.clone());
            crate.used_buttons.Add(CrateButton.R.clone());
            crate.used_buttons.Add(CrateButton.L.clone());
            crate.used_buttons.Add(CrateButton.RLIGHT.clone());
            crate.used_buttons.Add(CrateButton.LEFT.clone());
            crate.used_buttons.Add(CrateButton.RIGHT.clone());
            crate.used_buttons.Add(CrateButton.UP.clone());
            crate.used_buttons.Add(CrateButton.DOWN.clone());
            crate.used_buttons.Add(CrateButton.X1.clone());
            crate.used_buttons.Add(CrateButton.X2.clone());
            crate.used_buttons.Add(CrateButton.Y1.clone());
            crate.used_buttons.Add(CrateButton.Y2.clone());
            crate.used_buttons.Add(CrateButton.Tilt.clone());
            crate.used_buttons.Add(CrateButton.CLEFT.clone());
            crate.used_buttons.Add(CrateButton.CRIGHT.clone());
            crate.used_buttons.Add(CrateButton.CUP.clone());
            crate.used_buttons.Add(CrateButton.CDOWN.clone());
            crate.used_buttons.Add(CrateButton.SWITCH.clone());
            return(crate);
        }
Beispiel #2
0
 public bool setCurrentGameConfig(Game_Config config)
 {
     if (!this.game_Configs.Contains(config))
     {
         return(false);
     }
     this.current_Game_Config = config;
     this.crate = this.current_Game_Config.crate;
     this.SwitchCheckbox.IsChecked = this.current_Game_Config.switchActive;
     this.RenderLayout();
     return(true);
 }
Beispiel #3
0
 public Game_Config()
 {
     activator = null;
     tiltValue = 0;
     x1Value   = 0;
     x2Value   = 0;
     y1Value   = 0;
     y2Value   = 0;
     r         = 0;
     g         = 0;
     b         = 0;
     crate     = Crate.createCrateWithButtons();
 }
Beispiel #4
0
        public void setupDefaultGameConfigs()
        {
            Game_Config def = new Game_Config
            {
                game_name = "PM",
                tiltValue = 69,
                x1Value   = 30,
                x2Value   = 50,
                y1Value   = 38,
                y2Value   = 87,
                r         = 102,
                g         = 77,
                b         = 204,
                crate     = Crate.createCrateWithButtons()
            };
            Game_Config melee = new Game_Config
            {
                game_name    = "Melee",
                tiltValue    = 74,
                x1Value      = 27,
                x2Value      = 55,
                y1Value      = 27,
                y2Value      = 53,
                r            = 214,
                g            = 104,
                b            = 14,
                activator    = CrateButton.X2,
                crate        = Crate.createCrateWithButtons(),
                switchActive = true
            };
            Game_Config ultimate = new Game_Config
            {
                game_name    = "Ultimate",
                tiltValue    = 69,
                x1Value      = 30,
                x2Value      = 50,
                y1Value      = 38,
                y2Value      = 87,
                r            = 255,
                activator    = CrateButton.Y2,
                crate        = Crate.createCrateWithButtons(),
                switchActive = true
            };

            this.game_Configs = new List <Game_Config>()
            {
                def, melee, ultimate
            };
            this.setCurrentGameConfig(def);
        }
Beispiel #5
0
        private void ButtonActivator_Click(object sender, RoutedEventArgs e)
        {
            ButtonSelector buttonSelector = new ButtonSelector();

            buttonSelector.SetFreeButtons(Crate.createCrateWithButtons().used_buttons);
            if (buttonSelector.ShowDialog() == false)
            {
                return;
            }
            CrateButton but = buttonSelector.selectedButton;

            if (but == null)
            {
                this.ButtonActivator.Content       = "None";
                this.current_Game_Config.activator = null;
                return;
            }
            this.ButtonActivator.Content       = but.name;
            this.current_Game_Config.activator = but;
        }