Esempio n. 1
0
        public WinProgs(string[] oc, DS4Form main)
        {
            InitializeComponent();
            openProgram.Filter = Resources.Programs + "|*.exe|" + Resources.Shortcuts + "|*.lnk";
            form = main;
            cbs = new ComboBox[4] { cBProfile1, cBProfile2, cBProfile3, cBProfile4 };
            for (int i = 0; i < 4; i++)
            {
                cbs[i].Items.AddRange(oc);
                cbs[i].Items.Add(Resources.noneProfile);
                cbs[i].SelectedIndex = cbs[i].Items.Count - 1;
            }
            if (!File.Exists(Global.appdatapath + @"\Auto Profiles.xml"))
            {
                Create();
            }
            LoadP();

            if (Directory.Exists(@"C:\Program Files (x86)\Steam\steamapps\common"))
            {
                steamgamesdir = @"C:\Program Files (x86)\Steam\steamapps\common";
            }
            else if (Directory.Exists(@"C:\Program Files\Steam\steamapps\common"))
            {
                steamgamesdir = @"C:\Program Files\Steam\steamapps\common";
            }
            else
            {
                cMSPrograms.Items.Remove(addSteamGamesToolStripMenuItem);
            }

            if (Directory.Exists(@"C:\Program Files (x86)\Origin Games"))
            {
                origingamesdir = @"C:\Program Files (x86)\Origin Games";
            }
            else if (Directory.Exists(@"C:\Program Files\Origin Games"))
            {
                origingamesdir = @"C:\Program Files\Origin Games";
            }
            else
            {
                cMSPrograms.Items.Remove(addOriginGamesToolStripMenuItem);
            }
        }
Esempio n. 2
0
		public Options(DS4Form root)
		{
			InitializeComponent();
			mSize                     = MaximumSize;
			MaximumSize               = new Size(0, 0);
			Root                      = root;
			btnRumbleHeavyTest.Text   = Resources.TestHText;
			btnRumbleLightTest.Text   = Resources.TestLText;
			rBTPControls.Text         = rBSAControls.Text;
			rBTPMouse.Text            = rBSAMouse.Text;
			rBTPControls.Location     = rBSAControls.Location;
			rBTPMouse.Location        = rBSAMouse.Location;
			Visible                   = false;
			colored                   = btnRainbow.Image;
			greyscale                 = GreyscaleImage((Bitmap)btnRainbow.Image);
			fLPSettings.FlowDirection = FlowDirection.TopDown;

			foreach (Control control in tPControls.Controls)
			{
				if (control is Button && !((Button)control).Name.Contains("btn"))
				{
					buttons.Add((Button)control);
				}
			}

			foreach (Control control in fLPTouchSwipe.Controls)
			{
				if (control is Button && !((Button)control).Name.Contains("btn"))
				{
					buttons.Add((Button)control);
				}
			}

			foreach (Control control in fLPTiltControls.Controls)
			{
				if (control is Button && !((Button)control).Name.Contains("btn"))
				{
					buttons.Add((Button)control);
				}
			}

			foreach (Control control in pnlController.Controls)
			{
				if (control is Button && !((Button)control).Name.Contains("btn"))
				{
					buttons.Add((Button)control);
				}
			}

			foreach (Button b in buttons)
			{
				Defaults.Add(b.Name, b.Text);
				b.Text = string.Empty;
			}

			AddHoverEvent(Controls);

			foreach (Button b in buttons)
			{
				b.MouseHover += button_MouseHover;
				b.MouseLeave += button_MouseLeave;
			}

			advColorDialog.OnUpdateColor += advColorDialog_OnUpdateColor;
			InputTimer.Tick              += InputDS4;
			sixaxisTimer.Tick            += ControllerReadout_Tick;
			sixaxisTimer.Interval         = 1000 / 60;
			bnGyroZN.Text                 = Resources.TiltUp;
			bnGyroZP.Text                 = Resources.TiltDown;
			bnGyroXP.Text                 = Resources.TiltLeft;
			bnGyroXN.Text                 = Resources.TiltRight;
			bnSwipeUp.Text                = Resources.SwipeUp;
			bnSwipeDown.Text              = Resources.SwipeDown;
			bnSwipeLeft.Text              = Resources.SwipeLeft;
			bnSwipeRight.Text             = Resources.SwipeRight;
		}