Пример #1
0
        private void PadSelection_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (PadSelection != null)
            {
                SaveRemap();

                curPad++;
                if (curPad > 3)
                {
                    curPad = 0;
                }
                curSet = settings[curPad];

                RotateTransform Wheee = new RotateTransform();

                switch (curPad)
                {
                case 0: Wheee.Angle = 0; break;

                case 1: Wheee.Angle = 90; break;

                case 2: Wheee.Angle = 270; break;

                case 3: Wheee.Angle = 180; break;
                }

                PadSelection.RenderTransform = Wheee;

                UpdateControls();
            }
        }
Пример #2
0
        public void SaveSettings()
        {
            SaveEntry("General", "INIversion", INIversion);

            for (int port = 0; port < 4; port++)
            {
                SETTINGS set = mainWindow.settings[port];

                SaveEntry("Controller" + port, "Port", set.port);
                SaveEntry("Controller" + port, "Disable", set.isDisabled ? 1 : 0);
                SaveEntry("Controller" + port, "Dummy", set.isDummy ? 1 : 0);
                SaveEntry("Controller" + port, "LinearDZ", set.linearDZ ? 1 : 0);
                SaveEntry("Controller" + port, "LinearADZ", set.linearADZ ? 1 : 0);

                SaveEntry("Controller" + port, "AxisInvertedLX", set.invertedAxis[0] ? 1 : 0);
                SaveEntry("Controller" + port, "AxisInvertedLY", set.invertedAxis[1] ? 1 : 0);
                SaveEntry("Controller" + port, "AxisInvertedRX", set.invertedAxis[2] ? 1 : 0);
                SaveEntry("Controller" + port, "AxisInvertedRY", set.invertedAxis[3] ? 1 : 0);

                SaveEntry("Controller" + port, "TriggerMin", set.triggerMin);
                SaveEntry("Controller" + port, "TriggerMax", set.triggerMax);

                SaveEntry("Controller" + port, "Rumble", (int)(set.rumble * FACTOR));

                SaveEntry("Controller" + port, "L_Linearity", (int)(set.stickL.linearity * 100.0) + 300);
                SaveEntry("Controller" + port, "L_Deadzone", (int)(set.stickL.deadzone * FACTOR));
                SaveEntry("Controller" + port, "L_AntiDeadzone", (int)(set.stickL.antiDeadzone * FACTOR));

                if (set.perStick)
                {
                    SaveEntry("Controller" + port, "R_Linearity", (int)(set.stickR.linearity * 100.0) + 300);
                    SaveEntry("Controller" + port, "R_Deadzone", (int)(set.stickR.deadzone * FACTOR));
                    SaveEntry("Controller" + port, "R_AntiDeadzone", (int)(set.stickR.antiDeadzone * FACTOR));
                }
                else
                {
                    SaveEntry("Controller" + port, "R_Linearity", (int)(set.stickL.linearity * 100.0) + 300);
                    SaveEntry("Controller" + port, "R_Deadzone", (int)(set.stickL.deadzone * FACTOR));
                    SaveEntry("Controller" + port, "R_AntiDeadzone", (int)(set.stickL.antiDeadzone * FACTOR));
                }

                SaveRemapString(port);
            }
        }
Пример #3
0
        public MainWindow()
        {
            settings = new List <SETTINGS> {
                new SETTINGS(), new SETTINGS(), new SETTINGS(), new SETTINGS()
            };
            curSet = settings[curPad];

            InitializeComponent();
            GridStickR_Hide();
            BtnSettings.BorderBrush = new SolidColorBrush(Colors.White);

            if (Version_Label != null)
            {
                Version_Label.Content = "v0.6 ";
            }

            INIstuff = new INIsettings(this, 4);             // Set INI version here
            INIstuff.LoadSettings();
            INIstuff.SaveSettings();

            RemapControl = new List <Remap_Sel_Button>
            {
                R_Dpad_Up, R_Dpad_Down, R_Dpad_Left, R_Dpad_Right, R_Button_Start, R_Button_Back,
                R_LeftStick_Button, R_RightStick_Button, R_Shoulder_Left, R_Shoulder_Right,
                R_Button_A, R_Button_B, R_Button_X, R_Button_Y, R_Trigger_Left, R_Trigger_Right,
                R_LeftStick_XP, R_LeftStick_XM, R_LeftStick_YP, R_LeftStick_YM,
                R_RightStick_XP, R_RightStick_XM, R_RightStick_YP, R_RightStick_YM
            };

            for (int i = 0; i < 24; i++)
            {
                RemapControl[i].SetNewInput(curSet.remap[i]);
            }

            UpdateControls();

            System.ComponentModel.BackgroundWorker worker1 = new System.ComponentModel.BackgroundWorker();
            worker1.WorkerReportsProgress = true;
            worker1.DoWork          += worker1_DoWork;
            worker1.ProgressChanged += worker1_ProgressChanged;
            worker1.RunWorkerAsync();
        }
Пример #4
0
        private void PadSelection_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (PadSelection != null)
            {
                SaveRemap();

                curPad++;
                if(curPad > 3) curPad = 0;
                curSet = settings[curPad];

                RotateTransform Wheee = new RotateTransform();

                switch (curPad)
                {
                case 0: Wheee.Angle = 0; break;
                case 1: Wheee.Angle = 90; break;
                case 2: Wheee.Angle = 270; break;
                case 3: Wheee.Angle = 180; break;
                }

                PadSelection.RenderTransform = Wheee;

                UpdateControls();
            }
        }
