Merge branch 'seerge:main' into main

This commit is contained in:
IceStormNG
2024-01-13 11:21:13 +01:00
committed by GitHub
14 changed files with 339 additions and 111 deletions

View File

@@ -1,39 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
---
## NOTE
Bug reports without clear information or scenario to reproduce and logs from ``%AppData%\GHelper`` will be closed without answer. Please respect the time of the developer. Thanks.
**Describe the bug**
A clear and concise description of what the bug is.
**Clear scenario to Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. Explanation of an error or a bug
**Expected behavior**
A clear and concise description of what you expected to happen.
**App Logs**
Please include and attach log.txt from ``%AppData%\GHelper``
**Screenshots or screencasts**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. Windows 11]
- Laptop model
**Asus software**
- Armoury Crate (or it's services installed)
- MyASUS installed
- Other Asus services running in background
**Additional context**
Add any other context about the problem here.

82
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,82 @@
name: Bug Report
description: Something isn't working correctly
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report. The more information you provide, the easier it will be for me to fix it!
- type: checkboxes
id: rules
attributes:
label: Rules
options:
- label: I made myself familiar with the <a href='https://github.com/seerge/g-helper?tab=readme-ov-file'>Readme</a>, <a href='https://github.com/seerge/g-helper/wiki/FAQ'>FAQ</a> and <a href='https://github.com/seerge/g-helper/wiki/Troubleshooting'>Troubleshooting</a>.
required: true
- label: I understand that, if insufficient information was provided, my issue will be closed without an answer.
required: true
validations:
required: true
- type: textarea
id: description
attributes:
label: What's wrong?
description: Provide detailed description of what is wrong or does not work as expected.
placeholder: Provide detailed description of what is wrong or does not work as expected.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: How to reproduce the bug?
description: Describe how to reproduce the behavior. Be as specific as possible and provide as many details as possible.
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs
placeholder: Please drag and drop complete log file from ``%APPDATA%\GHelper\log.txt``
description: Please drag and drop complete log file from ``%APPDATA%\GHelper\log.txt``
validations:
required: true
- type: input
id: device
attributes:
label: Device and Model
description: Which laptop do you use?
placeholder: e.g. Asus Zephyrus G14 GA404RK
validations:
required: true
- type: textarea
id: additional
attributes:
label: Additional information.
description: If applicable, add screenshots or other relevant information to help explain your problem.
- type: checkboxes
id: asus
attributes:
label: Asus Software
description: Please check what Asus/Armoury Services do you have installed and running
options:
- label: Armoury Crate
- label: MyAsus
- label: Other Asus Services
- type: input
id: version
attributes:
label: Version
description: G-Helper version?
placeholder: e.g. 0.146
- type: input
id: os
attributes:
label: OS
description: Which operating system do you use?
placeholder: e.g. Windows 11 21H2

52
app/Ally/AllyControl.cs Normal file
View File

@@ -0,0 +1,52 @@
using GHelper.USB;
namespace GHelper.Ally
{
public enum ControllerMode : int
{
Gamepad = 1,
WASD = 2,
Mouse = 3,
}
public class AllyControl
{
SettingsForm settings;
ControllerMode mode = ControllerMode.Gamepad;
public AllyControl(SettingsForm settingsForm)
{
settings = settingsForm;
}
public void Init()
{
if (!AppConfig.IsAlly())
{
settings.VisualiseAlly(false);
return;
}
mode = (ControllerMode)AppConfig.Get("controller_mode", (int)ControllerMode.Gamepad);
SetMode(mode);
}
private void SetMode(ControllerMode mode)
{
AppConfig.Set("controller_mode", (int)mode);
AsusHid.WriteInput(new byte[] { AsusHid.INPUT_ID, 0xd1, 1, 1, (byte)mode }, "ControllerMode");
settings.VisualiseController(mode);
}
public void ToggleMode()
{
if (mode == ControllerMode.Mouse)
mode = ControllerMode.Gamepad;
else
mode++;
SetMode(mode);
}
}
}

View File

@@ -384,7 +384,7 @@ public static class AppConfig
public static bool IsStrixLimitedRGB()
{
return ContainsModel("G614JV") || ContainsModel("G614JZ") || ContainsModel("G512LI") || ContainsModel("G513R") || ContainsModel("G713PV") || ContainsModel("G513IE") || ContainsModel("G713RC") || ContainsModel("G513QM");
return (ContainsModel("G614JV") || ContainsModel("G614JZ") || ContainsModel("G512LI") || ContainsModel("G513R") || ContainsModel("G713PV") || ContainsModel("G513IE") || ContainsModel("G713RC") || ContainsModel("G513QM")) && !Is("per_key_rgb");
}
public static bool IsNoDirectRGB()
@@ -490,6 +490,11 @@ public static class AppConfig
return ContainsModel("FA507");
}
public static bool IsIntelHX()
{
return ContainsModel("G814") || ContainsModel("G614") || ContainsModel("G834") || ContainsModel("G634");
}
public static bool IsASUS()
{
return ContainsModel("ROG") || ContainsModel("TUF") || ContainsModel("Vivobook") || ContainsModel("Zenbook");

View File

@@ -259,6 +259,11 @@ public class AsusACPI
DefaultTotal = 30;
}
if (AppConfig.IsIntelHX())
{
MaxTotal = 175;
}
if (AppConfig.DynamicBoost5())
{
MaxGPUBoost = 5;

View File

@@ -1,4 +1,5 @@
using System.Diagnostics;
using GHelper.Helpers;
using System.Diagnostics;
using System.Net;
using System.Reflection;
using System.Text.Json;
@@ -130,6 +131,7 @@ namespace GHelper.AutoUpdate
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.FileName = "powershell";
cmd.StartInfo.Arguments = command;
if (ProcessHelper.IsUserAdministrator()) cmd.StartInfo.Verb = "runas";
cmd.Start();
}
catch (Exception ex)

