From 4e1aa01fae4854d8c5e31ee698f9576acb3165d9 Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Mon, 15 Jan 2024 21:40:08 +0100 Subject: [PATCH] Ally Controller Settings --- app/Ally/AllyControl.cs | 22 +- app/Handheld.Designer.cs | 631 ++++++++++++++++++++++++++ app/Handheld.cs | 132 ++++++ app/Handheld.resx | 120 +++++ app/Properties/Resources.Designer.cs | 10 + app/Properties/Resources.resx | 15 +- app/Resources/icons8-soonvibes-32.png | Bin 0 -> 773 bytes app/Settings.Designer.cs | 156 ++++--- app/Settings.cs | 32 +- app/Updates.cs | 1 - 10 files changed, 1039 insertions(+), 80 deletions(-) create mode 100644 app/Handheld.Designer.cs create mode 100644 app/Handheld.cs create mode 100644 app/Handheld.resx create mode 100644 app/Resources/icons8-soonvibes-32.png diff --git a/app/Ally/AllyControl.cs b/app/Ally/AllyControl.cs index 5ffeb670..26261900 100644 --- a/app/Ally/AllyControl.cs +++ b/app/Ally/AllyControl.cs @@ -103,9 +103,27 @@ namespace GHelper.Ally settings.VisualiseBacklight(InputDispatcher.GetBacklight()); } - private void Deadzones() + static public void Deadzones() { - AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 4, 4, 0, 100, 0, 100 }, "ControllerDeadzone"); + AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 4, 4, + (byte)AppConfig.Get("ls_min", 0), + (byte)AppConfig.Get("ls_max", 100), + (byte)AppConfig.Get("rs_min", 0), + (byte)AppConfig.Get("rs_max", 100) }, + "StickDeadzone"); + + AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 5, 4, + (byte)AppConfig.Get("lt_min", 0), + (byte)AppConfig.Get("lt_max", 100), + (byte)AppConfig.Get("rt_min", 0), + (byte)AppConfig.Get("rt_max", 100) }, + "TriggerDeadzone"); + + AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 6, 2, + (byte)AppConfig.Get("vibra", 100), + (byte)AppConfig.Get("vibra", 100) }, + "Vibration"); + } private void SetMode(ControllerMode mode) diff --git a/app/Handheld.Designer.cs b/app/Handheld.Designer.cs new file mode 100644 index 00000000..dcbbd8d9 --- /dev/null +++ b/app/Handheld.Designer.cs @@ -0,0 +1,631 @@ +namespace GHelper +{ + partial class Handheld + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + panelController = new Panel(); + buttonReset = new UI.RButton(); + panelVibra = new Panel(); + labelVibra = new Label(); + labelVibraTitle = new Label(); + trackVibra = new TrackBar(); + panelVibrationTitle = new Panel(); + pictureVibration = new PictureBox(); + labelVibraHeader = new Label(); + panelRT = new Panel(); + trackRTMax = new TrackBar(); + labelRT = new Label(); + trackRTMin = new TrackBar(); + labelRTTitle = new Label(); + panelLT = new Panel(); + trackLTMax = new TrackBar(); + labelLT = new Label(); + trackLTMin = new TrackBar(); + labelLTTitle = new Label(); + panelTDeadzone = new Panel(); + pictureTDeadzone = new PictureBox(); + labelTDeadzone = new Label(); + panelRS = new Panel(); + trackRSMax = new TrackBar(); + labelRS = new Label(); + trackRSMin = new TrackBar(); + labelRSTitle = new Label(); + panelLS = new Panel(); + trackLSMax = new TrackBar(); + labelLS = new Label(); + trackLSMin = new TrackBar(); + labelLSTitle = new Label(); + panelSDeadzone = new Panel(); + pictureSDeadzone = new PictureBox(); + labelSDeadzone = new Label(); + panelController.SuspendLayout(); + panelVibra.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)trackVibra).BeginInit(); + panelVibrationTitle.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureVibration).BeginInit(); + panelRT.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)trackRTMax).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackRTMin).BeginInit(); + panelLT.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)trackLTMax).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackLTMin).BeginInit(); + panelTDeadzone.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureTDeadzone).BeginInit(); + panelRS.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)trackRSMax).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackRSMin).BeginInit(); + panelLS.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)trackLSMax).BeginInit(); + ((System.ComponentModel.ISupportInitialize)trackLSMin).BeginInit(); + panelSDeadzone.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureSDeadzone).BeginInit(); + SuspendLayout(); + // + // panelController + // + panelController.AutoSize = true; + panelController.Controls.Add(buttonReset); + panelController.Controls.Add(panelVibra); + panelController.Controls.Add(panelVibrationTitle); + panelController.Controls.Add(panelRT); + panelController.Controls.Add(panelLT); + panelController.Controls.Add(panelTDeadzone); + panelController.Controls.Add(panelRS); + panelController.Controls.Add(panelLS); + panelController.Controls.Add(panelSDeadzone); + panelController.Dock = DockStyle.Left; + panelController.Location = new Point(10, 10); + panelController.Margin = new Padding(4); + panelController.MinimumSize = new Size(560, 800); + panelController.Name = "panelController"; + panelController.Padding = new Padding(0, 0, 0, 18); + panelController.Size = new Size(560, 920); + panelController.TabIndex = 45; + // + // buttonReset + // + buttonReset.Activated = false; + buttonReset.Anchor = AnchorStyles.Bottom | AnchorStyles.Left; + buttonReset.BackColor = SystemColors.ControlLight; + buttonReset.BorderColor = Color.Transparent; + buttonReset.BorderRadius = 2; + buttonReset.FlatStyle = FlatStyle.Flat; + buttonReset.Location = new Point(20, 850); + buttonReset.Margin = new Padding(4, 2, 4, 2); + buttonReset.Name = "buttonReset"; + buttonReset.Secondary = true; + buttonReset.Size = new Size(224, 50); + buttonReset.TabIndex = 54; + buttonReset.Text = "Reset"; + buttonReset.UseVisualStyleBackColor = false; + // + // panelVibra + // + panelVibra.AutoSize = true; + panelVibra.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelVibra.Controls.Add(labelVibra); + panelVibra.Controls.Add(labelVibraTitle); + panelVibra.Controls.Add(trackVibra); + panelVibra.Dock = DockStyle.Top; + panelVibra.Location = new Point(0, 676); + panelVibra.Margin = new Padding(4); + panelVibra.MaximumSize = new Size(0, 124); + panelVibra.Name = "panelVibra"; + panelVibra.Size = new Size(560, 124); + panelVibra.TabIndex = 46; + // + // labelVibra + // + labelVibra.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelVibra.Location = new Point(408, 14); + labelVibra.Margin = new Padding(4, 0, 4, 0); + labelVibra.Name = "labelVibra"; + labelVibra.Size = new Size(124, 32); + labelVibra.TabIndex = 44; + labelVibra.Text = "100%"; + labelVibra.TextAlign = ContentAlignment.TopRight; + // + // labelVibraTitle + // + labelVibraTitle.AutoSize = true; + labelVibraTitle.Location = new Point(10, 14); + labelVibraTitle.Margin = new Padding(4, 0, 4, 0); + labelVibraTitle.Name = "labelVibraTitle"; + labelVibraTitle.Size = new Size(209, 32); + labelVibraTitle.TabIndex = 43; + labelVibraTitle.Text = "Vibration Strength"; + // + // trackVibra + // + trackVibra.Location = new Point(6, 48); + trackVibra.Margin = new Padding(4, 2, 4, 2); + trackVibra.Maximum = 100; + trackVibra.Name = "trackVibra"; + trackVibra.Size = new Size(546, 90); + trackVibra.TabIndex = 42; + trackVibra.TickFrequency = 5; + trackVibra.TickStyle = TickStyle.TopLeft; + trackVibra.Value = 100; + // + // panelVibrationTitle + // + panelVibrationTitle.AutoSize = true; + panelVibrationTitle.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelVibrationTitle.Controls.Add(pictureVibration); + panelVibrationTitle.Controls.Add(labelVibraHeader); + panelVibrationTitle.Dock = DockStyle.Top; + panelVibrationTitle.Location = new Point(0, 616); + panelVibrationTitle.Margin = new Padding(4); + panelVibrationTitle.Name = "panelVibrationTitle"; + panelVibrationTitle.Size = new Size(560, 60); + panelVibrationTitle.TabIndex = 53; + // + // pictureVibration + // + pictureVibration.BackgroundImage = Properties.Resources.icons8_soonvibes_32; + pictureVibration.BackgroundImageLayout = ImageLayout.Zoom; + pictureVibration.ErrorImage = null; + pictureVibration.InitialImage = null; + pictureVibration.Location = new Point(10, 18); + pictureVibration.Margin = new Padding(4, 2, 4, 10); + pictureVibration.Name = "pictureVibration"; + pictureVibration.Size = new Size(32, 32); + pictureVibration.TabIndex = 41; + pictureVibration.TabStop = false; + // + // labelVibraHeader + // + labelVibraHeader.AutoSize = true; + labelVibraHeader.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelVibraHeader.Location = new Point(45, 17); + labelVibraHeader.Margin = new Padding(4, 0, 4, 0); + labelVibraHeader.Name = "labelVibraHeader"; + labelVibraHeader.Size = new Size(121, 32); + labelVibraHeader.TabIndex = 40; + labelVibraHeader.Text = "Vibration"; + // + // panelRT + // + panelRT.AutoSize = true; + panelRT.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelRT.Controls.Add(trackRTMax); + panelRT.Controls.Add(labelRT); + panelRT.Controls.Add(trackRTMin); + panelRT.Controls.Add(labelRTTitle); + panelRT.Dock = DockStyle.Top; + panelRT.Location = new Point(0, 492); + panelRT.Margin = new Padding(4); + panelRT.MaximumSize = new Size(0, 124); + panelRT.Name = "panelRT"; + panelRT.Size = new Size(560, 124); + panelRT.TabIndex = 50; + // + // trackRTMax + // + trackRTMax.Location = new Point(272, 48); + trackRTMax.Margin = new Padding(4, 2, 4, 2); + trackRTMax.Maximum = 100; + trackRTMax.Minimum = 50; + trackRTMax.Name = "trackRTMax"; + trackRTMax.RightToLeft = RightToLeft.No; + trackRTMax.Size = new Size(280, 90); + trackRTMax.TabIndex = 30; + trackRTMax.TickFrequency = 5; + trackRTMax.TickStyle = TickStyle.TopLeft; + trackRTMax.Value = 100; + // + // labelRT + // + labelRT.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelRT.Location = new Point(363, 13); + labelRT.Margin = new Padding(4, 0, 4, 0); + labelRT.Name = "labelRT"; + labelRT.Size = new Size(176, 32); + labelRT.TabIndex = 29; + labelRT.Text = "0 - 100%"; + labelRT.TextAlign = ContentAlignment.TopRight; + // + // trackRTMin + // + trackRTMin.LargeChange = 100; + trackRTMin.Location = new Point(6, 48); + trackRTMin.Margin = new Padding(4, 2, 4, 2); + trackRTMin.Maximum = 50; + trackRTMin.Name = "trackRTMin"; + trackRTMin.RightToLeft = RightToLeft.No; + trackRTMin.Size = new Size(280, 90); + trackRTMin.SmallChange = 10; + trackRTMin.TabIndex = 18; + trackRTMin.TickFrequency = 5; + trackRTMin.TickStyle = TickStyle.TopLeft; + // + // labelRTTitle + // + labelRTTitle.AutoSize = true; + labelRTTitle.Location = new Point(10, 16); + labelRTTitle.Margin = new Padding(4, 0, 4, 0); + labelRTTitle.Name = "labelRTTitle"; + labelRTTitle.Size = new Size(151, 32); + labelRTTitle.TabIndex = 17; + labelRTTitle.Text = "Right Trigger"; + // + // panelLT + // + panelLT.AutoSize = true; + panelLT.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelLT.Controls.Add(trackLTMax); + panelLT.Controls.Add(labelLT); + panelLT.Controls.Add(trackLTMin); + panelLT.Controls.Add(labelLTTitle); + panelLT.Dock = DockStyle.Top; + panelLT.Location = new Point(0, 368); + panelLT.Margin = new Padding(4); + panelLT.MaximumSize = new Size(0, 124); + panelLT.Name = "panelLT"; + panelLT.Size = new Size(560, 124); + panelLT.TabIndex = 51; + // + // trackLTMax + // + trackLTMax.Location = new Point(272, 48); + trackLTMax.Margin = new Padding(4, 2, 4, 2); + trackLTMax.Maximum = 100; + trackLTMax.Minimum = 50; + trackLTMax.Name = "trackLTMax"; + trackLTMax.RightToLeft = RightToLeft.No; + trackLTMax.Size = new Size(280, 90); + trackLTMax.TabIndex = 30; + trackLTMax.TickFrequency = 5; + trackLTMax.TickStyle = TickStyle.TopLeft; + trackLTMax.Value = 100; + // + // labelLT + // + labelLT.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelLT.Location = new Point(363, 13); + labelLT.Margin = new Padding(4, 0, 4, 0); + labelLT.Name = "labelLT"; + labelLT.Size = new Size(176, 32); + labelLT.TabIndex = 29; + labelLT.Text = "0 - 100%"; + labelLT.TextAlign = ContentAlignment.TopRight; + // + // trackLTMin + // + trackLTMin.LargeChange = 100; + trackLTMin.Location = new Point(6, 48); + trackLTMin.Margin = new Padding(4, 2, 4, 2); + trackLTMin.Maximum = 50; + trackLTMin.Name = "trackLTMin"; + trackLTMin.RightToLeft = RightToLeft.No; + trackLTMin.Size = new Size(280, 90); + trackLTMin.SmallChange = 10; + trackLTMin.TabIndex = 18; + trackLTMin.TickFrequency = 5; + trackLTMin.TickStyle = TickStyle.TopLeft; + // + // labelLTTitle + // + labelLTTitle.AutoSize = true; + labelLTTitle.Location = new Point(10, 16); + labelLTTitle.Margin = new Padding(4, 0, 4, 0); + labelLTTitle.Name = "labelLTTitle"; + labelLTTitle.Size = new Size(135, 32); + labelLTTitle.TabIndex = 17; + labelLTTitle.Text = "Left Trigger"; + // + // panelTDeadzone + // + panelTDeadzone.AutoSize = true; + panelTDeadzone.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelTDeadzone.Controls.Add(pictureTDeadzone); + panelTDeadzone.Controls.Add(labelTDeadzone); + panelTDeadzone.Dock = DockStyle.Top; + panelTDeadzone.Location = new Point(0, 308); + panelTDeadzone.Margin = new Padding(4); + panelTDeadzone.Name = "panelTDeadzone"; + panelTDeadzone.Size = new Size(560, 60); + panelTDeadzone.TabIndex = 52; + // + // pictureTDeadzone + // + pictureTDeadzone.BackgroundImage = Properties.Resources.icons8_controller_32; + pictureTDeadzone.BackgroundImageLayout = ImageLayout.Zoom; + pictureTDeadzone.ErrorImage = null; + pictureTDeadzone.InitialImage = null; + pictureTDeadzone.Location = new Point(10, 18); + pictureTDeadzone.Margin = new Padding(4, 2, 4, 10); + pictureTDeadzone.Name = "pictureTDeadzone"; + pictureTDeadzone.Size = new Size(32, 32); + pictureTDeadzone.TabIndex = 41; + pictureTDeadzone.TabStop = false; + // + // labelTDeadzone + // + labelTDeadzone.AutoSize = true; + labelTDeadzone.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelTDeadzone.Location = new Point(45, 17); + labelTDeadzone.Margin = new Padding(4, 0, 4, 0); + labelTDeadzone.Name = "labelTDeadzone"; + labelTDeadzone.Size = new Size(228, 32); + labelTDeadzone.TabIndex = 40; + labelTDeadzone.Text = "Trigger Deadzones"; + // + // panelRS + // + panelRS.AutoSize = true; + panelRS.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelRS.Controls.Add(trackRSMax); + panelRS.Controls.Add(labelRS); + panelRS.Controls.Add(trackRSMin); + panelRS.Controls.Add(labelRSTitle); + panelRS.Dock = DockStyle.Top; + panelRS.Location = new Point(0, 184); + panelRS.Margin = new Padding(4); + panelRS.MaximumSize = new Size(0, 124); + panelRS.Name = "panelRS"; + panelRS.Size = new Size(560, 124); + panelRS.TabIndex = 49; + // + // trackRSMax + // + trackRSMax.Location = new Point(272, 48); + trackRSMax.Margin = new Padding(4, 2, 4, 2); + trackRSMax.Maximum = 100; + trackRSMax.Minimum = 50; + trackRSMax.Name = "trackRSMax"; + trackRSMax.RightToLeft = RightToLeft.No; + trackRSMax.Size = new Size(280, 90); + trackRSMax.TabIndex = 30; + trackRSMax.TickFrequency = 5; + trackRSMax.TickStyle = TickStyle.TopLeft; + trackRSMax.Value = 100; + // + // labelRS + // + labelRS.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelRS.Location = new Point(363, 13); + labelRS.Margin = new Padding(4, 0, 4, 0); + labelRS.Name = "labelRS"; + labelRS.Size = new Size(176, 32); + labelRS.TabIndex = 29; + labelRS.Text = "0 - 100%"; + labelRS.TextAlign = ContentAlignment.TopRight; + // + // trackRSMin + // + trackRSMin.LargeChange = 100; + trackRSMin.Location = new Point(6, 48); + trackRSMin.Margin = new Padding(4, 2, 4, 2); + trackRSMin.Maximum = 50; + trackRSMin.Name = "trackRSMin"; + trackRSMin.RightToLeft = RightToLeft.No; + trackRSMin.Size = new Size(280, 90); + trackRSMin.SmallChange = 10; + trackRSMin.TabIndex = 18; + trackRSMin.TickFrequency = 5; + trackRSMin.TickStyle = TickStyle.TopLeft; + // + // labelRSTitle + // + labelRSTitle.AutoSize = true; + labelRSTitle.Location = new Point(10, 16); + labelRSTitle.Margin = new Padding(4, 0, 4, 0); + labelRSTitle.Name = "labelRSTitle"; + labelRSTitle.Size = new Size(126, 32); + labelRSTitle.TabIndex = 17; + labelRSTitle.Text = "Right Stick"; + // + // panelLS + // + panelLS.AutoSize = true; + panelLS.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelLS.Controls.Add(trackLSMax); + panelLS.Controls.Add(labelLS); + panelLS.Controls.Add(trackLSMin); + panelLS.Controls.Add(labelLSTitle); + panelLS.Dock = DockStyle.Top; + panelLS.Location = new Point(0, 60); + panelLS.Margin = new Padding(4); + panelLS.MaximumSize = new Size(0, 124); + panelLS.Name = "panelLS"; + panelLS.Size = new Size(560, 124); + panelLS.TabIndex = 48; + // + // trackLSMax + // + trackLSMax.Location = new Point(272, 48); + trackLSMax.Margin = new Padding(4, 2, 4, 2); + trackLSMax.Maximum = 100; + trackLSMax.Minimum = 50; + trackLSMax.Name = "trackLSMax"; + trackLSMax.RightToLeft = RightToLeft.No; + trackLSMax.Size = new Size(280, 90); + trackLSMax.TabIndex = 30; + trackLSMax.TickFrequency = 5; + trackLSMax.TickStyle = TickStyle.TopLeft; + trackLSMax.Value = 100; + // + // labelLS + // + labelLS.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelLS.Location = new Point(363, 13); + labelLS.Margin = new Padding(4, 0, 4, 0); + labelLS.Name = "labelLS"; + labelLS.Size = new Size(176, 32); + labelLS.TabIndex = 29; + labelLS.Text = "0 - 100%"; + labelLS.TextAlign = ContentAlignment.TopRight; + // + // trackLSMin + // + trackLSMin.LargeChange = 100; + trackLSMin.Location = new Point(6, 48); + trackLSMin.Margin = new Padding(4, 2, 4, 2); + trackLSMin.Maximum = 50; + trackLSMin.Name = "trackLSMin"; + trackLSMin.RightToLeft = RightToLeft.No; + trackLSMin.Size = new Size(280, 90); + trackLSMin.SmallChange = 10; + trackLSMin.TabIndex = 18; + trackLSMin.TickFrequency = 5; + trackLSMin.TickStyle = TickStyle.TopLeft; + // + // labelLSTitle + // + labelLSTitle.AutoSize = true; + labelLSTitle.Location = new Point(10, 16); + labelLSTitle.Margin = new Padding(4, 0, 4, 0); + labelLSTitle.Name = "labelLSTitle"; + labelLSTitle.Size = new Size(110, 32); + labelLSTitle.TabIndex = 17; + labelLSTitle.Text = "Left Stick"; + // + // panelSDeadzone + // + panelSDeadzone.AutoSize = true; + panelSDeadzone.AutoSizeMode = AutoSizeMode.GrowAndShrink; + panelSDeadzone.Controls.Add(pictureSDeadzone); + panelSDeadzone.Controls.Add(labelSDeadzone); + panelSDeadzone.Dock = DockStyle.Top; + panelSDeadzone.Location = new Point(0, 0); + panelSDeadzone.Margin = new Padding(4); + panelSDeadzone.Name = "panelSDeadzone"; + panelSDeadzone.Size = new Size(560, 60); + panelSDeadzone.TabIndex = 43; + // + // pictureSDeadzone + // + pictureSDeadzone.BackgroundImage = Properties.Resources.icons8_controller_32; + pictureSDeadzone.BackgroundImageLayout = ImageLayout.Zoom; + pictureSDeadzone.ErrorImage = null; + pictureSDeadzone.InitialImage = null; + pictureSDeadzone.Location = new Point(10, 18); + pictureSDeadzone.Margin = new Padding(4, 2, 4, 10); + pictureSDeadzone.Name = "pictureSDeadzone"; + pictureSDeadzone.Size = new Size(32, 32); + pictureSDeadzone.TabIndex = 41; + pictureSDeadzone.TabStop = false; + // + // labelSDeadzone + // + labelSDeadzone.AutoSize = true; + labelSDeadzone.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point); + labelSDeadzone.Location = new Point(45, 17); + labelSDeadzone.Margin = new Padding(4, 0, 4, 0); + labelSDeadzone.Name = "labelSDeadzone"; + labelSDeadzone.Size = new Size(199, 32); + labelSDeadzone.TabIndex = 40; + labelSDeadzone.Text = "Stick Deadzones"; + // + // Handheld + // + AutoScaleDimensions = new SizeF(13F, 32F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(1293, 940); + Controls.Add(panelController); + MaximizeBox = false; + MinimizeBox = false; + Name = "Handheld"; + Padding = new Padding(10); + ShowIcon = false; + ShowInTaskbar = false; + Text = "Controller"; + panelController.ResumeLayout(false); + panelController.PerformLayout(); + panelVibra.ResumeLayout(false); + panelVibra.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)trackVibra).EndInit(); + panelVibrationTitle.ResumeLayout(false); + panelVibrationTitle.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)pictureVibration).EndInit(); + panelRT.ResumeLayout(false); + panelRT.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)trackRTMax).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackRTMin).EndInit(); + panelLT.ResumeLayout(false); + panelLT.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)trackLTMax).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackLTMin).EndInit(); + panelTDeadzone.ResumeLayout(false); + panelTDeadzone.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)pictureTDeadzone).EndInit(); + panelRS.ResumeLayout(false); + panelRS.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)trackRSMax).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackRSMin).EndInit(); + panelLS.ResumeLayout(false); + panelLS.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)trackLSMax).EndInit(); + ((System.ComponentModel.ISupportInitialize)trackLSMin).EndInit(); + panelSDeadzone.ResumeLayout(false); + panelSDeadzone.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)pictureSDeadzone).EndInit(); + ResumeLayout(false); + PerformLayout(); + } + + #endregion + + private Panel panelController; + private Panel panelVibra; + private Label labelVibra; + private Label labelVibraTitle; + private TrackBar trackVibra; + private Panel panelLS; + private TrackBar trackLSMax; + private Label labelLS; + private TrackBar trackLSMin; + private Label labelLSTitle; + private Panel panelSDeadzone; + private PictureBox pictureSDeadzone; + private Label labelSDeadzone; + private Panel panelRS; + private TrackBar trackRSMax; + private Label labelRS; + private TrackBar trackRSMin; + private Label labelRSTitle; + private Panel panelRT; + private TrackBar trackRTMax; + private Label labelRT; + private TrackBar trackRTMin; + private Label labelRTTitle; + private Panel panelLT; + private TrackBar trackLTMax; + private Label labelLT; + private TrackBar trackLTMin; + private Label labelLTTitle; + private Panel panelTDeadzone; + private PictureBox pictureTDeadzone; + private Label labelTDeadzone; + private Panel panelVibrationTitle; + private PictureBox pictureVibration; + private Label labelVibraHeader; + private UI.RButton buttonReset; + } +} \ No newline at end of file diff --git a/app/Handheld.cs b/app/Handheld.cs new file mode 100644 index 00000000..5d881b4d --- /dev/null +++ b/app/Handheld.cs @@ -0,0 +1,132 @@ +using GHelper.UI; +using GHelper.Ally; + +namespace GHelper +{ + public partial class Handheld : RForm + { + public Handheld() + { + InitializeComponent(); + InitTheme(true); + + Shown += Handheld_Shown; + + Init(); + + trackLSMin.Scroll += Controller_Scroll; + trackLSMax.Scroll += Controller_Scroll; + trackRSMin.Scroll += Controller_Scroll; + trackRSMax.Scroll += Controller_Scroll; + + trackLTMin.Scroll += Controller_Scroll; + trackLTMax.Scroll += Controller_Scroll; + trackRTMin.Scroll += Controller_Scroll; + trackRTMax.Scroll += Controller_Scroll; + + trackVibra.Scroll += Controller_Scroll; + + buttonReset.Click += ButtonReset_Click; + + trackLSMin.ValueChanged += Controller_Complete; ; + trackLSMax.ValueChanged += Controller_Complete; + trackRSMin.ValueChanged += Controller_Complete; + trackRSMax.ValueChanged += Controller_Complete; + + trackLTMin.ValueChanged += Controller_Complete; + trackLTMax.ValueChanged += Controller_Complete; + trackRTMin.ValueChanged += Controller_Complete; + trackRTMax.ValueChanged += Controller_Complete; + + trackVibra.ValueChanged += Controller_Complete; + + } + + private void Controller_Complete(object? sender, EventArgs e) + { + AllyControl.Deadzones(); + } + + private void ButtonReset_Click(object? sender, EventArgs e) + { + trackLSMin.Value = 0; + trackLSMax.Value = 100; + trackRSMin.Value = 0; + trackRSMax.Value = 100; + + trackLTMin.Value = 0; + trackLTMax.Value = 100; + trackRTMin.Value = 0; + trackRTMax.Value = 100; + + trackVibra.Value = 100; + + AppConfig.Remove("ls_min"); + AppConfig.Remove("ls_max"); + AppConfig.Remove("rs_min"); + AppConfig.Remove("rs_max"); + + AppConfig.Remove("lt_min"); + AppConfig.Remove("lt_max"); + AppConfig.Remove("rt_min"); + AppConfig.Remove("rt_max"); + AppConfig.Remove("vibra"); + + VisualiseController(); + + } + + private void Init() + { + trackLSMin.Value = AppConfig.Get("ls_min", 0); + trackLSMax.Value = AppConfig.Get("ls_max", 100); + trackRSMin.Value = AppConfig.Get("rs_min", 0); + trackRSMax.Value = AppConfig.Get("rs_max", 100); + + trackLTMin.Value = AppConfig.Get("lt_min", 0); + trackLTMax.Value = AppConfig.Get("lt_max", 100); + trackRTMin.Value = AppConfig.Get("rt_min", 0); + trackRTMax.Value = AppConfig.Get("rt_max", 100); + + trackVibra.Value = AppConfig.Get("vibra", 100); + + VisualiseController(); + } + + private void VisualiseController() + { + labelLS.Text = $"{trackLSMin.Value} - {trackLSMax.Value}%"; + labelRS.Text = $"{trackRSMin.Value} - {trackRSMax.Value}%"; + + labelLT.Text = $"{trackLTMin.Value} - {trackLTMax.Value}%"; + labelRT.Text = $"{trackRTMin.Value} - {trackRTMax.Value}%"; + + labelVibra.Text = $"{trackVibra.Value}%"; + } + + private void Controller_Scroll(object? sender, EventArgs e) + { + AppConfig.Set("ls_min", trackLSMin.Value); + AppConfig.Set("ls_max", trackLSMax.Value); + AppConfig.Set("rs_min", trackRSMin.Value); + AppConfig.Set("rs_max", trackRSMax.Value); + + AppConfig.Set("lt_min", trackLTMin.Value); + AppConfig.Set("lt_max", trackLTMax.Value); + AppConfig.Set("rt_min", trackRTMin.Value); + AppConfig.Set("rt_max", trackRTMax.Value); + + AppConfig.Set("vibra", trackVibra.Value); + + VisualiseController(); + + } + + private void Handheld_Shown(object? sender, EventArgs e) + { + Height = Program.settingsForm.Height; + Top = Program.settingsForm.Top; + Left = Program.settingsForm.Left - Width - 5; + } + } +} diff --git a/app/Handheld.resx b/app/Handheld.resx new file mode 100644 index 00000000..af32865e --- /dev/null +++ b/app/Handheld.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/app/Properties/Resources.Designer.cs b/app/Properties/Resources.Designer.cs index 4fe184b7..63e17c92 100644 --- a/app/Properties/Resources.Designer.cs +++ b/app/Properties/Resources.Designer.cs @@ -560,6 +560,16 @@ namespace GHelper.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icons8_soonvibes_32 { + get { + object obj = ResourceManager.GetObject("icons8-soonvibes-32", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/app/Properties/Resources.resx b/app/Properties/Resources.resx index 83108d59..f46881bd 100644 --- a/app/Properties/Resources.resx +++ b/app/Properties/Resources.resx @@ -118,6 +118,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\icons8-charging-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\brightness-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -151,8 +154,8 @@ ..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\dot-standard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\icons8-controller-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\icons8-charging-battery-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -205,8 +208,8 @@ ..\Resources\icons8-batterie-voll-geladen-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\icons8-charging-battery-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\dot-standard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a ..\Resources\eco.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -301,7 +304,7 @@ ..\Resources\icons8-rocket-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\icons8-controller-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\icons8-soonvibes-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/app/Resources/icons8-soonvibes-32.png b/app/Resources/icons8-soonvibes-32.png new file mode 100644 index 0000000000000000000000000000000000000000..046f9b1ff56a6f222a22492233bc203f86e794be GIT binary patch literal 773 zcmV+g1N!`lP)GrV2a!_uHk_qPbQM`z>}9LQs&L5(ec0#Glno3t@>|1pS|}v``G7UR;~Kh z+W)owYp?y?HViTu3M>Zp0jGf5QXB6D77CNPOara~AAo@Z`d--DG>FFmmw_Ke5c_H| z7lB-<(Uy>Uahwa?01T3SB?hd zL>z``{X-AConWiDMw6!l=o03cgP8{$aO`IJ0^6`?>+Mjk8s!c!yW9endDXW74`u%Z zMgzBG+oT%~+;d{?%GV>?uwxWEpj<7=9l8vw3fy*Va&FQ1954d-oP<&za>A9OU8P*h1F25o$HeB< zf6G+hs(!l)5qInKn?e~R11!)1