Пример #5
0
        public MainWindow()
        {
            settings = new List<SETTINGS> { new SETTINGS(), new SETTINGS(), new SETTINGS(), new SETTINGS()};
            curSet = settings[curPad];

            InitializeComponent();
            GridStickR_Hide();
            BtnSettings.BorderBrush = new SolidColorBrush(Colors.White);

            if (Version_Label != null) Version_Label.Content = "v0.6 ";

            INIstuff = new INIsettings(this, 3); // Set INI version here
            INIstuff.LoadSettings();
            INIstuff.SaveSettings();

            RemapControl = new List<Remap_Sel_Button>
            {
                R_Dpad_Up, R_Dpad_Down, R_Dpad_Left, R_Dpad_Right, R_Button_Start, R_Button_Back,
                R_LeftStick_Button, R_RightStick_Button, R_Shoulder_Left, R_Shoulder_Right,
                R_Button_A, R_Button_B, R_Button_X, R_Button_Y, R_Trigger_Left, R_Trigger_Right,
                R_LeftStick_XP, R_LeftStick_XM, R_LeftStick_YP, R_LeftStick_YM,
                R_RightStick_XP, R_RightStick_XM, R_RightStick_YP, R_RightStick_YM
            };

            for (int i = 0; i < 24; i++)
                RemapControl[i].SetNewInput(curSet.remap[i]);

            UpdateControls();

            System.ComponentModel.BackgroundWorker worker1 = new System.ComponentModel.BackgroundWorker();
            worker1.WorkerReportsProgress = true;
            worker1.DoWork += worker1_DoWork;
            worker1.ProgressChanged += worker1_ProgressChanged;
            worker1.RunWorkerAsync();
        }
Пример #6
0
        public void LoadSettings()
        {
            mainWindow.settings[0].port = 0;
            mainWindow.settings[1].port = 1;
            mainWindow.settings[2].port = 2;
            mainWindow.settings[3].port = 3;

            if (ReadEntry("General", "INIversion") != INIversion)
            {
                return;
            }

            for (int port = 0; port < 4; port++)
            {
                SETTINGS set = mainWindow.settings[port];

                set.port       = ReadEntry("Controller" + port, "Port") % 4;
                set.isDisabled = ReadEntry("Controller" + port, "Disable") == 1;
                set.isDummy    = ReadEntry("Controller" + port, "Dummy") == 1;
                set.linearDZ   = ReadEntry("Controller" + port, "LinearDZ") == 1;
                set.linearADZ  = ReadEntry("Controller" + port, "LinearADZ") == 1;

                set.invertedAxis[0] = ReadEntry("Controller" + port, "AxisInvertedLX") == 1;
                set.invertedAxis[1] = ReadEntry("Controller" + port, "AxisInvertedLY") == 1;
                set.invertedAxis[2] = ReadEntry("Controller" + port, "AxisInvertedRX") == 1;
                set.invertedAxis[3] = ReadEntry("Controller" + port, "AxisInvertedRY") == 1;

                set.triggerMin = ReadEntry("Controller" + port, "TriggerMin") & 0xFF;
                set.triggerMax = ReadEntry("Controller" + port, "TriggerMax") & 0xFF;

                set.rumble = ReadEntry("Controller" + port, "Rumble") / FACTOR;

                int l_linearity, l_deadzone, l_antideadzone;
                int r_linearity, r_deadzone, r_antideadzone;

                l_linearity    = ReadEntry("Controller" + port, "L_Linearity");
                l_deadzone     = ReadEntry("Controller" + port, "L_Deadzone");
                l_antideadzone = ReadEntry("Controller" + port, "L_AntiDeadzone");

                r_linearity    = ReadEntry("Controller" + port, "R_Linearity");
                r_deadzone     = ReadEntry("Controller" + port, "R_Deadzone");
                r_antideadzone = ReadEntry("Controller" + port, "R_AntiDeadzone");

                set.stickL.linearity    = l_linearity < 0 ? 0 : (l_linearity - 300) / 100.0;
                set.stickL.deadzone     = l_deadzone / FACTOR;
                set.stickL.antiDeadzone = l_antideadzone / FACTOR;

                set.stickR.linearity    = r_linearity < 0 ? 0 : (r_linearity - 300) / 100.0;
                set.stickR.deadzone     = r_deadzone / FACTOR;
                set.stickR.antiDeadzone = r_antideadzone / FACTOR;

                if (l_linearity == r_linearity &&
                    l_deadzone == r_deadzone &&
                    l_antideadzone == r_antideadzone)
                {
                    set.perStick = false;
                }
                else
                {
                    set.perStick = true;
                }

                if (set.rumble < 0)
                {
                    set.rumble = 100.0;
                }
                if (set.stickL.deadzone < 0)
                {
                    set.stickL.deadzone = 0.0;
                }
                if (set.stickL.antiDeadzone < 0)
                {
                    set.stickL.antiDeadzone = 0.0;
                }
                if (set.stickR.deadzone < 0)
                {
                    set.stickR.deadzone = 0.0;
                }
                if (set.stickR.antiDeadzone < 0)
                {
                    set.stickR.antiDeadzone = 0.0;
                }

                ReadRemapString(port);
            }
        }