View File

@@ -15,7 +15,7 @@
<PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.146</AssemblyVersion>
<AssemblyVersion>0.147</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -1,7 +1,4 @@
using Microsoft.Win32;
using System.Diagnostics;
using System.Text;
using System.Text.RegularExpressions;
using System.Diagnostics;
namespace GHelper.Helpers
{
@@ -21,35 +18,6 @@ namespace GHelper.Helpers
"AsusCertService"
};
public static void SetChargeLimit(int newValue)
{
// Set the path to the .ini file
string path = @"C:\ProgramData\ASUS\ASUS System Control Interface\ASUSOptimization\Customization.ini";
// Make a backup copy of the INI file
string backupPath = path + ".bak";
File.Copy(path, backupPath, true);
string fileContents = File.ReadAllText(path, Encoding.Unicode);
// Find the section [BatteryHealthCharging]
string sectionPattern = @"\[BatteryHealthCharging\]\s*(version=\d+)?\s+value=(\d+)";
Match sectionMatch = Regex.Match(fileContents, sectionPattern);
if (sectionMatch.Success)
{
// Replace the value with the new value
string oldValueString = sectionMatch.Groups[2].Value;
int oldValue = int.Parse(oldValueString);
string newSection = sectionMatch.Value.Replace($"value={oldValue}", $"value={newValue}");
// Replace the section in the file contents
fileContents = fileContents.Replace(sectionMatch.Value, newSection);
File.WriteAllText(path, fileContents, Encoding.Unicode);
}
}
public static bool IsRunning()
{
return Process.GetProcessesByName("AsusOptimization").Count() > 0;
@@ -72,25 +40,6 @@ namespace GHelper.Helpers
}
public static void SetBacklightOffDelay(int value = 60)
{
try
{
RegistryKey myKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ASUS\ASUS System Control Interface\AsusOptimization\ASUS Keyboard Hotkeys", true);
if (myKey != null)
{
myKey.SetValue("TurnOffKeybdLight", value, RegistryValueKind.DWord);
myKey.Close();
}
}
catch (Exception ex)
{
Logger.WriteLine(ex.Message);
}
}
public static void StopAsusServices()
{
foreach (string service in services)

View File

@@ -1,3 +1,4 @@
using GHelper.Ally;
using GHelper.Battery;
using GHelper.Display;
using GHelper.Gpu;
@@ -5,6 +6,8 @@ using GHelper.Helpers;
using GHelper.Input;
using GHelper.Mode;
using GHelper.Peripherals;
using GHelper.USB;
using Microsoft.VisualBasic.Logging;
using Microsoft.Win32;
using Ryzen;
using System.Diagnostics;
@@ -30,6 +33,7 @@ namespace GHelper
public static ModeControl modeControl = new ModeControl();
public static GPUModeControl gpuControl = new GPUModeControl(settingsForm);
public static AllyControl controllerControl = new AllyControl(settingsForm);
public static ScreenControl screenControl = new ScreenControl();
public static ClamshellModeControl clamshellControl = new ClamshellModeControl();
@@ -225,6 +229,8 @@ namespace GHelper
settingsForm.AutoKeyboard();
settingsForm.matrixControl.SetMatrix(true);
controllerControl.Init();
}
private static void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e)

