Пример #1
0
        private void VirtualPadAnalogStick_Load(object sender, EventArgs e)
        {
            AnalogStick.Name  = Name;
            AnalogStick.XName = Name;
            AnalogStick.YName = !string.IsNullOrEmpty(SecondaryName)
                                ? SecondaryName
                                : Name.Replace("X", "Y"); // Fallback
            AnalogStick.SetRangeX(RangeX);
            AnalogStick.SetRangeY(RangeY);

            ManualX.Minimum = (decimal)RangeX[0];
            ManualX.Maximum = (decimal)RangeX[2];

            ManualY.Minimum = (decimal)RangeX[0];
            ManualY.Maximum = (decimal)RangeX[2];

            MaxXNumeric.Minimum = 1;
            MaxXNumeric.Maximum = 100;
            MaxXNumeric.Value   = 100;

            MaxYNumeric.Minimum = 1;
            MaxYNumeric.Maximum = 100;
            MaxYNumeric.Value   = 100;           // Note: these trigger change events that change the analog stick too

            rangeAverageX = (int)((RangeX[0] + RangeX[2]) / 2);
            rangeAverageY = (int)((RangeY[0] + RangeY[2]) / 2);
        }
Пример #2
0
        private void VirtualPadAnalogStick_Load(object sender, EventArgs e)
        {
            AnalogStick.Name  = Name;
            AnalogStick.XName = Name;
            AnalogStick.YName = Name.Replace("X", "Y");             // TODO: allow schema to dictate this but this is a convenient default
            AnalogStick.SetRangeX(RangeX);
            AnalogStick.SetRangeY(RangeY);

            ManualX.Minimum = (decimal)RangeX[0];
            ManualX.Maximum = (decimal)RangeX[2];

            ManualY.Minimum = (decimal)RangeX[0];
            ManualY.Maximum = (decimal)RangeX[2];

            MaxXNumeric.Minimum = 1;
            MaxXNumeric.Maximum = 100;
            MaxXNumeric.Value   = 100;

            MaxYNumeric.Minimum = 1;
            MaxYNumeric.Maximum = 100;
            MaxYNumeric.Value   = 100;           // Note: these trigger change events that change the analog stick too

            rangeAverageX = (int)((RangeX[0] + RangeX[2]) / 2);
            rangeAverageY = (int)((RangeY[0] + RangeY[2]) / 2);
        }