Esempio n. 1
0
        public void InitializeDefaults()
        {
            KeyPresets presets = new KeyPresets();

            while (Controllers.Count < 4)
            {
                var controllerInfo = new ControllerInfo();
                controllerInfo.ControllerType = Controllers.Count <= 1 ? InteropEmu.ControllerType.StandardController : InteropEmu.ControllerType.None;

                if (Controllers.Count == 0)
                {
                    if (DefaultMapping.HasFlag(DefaultKeyMappingType.Xbox))
                    {
                        controllerInfo.Keys.Add(presets.XboxLayout1);
                    }
                    if (DefaultMapping.HasFlag(DefaultKeyMappingType.Ps4))
                    {
                        controllerInfo.Keys.Add(presets.Ps4Layout1);
                    }
                    if (DefaultMapping.HasFlag(DefaultKeyMappingType.WasdKeys))
                    {
                        controllerInfo.Keys.Add(presets.WasdLayout);
                    }
                    if (DefaultMapping.HasFlag(DefaultKeyMappingType.ArrowKeys))
                    {
                        controllerInfo.Keys.Add(presets.ArrowLayout);
                    }
                }
                Controllers.Add(controllerInfo);
            }
        }
Esempio n. 2
0
        public void InitializeDefaults()
        {
            KeyPresets presets = new KeyPresets();

            while (Controllers.Count < 4)
            {
                var controllerInfo = new ControllerInfo();
                controllerInfo.ControllerType = Controllers.Count <= 1 ? InteropEmu.ControllerType.StandardController : InteropEmu.ControllerType.None;

                if (Controllers.Count == 0)
                {
                    if (DefaultMapping.HasFlag(DefaultKeyMappingType.Xbox))
                    {
                        controllerInfo.Keys.Add(presets.XboxLayout1);
                    }
                    if (DefaultMapping.HasFlag(DefaultKeyMappingType.Ps4))
                    {
                        controllerInfo.Keys.Add(presets.Ps4Layout1);
                    }
                    if (DefaultMapping.HasFlag(DefaultKeyMappingType.WasdKeys))
                    {
                        controllerInfo.Keys.Add(presets.WasdLayout);
                    }
                    if (DefaultMapping.HasFlag(DefaultKeyMappingType.ArrowKeys))
                    {
                        controllerInfo.Keys.Add(presets.ArrowLayout);
                    }
                    if (controllerInfo.Keys.Count == 0)
                    {
                        controllerInfo.Keys.Add(new KeyMappings());
                    }

                    controllerInfo.Keys[0].ExcitingBoxingButtons      = presets.ExcitingBoxing.ExcitingBoxingButtons;
                    controllerInfo.Keys[0].FamilyBasicKeyboardButtons = presets.FamilyBasic.FamilyBasicKeyboardButtons;
                    controllerInfo.Keys[0].JissenMahjongButtons       = presets.JissenMahjong.JissenMahjongButtons;
                    controllerInfo.Keys[0].PachinkoButtons            = presets.Pachinko.PachinkoButtons;
                    controllerInfo.Keys[0].PartyTapButtons            = presets.PartyTap.PartyTapButtons;
                    controllerInfo.Keys[0].PowerPadButtons            = presets.PowerPad.PowerPadButtons;
                    controllerInfo.Keys[0].SuborKeyboardButtons       = presets.SuborKeyboard.SuborKeyboardButtons;
                    controllerInfo.Keys[0].BandaiMicrophoneButtons    = presets.BandaiMicrophone.BandaiMicrophoneButtons;
                    controllerInfo.Keys[0].VirtualBoyButtons          = presets.VirtualBoy.VirtualBoyButtons;
                }
                else if (Controllers.Count == 1)
                {
                    if (controllerInfo.Keys.Count == 0)
                    {
                        controllerInfo.Keys.Add(new KeyMappings());
                    }
                    controllerInfo.Keys[0].PowerPadButtons = presets.PowerPad.PowerPadButtons;
                }

                while (controllerInfo.Keys.Count < 4)
                {
                    controllerInfo.Keys.Add(new KeyMappings());
                }

                Controllers.Add(controllerInfo);
            }
        }
Esempio n. 3
0
        public void InitializeDefaults()
        {
            KeyPresets presets = new KeyPresets();

            while (Controllers.Count < 4)
            {
                var controllerInfo = new ControllerInfo();
                controllerInfo.ControllerType = Controllers.Count <= 1 ? InteropEmu.ControllerType.StandardController : InteropEmu.ControllerType.None;

                if (Controllers.Count <= 1)
                {
                    controllerInfo.Keys.Add(Controllers.Count == 0 ? presets.ArrowLayout : presets.NestopiaLayout);
                    controllerInfo.Keys.Add(Controllers.Count == 0 ? presets.XboxLayout1 : presets.XboxLayout2);
                    controllerInfo.Keys.Add(Controllers.Count == 0 ? presets.Ps4Layout1 : presets.Ps4Layout2);
                }
                Controllers.Add(controllerInfo);
            }
        }
Esempio n. 4
0
        public void InitializeDefaults(DefaultKeyMappingType defaultMappings)
        {
            KeyPresets        presets  = new KeyPresets();
            List <KeyMapping> mappings = new List <KeyMapping>();

            if (defaultMappings.HasFlag(DefaultKeyMappingType.Xbox))
            {
                mappings.Add(presets.XboxLayout1);
            }
            if (defaultMappings.HasFlag(DefaultKeyMappingType.Ps4))
            {
                mappings.Add(presets.Ps4Layout1);
            }
            if (defaultMappings.HasFlag(DefaultKeyMappingType.WasdKeys))
            {
                mappings.Add(presets.WasdLayout);
            }
            if (defaultMappings.HasFlag(DefaultKeyMappingType.ArrowKeys))
            {
                mappings.Add(presets.ArrowLayout);
            }

            Controllers[0].Type            = ControllerType.SnesController;
            Controllers[0].Keys.TurboSpeed = 2;
            if (mappings.Count > 0)
            {
                Controllers[0].Keys.Mapping1 = mappings[0];
                if (mappings.Count > 1)
                {
                    Controllers[0].Keys.Mapping2 = mappings[1];
                    if (mappings.Count > 2)
                    {
                        Controllers[0].Keys.Mapping3 = mappings[2];
                        if (mappings.Count > 3)
                        {
                            Controllers[0].Keys.Mapping4 = mappings[3];
                        }
                    }
                }
            }
        }