View File

@@ -220,6 +220,16 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icons8_controller_32 {
get {
object obj = ResourceManager.GetObject("icons8-controller-32", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@@ -133,6 +133,9 @@
<data name="icons8-hibernate-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-hibernate-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="MFont" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Font.otf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="icons8-quit-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-quit-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -148,6 +151,9 @@
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="dot_standard" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\dot-standard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-charging-battery-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-charging-battery-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -214,6 +220,9 @@
<data name="icons8-rocket-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-rocket-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="dot_ultimate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\dot-ultimate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_edit_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-edit-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -277,6 +286,9 @@
<data name="icons8-settings-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-settings-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="dot_eco" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\dot-eco.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_processor_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-processor-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -289,16 +301,7 @@
<data name="icons8_rocket_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-rocket-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="MFont" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Font.otf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="dot_eco" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\dot-eco.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="dot_standard" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\dot-standard.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="dot_ultimate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\dot-ultimate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="icons8-controller-32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-controller-32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

132
app/Settings.Designer.cs generated
View File

@@ -108,6 +108,13 @@ namespace GHelper
panelPeripheralsTile = new Panel();
picturePeripherals = new PictureBox();
labelPeripherals = new Label();
panelAlly = new Panel();
label1 = new Label();
tableLayoutAlly = new TableLayoutPanel();
buttonController = new RButton();
panelAllyTitle = new Panel();
pictureAlly = new PictureBox();
labelAlly = new Label();
panelMatrix.SuspendLayout();
tableLayoutMatrix.SuspendLayout();
panelMatrixTitle.SuspendLayout();
@@ -141,6 +148,10 @@ namespace GHelper
tableLayoutPeripherals.SuspendLayout();
panelPeripheralsTile.SuspendLayout();
((System.ComponentModel.ISupportInitialize)picturePeripherals).BeginInit();
panelAlly.SuspendLayout();
tableLayoutAlly.SuspendLayout();
panelAllyTitle.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureAlly).BeginInit();
SuspendLayout();
//
// panelMatrix
@@ -282,7 +293,7 @@ namespace GHelper
panelBattery.Controls.Add(sliderBattery);
panelBattery.Controls.Add(panelBatteryTitle);
panelBattery.Dock = DockStyle.Top;
panelBattery.Location = new Point(11, 1265);
panelBattery.Location = new Point(11, 1441);
panelBattery.Margin = new Padding(0);
panelBattery.Name = "panelBattery";
panelBattery.Padding = new Padding(20, 20, 20, 10);
@@ -374,7 +385,7 @@ namespace GHelper
panelFooter.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelFooter.Controls.Add(tableButtons);
panelFooter.Dock = DockStyle.Top;
panelFooter.Location = new Point(11, 1440);
panelFooter.Location = new Point(11, 1616);
panelFooter.Margin = new Padding(0);
panelFooter.Name = "panelFooter";
panelFooter.Padding = new Padding(20);
@@ -1232,7 +1243,7 @@ namespace GHelper
panelVersion.Controls.Add(labelCharge);
panelVersion.Controls.Add(checkStartup);
panelVersion.Dock = DockStyle.Top;
panelVersion.Location = new Point(11, 1384);
panelVersion.Location = new Point(11, 1560);
panelVersion.Margin = new Padding(4);
panelVersion.Name = "panelVersion";
panelVersion.Size = new Size(827, 56);
@@ -1257,7 +1268,7 @@ namespace GHelper
panelPeripherals.Controls.Add(tableLayoutPeripherals);
panelPeripherals.Controls.Add(panelPeripheralsTile);
panelPeripherals.Dock = DockStyle.Top;
panelPeripherals.Location = new Point(11, 1067);
panelPeripherals.Location = new Point(11, 1243);
panelPeripherals.Margin = new Padding(0);
panelPeripherals.Name = "panelPeripherals";
panelPeripherals.Padding = new Padding(20, 20, 20, 10);
@@ -1391,17 +1402,115 @@ namespace GHelper
labelPeripherals.TabIndex = 40;
labelPeripherals.Text = "Peripherals";
//
// panelAlly
//
panelAlly.AccessibleRole = AccessibleRole.Grouping;
panelAlly.AutoSize = true;
panelAlly.AutoSizeMode = AutoSizeMode.GrowAndShrink;
panelAlly.Controls.Add(label1);
panelAlly.Controls.Add(tableLayoutAlly);
panelAlly.Controls.Add(panelAllyTitle);
panelAlly.Dock = DockStyle.Top;
panelAlly.Location = new Point(11, 1067);
panelAlly.Margin = new Padding(0);
panelAlly.Name = "panelAlly";
panelAlly.Padding = new Padding(20, 20, 20, 0);
panelAlly.Size = new Size(827, 176);
panelAlly.TabIndex = 8;
panelAlly.TabStop = true;
//
// label1
//
label1.Dock = DockStyle.Top;
label1.ForeColor = SystemColors.GrayText;
label1.Location = new Point(20, 140);
label1.Margin = new Padding(4, 0, 4, 0);
label1.Name = "label1";
label1.Size = new Size(787, 36);
label1.TabIndex = 24;
//
// tableLayoutAlly
//
tableLayoutAlly.AutoSize = true;
tableLayoutAlly.AutoSizeMode = AutoSizeMode.GrowAndShrink;
tableLayoutAlly.ColumnCount = 3;
tableLayoutAlly.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
tableLayoutAlly.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
tableLayoutAlly.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33F));
tableLayoutAlly.Controls.Add(buttonController, 0, 0);
tableLayoutAlly.Dock = DockStyle.Top;
tableLayoutAlly.Location = new Point(20, 60);
tableLayoutAlly.Margin = new Padding(8, 4, 8, 4);
tableLayoutAlly.Name = "tableLayoutAlly";
tableLayoutAlly.RowCount = 1;
tableLayoutAlly.RowStyles.Add(new RowStyle(SizeType.Absolute, 80F));
tableLayoutAlly.Size = new Size(787, 80);
tableLayoutAlly.TabIndex = 23;
//
// buttonController
//
buttonController.Activated = false;
buttonController.BackColor = SystemColors.ControlLightLight;
buttonController.BorderColor = Color.Transparent;
buttonController.BorderRadius = 5;
buttonController.Dock = DockStyle.Fill;
buttonController.FlatAppearance.BorderSize = 0;
buttonController.FlatStyle = FlatStyle.Flat;
buttonController.ForeColor = SystemColors.ControlText;
buttonController.Location = new Point(4, 4);
buttonController.Margin = new Padding(4);
buttonController.Name = "buttonController";
buttonController.Secondary = false;
buttonController.Size = new Size(254, 72);
buttonController.TabIndex = 9;
buttonController.Text = Properties.Strings.AutoMode;
buttonController.UseVisualStyleBackColor = false;
//
// panelAllyTitle
//
panelAllyTitle.Controls.Add(pictureAlly);
panelAllyTitle.Controls.Add(labelAlly);
panelAllyTitle.Dock = DockStyle.Top;
panelAllyTitle.Location = new Point(20, 20);
panelAllyTitle.Margin = new Padding(4);
panelAllyTitle.Name = "panelAllyTitle";
panelAllyTitle.Size = new Size(787, 40);
panelAllyTitle.TabIndex = 25;
//
// pictureAlly
//
pictureAlly.BackgroundImage = Properties.Resources.icons8_controller_32;
pictureAlly.BackgroundImageLayout = ImageLayout.Center;
pictureAlly.Location = new Point(5, 0);
pictureAlly.Margin = new Padding(4);
pictureAlly.Name = "pictureAlly";
pictureAlly.Size = new Size(32, 32);
pictureAlly.TabIndex = 27;
pictureAlly.TabStop = false;
//
// labelAlly
//
labelAlly.AutoSize = true;
labelAlly.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelAlly.Location = new Point(45, 0);
labelAlly.Margin = new Padding(8, 0, 8, 0);
labelAlly.Name = "labelAlly";
labelAlly.Size = new Size(58, 32);
labelAlly.TabIndex = 26;
labelAlly.Text = "Ally";
//
// SettingsForm
//
AutoScaleDimensions = new SizeF(192F, 192F);
AutoScaleMode = AutoScaleMode.Dpi;
AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink;
ClientSize = new Size(849, 1552);
ClientSize = new Size(849, 1717);
Controls.Add(panelFooter);
Controls.Add(panelVersion);
Controls.Add(panelBattery);
Controls.Add(panelPeripherals);
Controls.Add(panelAlly);
Controls.Add(panelKeyboard);
Controls.Add(panelMatrix);
Controls.Add(panelScreen);
@@ -1465,6 +1574,12 @@ namespace GHelper
panelPeripheralsTile.ResumeLayout(false);
panelPeripheralsTile.PerformLayout();
((System.ComponentModel.ISupportInitialize)picturePeripherals).EndInit();
panelAlly.ResumeLayout(false);
panelAlly.PerformLayout();
tableLayoutAlly.ResumeLayout(false);
panelAllyTitle.ResumeLayout(false);
panelAllyTitle.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureAlly).EndInit();
ResumeLayout(false);
PerformLayout();
}
@@ -1548,5 +1663,12 @@ namespace GHelper
private Label labelCharge;
private RButton buttonFnLock;
private RButton buttonBatteryFull;
private Panel panelAlly;
private Label label1;
private TableLayoutPanel tableLayoutAlly;
private RButton buttonController;
private Panel panelAllyTitle;
private Label labelAlly;
private PictureBox pictureAlly;
}
}

View File

@@ -1,4 +1,5 @@
using GHelper.AnimeMatrix;
using GHelper.Ally;
using GHelper.AnimeMatrix;
using GHelper.AutoUpdate;
using GHelper.Battery;
using GHelper.Display;
@@ -23,6 +24,7 @@ namespace GHelper
public GPUModeControl gpuControl;
ScreenControl screenControl = new ScreenControl();
AllyControl controllerControl;
AutoUpdateControl updateControl;
AsusMouseSettings? mouseSettings;
@@ -54,6 +56,7 @@ namespace GHelper
gpuControl = new GPUModeControl(this);
updateControl = new AutoUpdateControl(this);
matrixControl = new AniMatrixControl(this);
controllerControl = new AllyControl(this);
buttonSilent.Text = Properties.Strings.Silent;
buttonBalanced.Text = Properties.Strings.Balanced;
@@ -227,6 +230,8 @@ namespace GHelper
buttonBatteryFull.MouseLeave += ButtonBatteryFull_MouseLeave;
buttonBatteryFull.Click += ButtonBatteryFull_Click;
buttonController.Click += ButtonController_Click;
Text = "G-Helper " + (ProcessHelper.IsUserAdministrator() ? "—" : "-") + " " + AppConfig.GetModelShort();
TopMost = AppConfig.Is("topmost");
@@ -240,6 +245,32 @@ namespace GHelper
panelPerformance.Focus();
}
private void ButtonController_Click(object? sender, EventArgs e)
{
controllerControl.ToggleMode();
}
public void VisualiseAlly(bool visible = false)
{
panelAlly.Visible = visible;
}
public void VisualiseController(ControllerMode mode)
{
switch (mode)
{
case ControllerMode.Gamepad:
buttonController.Text = "Gamepad";
break;
case ControllerMode.WASD:
buttonController.Text = "WASD";
break;
case ControllerMode.Mouse:
buttonController.Text = "Mouse";
break;
}
}
private void SettingsForm_LostFocus(object? sender, EventArgs e)
{
lastLostFocus = DateTimeOffset.Now.ToUnixTimeMilliseconds();