Compare commits

...

10 Commits
v0.56 ... v0.57

Author SHA1 Message Date
Serge
8e1099545a Overdrive fix 2023-05-05 12:35:55 +02:00
Serge
7740678cd4 Added on/off control for aura lightbar, lid and logo 2023-05-05 11:44:33 +02:00
Serge
c6faec9628 Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-04 13:55:50 +02:00
Serge
3a5c4de9b6 Context menu 2023-05-04 13:55:49 +02:00
Serge
f90fec24b9 Update README.md 2023-05-03 19:56:58 +02:00
Serge
240537dbd4 Merge pull request #315 from marcelomijas/main
Added Spanish translation for new options
2023-05-03 19:56:17 +02:00
Marcelo Moreno
cc3c16cdf1 Added Spanish translation for new options
Added Spanish translation for the new options:
- dGPU off in Optimized mode when on USB-charger.
- Minilled related options.
2023-05-03 19:19:17 +02:00
Serge
a7c662a0d4 Merge branch 'main' of https://github.com/seerge/g-helper 2023-05-03 18:18:44 +02:00
Serge
b0958cb2fc Translations fix 2023-05-03 18:18:42 +02:00
Serge
29f27ed4d6 Update README.md 2023-05-03 18:07:31 +02:00
14 changed files with 326 additions and 135 deletions

View File

@@ -1,14 +1,10 @@
// Source thanks to https://github.com/vddCore/Starlight with some adjustments from me
using Starlight.Communication;
using System.Management;
using System.Drawing.Drawing2D;
using System.Text;
using System.Globalization;
using System;
using System.Drawing;
using OSD;
using System.Diagnostics;
using System.Management;
using System.Text;
namespace Starlight.AnimeMatrix
{
@@ -331,7 +327,7 @@ namespace Starlight.AnimeMatrix
int second = DateTime.Now.Second;
if (CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern.Contains("H"))
PresentTextDiagonal(DateTime.Now.ToString("H" + ((second % 2 == 0)?":":" ") + "mm"));
PresentTextDiagonal(DateTime.Now.ToString("H" + ((second % 2 == 0) ? ":" : " ") + "mm"));
else
PresentTextDiagonal(DateTime.Now.ToString("h" + ((second % 2 == 0) ? ":" : " ") + "mmtt"));
}
@@ -348,14 +344,14 @@ namespace Starlight.AnimeMatrix
using (Font font = new Font("Arial", 24F, GraphicsUnit.Pixel))
{
SizeF textSize = g.MeasureString(text1, font);
g.DrawString(text1, font, Brushes.White, (MaxColumns*3 - textSize.Width)+3, -3);
g.DrawString(text1, font, Brushes.White, (MaxColumns * 3 - textSize.Width) + 3, -3);
}
if (text2.Length > 0)
using (Font font = new Font("Arial", 18F, GraphicsUnit.Pixel))
{
SizeF textSize = g.MeasureString(text2, font);
g.DrawString(text2, font, Brushes.White, (MaxColumns * 3 - textSize.Width)+1, 25);
g.DrawString(text2, font, Brushes.White, (MaxColumns * 3 - textSize.Width) + 1, 25);
}
}
@@ -369,7 +365,7 @@ namespace Starlight.AnimeMatrix
public void GenerateFrame(Image image, InterpolationMode interpolation = InterpolationMode.High)
{
int width = MaxColumns/2 * 6;
int width = MaxColumns / 2 * 6;
int height = MaxRows;
int targetWidth = MaxColumns * 2;
@@ -396,7 +392,7 @@ namespace Starlight.AnimeMatrix
for (int y = 0; y < bmp.Height; y++)
{
for (int x = 0; x < bmp.Width; x++)
if (x % 2 == (y+dx) % 2)
if (x % 2 == (y + dx) % 2)
{
var pixel = bmp.GetPixel(x, y);
var color = (pixel.R + pixel.G + pixel.B) / 3;
@@ -411,9 +407,9 @@ namespace Starlight.AnimeMatrix
public void SetLedDiagonal(int x, int y, byte color, int delta = 10)
{
//x+=delta;
y-=delta;
y -= delta;
int dx = (x - y)/2;
int dx = (x - y) / 2;
int dy = x + y;
SetLedPlanar(dx, dy, color);
}
@@ -442,11 +438,11 @@ namespace Starlight.AnimeMatrix
for (int y = 0; y < bmp.Height; y++)
{
for (int x = 0; x < bmp.Width; x++)
{
var pixel = bmp.GetPixel(x, y);
var color = (pixel.R + pixel.G + pixel.B) / 3;
SetLedDiagonal(x, y, (byte)color);
}
{
var pixel = bmp.GetPixel(x, y);
var color = (pixel.R + pixel.G + pixel.B) / 3;
SetLedDiagonal(x, y, (byte)color);
}
}
}

View File

@@ -208,25 +208,37 @@ namespace GHelper
List<AuraDev19b6> flags = new List<AuraDev19b6>();
if (awake) flags.Add(AuraDev19b6.AwakeKeyb);
if (boot) flags.Add(AuraDev19b6.BootKeyb);
if (sleep) flags.Add(AuraDev19b6.SleepKeyb);
if (shutdown) flags.Add(AuraDev19b6.ShutdownKeyb);
if (awake)
{
flags.Add(AuraDev19b6.AwakeKeyb);
flags.Add(AuraDev19b6.AwakeBar);
flags.Add(AuraDev19b6.AwakeLid);
flags.Add(AuraDev19b6.AwakeLogo);
}
flags.Add(AuraDev19b6.AwakeBar);
flags.Add(AuraDev19b6.BootBar);
flags.Add(AuraDev19b6.SleepBar);
flags.Add(AuraDev19b6.ShutdownBar);
if (boot)
{
flags.Add(AuraDev19b6.BootKeyb);
flags.Add(AuraDev19b6.BootBar);
flags.Add(AuraDev19b6.BootLid);
flags.Add(AuraDev19b6.BootLogo);
}
flags.Add(AuraDev19b6.AwakeLid);
flags.Add(AuraDev19b6.BootLid);
flags.Add(AuraDev19b6.SleepLid);
flags.Add(AuraDev19b6.ShutdownLid);
if (sleep)
{
flags.Add(AuraDev19b6.SleepKeyb);
flags.Add(AuraDev19b6.SleepBar);
flags.Add(AuraDev19b6.SleepLid);
flags.Add(AuraDev19b6.SleepLogo);
}
flags.Add(AuraDev19b6.AwakeLogo);
flags.Add(AuraDev19b6.BootLogo);
flags.Add(AuraDev19b6.SleepLogo);
flags.Add(AuraDev19b6.ShutdownLogo);
if (shutdown)
{
flags.Add(AuraDev19b6.ShutdownKeyb);
flags.Add(AuraDev19b6.ShutdownBar);
flags.Add(AuraDev19b6.ShutdownLid);
flags.Add(AuraDev19b6.ShutdownLogo);
}
byte[] msg = AuraDev19b6Extensions.ToBytes(flags.ToArray());

View File

@@ -1,7 +1,7 @@
using CustomControls;
using WinFormsSliderBar;
using System.Drawing.Drawing2D;
using System.Windows.Forms.DataVisualization.Charting;
using WinFormsSliderBar;
public static class ControlHelper
{
@@ -86,7 +86,7 @@ public static class ControlHelper
}
var sl = control as Slider;
if (sl != null)
if (sl != null)
{
sl.borderColor = RForm.buttonMain;
}

View File

@@ -30,6 +30,11 @@ namespace CustomControls
public bool darkTheme = false;
public RForm()
{
DoubleBuffered = true;
}
public static void InitColors(bool darkTheme)
{
if (darkTheme)
@@ -97,7 +102,7 @@ namespace CustomControls
}
public class RComboBox : ComboBox
public class RComboBox : ComboBox
{
private Color borderColor = Color.Gray;
[DefaultValue(typeof(Color), "Gray")]
@@ -332,8 +337,9 @@ namespace CustomControls
public RButton()
{
this.FlatStyle = FlatStyle.Flat;
this.FlatAppearance.BorderSize = 0;
DoubleBuffered = true;
FlatStyle = FlatStyle.Flat;
FlatAppearance.BorderSize = 0;
}
private GraphicsPath GetFigurePath(Rectangle rect, int radius)

View File

@@ -13,7 +13,7 @@ namespace GHelper
{"screenshot", Properties.Strings.PrintScreen},
{"play", Properties.Strings.PlayPause},
{"aura", Properties.Strings.ToggleAura},
{"ghelper", Properties.Strings.OpenGHelper},
{"performance", Properties.Strings.PerformanceMode},
{"screen", Properties.Strings.ToggleScreen},
{"miniled", Properties.Strings.ToggleMiniled},
{"custom", Properties.Strings.Custom}
@@ -22,7 +22,7 @@ namespace GHelper
private void SetKeyCombo(ComboBox combo, TextBox txbox, string name)
{
if (name == "m4")
customActions[""] = Properties.Strings.PerformanceMode;
customActions[""] = Properties.Strings.OpenGHelper;
if (name == "fnf4")
{

87
app/Fans.Designer.cs generated
View File

@@ -31,12 +31,12 @@ namespace GHelper
/// </summary>
private void InitializeComponent()
{
ChartArea chartArea1 = new ChartArea();
Title title1 = new Title();
ChartArea chartArea2 = new ChartArea();
Title title2 = new Title();
ChartArea chartArea3 = new ChartArea();
Title title3 = new Title();
ChartArea chartArea4 = new ChartArea();
Title title4 = new Title();
ChartArea chartArea5 = new ChartArea();
Title title5 = new Title();
ChartArea chartArea6 = new ChartArea();
Title title6 = new Title();
panelFans = new Panel();
labelFansResult = new Label();
labelTip = new Label();
@@ -60,7 +60,7 @@ namespace GHelper
trackCPU = new TrackBar();
panelTotal = new Panel();
labelTotal = new Label();
label1 = new Label();
labelPlatform = new Label();
trackTotal = new TrackBar();
pictureFine = new PictureBox();
labelInfo = new Label();
@@ -105,7 +105,7 @@ namespace GHelper
panelFans.Controls.Add(checkApplyFans);
panelFans.Controls.Add(buttonReset);
panelFans.Dock = DockStyle.Left;
panelFans.Location = new Point(711, 0);
panelFans.Location = new Point(364, 0);
panelFans.Margin = new Padding(0);
panelFans.Name = "panelFans";
panelFans.Padding = new Padding(10);
@@ -142,7 +142,7 @@ namespace GHelper
labelBoost.Name = "labelBoost";
labelBoost.Size = new Size(125, 32);
labelBoost.TabIndex = 39;
labelBoost.Text = Properties.Strings.CPUBoost;
labelBoost.Text = "CPU Boost";
labelBoost.TextAlign = ContentAlignment.MiddleRight;
//
// comboBoost
@@ -190,8 +190,8 @@ namespace GHelper
//
// chartGPU
//
chartArea1.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea1);
chartArea4.Name = "ChartArea1";
chartGPU.ChartAreas.Add(chartArea4);
chartGPU.Dock = DockStyle.Fill;
chartGPU.Location = new Point(2, 350);
chartGPU.Margin = new Padding(2, 10, 2, 10);
@@ -199,13 +199,13 @@ namespace GHelper
chartGPU.Size = new Size(760, 320);
chartGPU.TabIndex = 17;
chartGPU.Text = "chartGPU";
title1.Name = "Title1";
chartGPU.Titles.Add(title1);
title4.Name = "Title1";
chartGPU.Titles.Add(title4);
//
// chartCPU
//
chartArea2.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea2);
chartArea5.Name = "ChartArea1";
chartCPU.ChartAreas.Add(chartArea5);
chartCPU.Dock = DockStyle.Fill;
chartCPU.Location = new Point(2, 10);
chartCPU.Margin = new Padding(2, 10, 2, 10);
@@ -213,13 +213,13 @@ namespace GHelper
chartCPU.Size = new Size(760, 320);
chartCPU.TabIndex = 14;
chartCPU.Text = "chartCPU";
title2.Name = "Title1";
chartCPU.Titles.Add(title2);
title5.Name = "Title1";
chartCPU.Titles.Add(title5);
//
// chartMid
//
chartArea3.Name = "ChartArea3";
chartMid.ChartAreas.Add(chartArea3);
chartArea6.Name = "ChartArea3";
chartMid.ChartAreas.Add(chartArea6);
chartMid.Dock = DockStyle.Fill;
chartMid.Location = new Point(2, 690);
chartMid.Margin = new Padding(2, 10, 2, 10);
@@ -227,8 +227,8 @@ namespace GHelper
chartMid.Size = new Size(760, 322);
chartMid.TabIndex = 14;
chartMid.Text = "chartMid";
title3.Name = "Title3";
chartMid.Titles.Add(title3);
title6.Name = "Title3";
chartMid.Titles.Add(title6);
chartMid.Visible = false;
//
// labelFans
@@ -283,7 +283,7 @@ namespace GHelper
panelPower.Controls.Add(pictureFine);
panelPower.Controls.Add(labelInfo);
panelPower.Dock = DockStyle.Left;
panelPower.Location = new Point(347, 0);
panelPower.Location = new Point(0, 0);
panelPower.Margin = new Padding(10);
panelPower.Name = "panelPower";
panelPower.Padding = new Padding(10);
@@ -311,7 +311,7 @@ namespace GHelper
labelPowerLimits.Name = "labelPowerLimits";
labelPowerLimits.Size = new Size(229, 32);
labelPowerLimits.TabIndex = 26;
labelPowerLimits.Text = Properties.Strings.PowerLimits;
labelPowerLimits.Text = "Power Limits (PPT)";
//
// checkApplyPower
//
@@ -376,7 +376,7 @@ namespace GHelper
// panelTotal
//
panelTotal.Controls.Add(labelTotal);
panelTotal.Controls.Add(label1);
panelTotal.Controls.Add(labelPlatform);
panelTotal.Controls.Add(trackTotal);
panelTotal.Location = new Point(16, 72);
panelTotal.Margin = new Padding(4);
@@ -395,16 +395,16 @@ namespace GHelper
labelTotal.Text = "Platform";
labelTotal.TextAlign = ContentAlignment.MiddleCenter;
//
// label1
// labelPlatform
//
label1.AutoSize = true;
label1.Location = new Point(26, 8);
label1.Margin = new Padding(4, 0, 4, 0);
label1.Name = "label1";
label1.Size = new Size(104, 32);
label1.TabIndex = 11;
label1.Text = "Platform";
label1.TextAlign = ContentAlignment.MiddleCenter;
labelPlatform.AutoSize = true;
labelPlatform.Location = new Point(26, 8);
labelPlatform.Margin = new Padding(4, 0, 4, 0);
labelPlatform.Name = "labelPlatform";
labelPlatform.Size = new Size(104, 32);
labelPlatform.TabIndex = 11;
labelPlatform.Text = "Platform";
labelPlatform.TextAlign = ContentAlignment.MiddleCenter;
//
// trackTotal
//
@@ -455,7 +455,7 @@ namespace GHelper
panelGPU.Controls.Add(trackGPUCore);
panelGPU.Controls.Add(labelGPUCoreTitle);
panelGPU.Dock = DockStyle.Left;
panelGPU.Location = new Point(0, 0);
panelGPU.Location = new Point(1188, 0);
panelGPU.Name = "panelGPU";
panelGPU.Size = new Size(347, 1189);
panelGPU.TabIndex = 14;
@@ -494,14 +494,12 @@ namespace GHelper
trackGPUMemory.Location = new Point(216, 160);
trackGPUMemory.Margin = new Padding(4, 2, 4, 2);
trackGPUMemory.Maximum = 300;
trackGPUMemory.Minimum = 0;
trackGPUMemory.Name = "trackGPUMemory";
trackGPUMemory.Orientation = Orientation.Vertical;
trackGPUMemory.Size = new Size(90, 454);
trackGPUMemory.SmallChange = 10;
trackGPUMemory.TabIndex = 41;
trackGPUMemory.TickFrequency = 50;
trackGPUMemory.Value = 0;
//
// labelGPUMemoryTitle
//
@@ -554,7 +552,6 @@ namespace GHelper
trackGPUCore.Location = new Point(48, 160);
trackGPUCore.Margin = new Padding(4, 2, 4, 2);
trackGPUCore.Maximum = 300;
trackGPUCore.Minimum = 0;
trackGPUCore.Name = "trackGPUCore";
trackGPUCore.Orientation = Orientation.Vertical;
trackGPUCore.RightToLeft = RightToLeft.No;
@@ -563,7 +560,6 @@ namespace GHelper
trackGPUCore.TabIndex = 17;
trackGPUCore.TickFrequency = 50;
trackGPUCore.TickStyle = TickStyle.TopLeft;
trackGPUCore.Value = 0;
//
// labelGPUCoreTitle
//
@@ -572,13 +568,12 @@ namespace GHelper
labelGPUCoreTitle.Name = "labelGPUCoreTitle";
labelGPUCoreTitle.Size = new Size(129, 32);
labelGPUCoreTitle.TabIndex = 16;
labelFansResult.Visible = false;
labelGPUCoreTitle.TextAlign = ContentAlignment.MiddleCenter;
labelGPUCoreTitle.Text = "Core Clock";
//
// Fans
//
AutoScaleDimensions = new SizeF(192F, 192F);
labelGPUCoreTitle.TextAlign = ContentAlignment.MiddleCenter;
//
// Fans
//
AutoScaleDimensions = new SizeF(192F, 192F);
AutoScaleMode = AutoScaleMode.Dpi;
AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink;
@@ -595,7 +590,7 @@ namespace GHelper
ShowIcon = false;
ShowInTaskbar = false;
StartPosition = FormStartPosition.CenterScreen;
Text = Properties.Strings.FansAndPower;
Text = "Fans and Power";
panelFans.ResumeLayout(false);
panelFans.PerformLayout();
((System.ComponentModel.ISupportInitialize)picturePerf).EndInit();
@@ -633,7 +628,7 @@ namespace GHelper
private TrackBar trackCPU;
private Panel panelTotal;
private Label labelTotal;
private Label label1;
private Label labelPlatform;
private TrackBar trackTotal;
private PictureBox pictureFine;
private Label labelInfo;

View File

@@ -1,7 +1,6 @@
using System.Diagnostics;
using CustomControls;
using System.Diagnostics;
using System.Windows.Forms.DataVisualization.Charting;
using CustomControls;
using GHelper.Gpu;
namespace GHelper
{
@@ -18,13 +17,21 @@ namespace GHelper
{
InitializeComponent();
Text = Properties.Strings.FansAndPower;
labelPowerLimits.Text = Properties.Strings.PowerLimits;
labelInfo.Text = Properties.Strings.PPTExperimental;
checkApplyPower.Text = Properties.Strings.ApplyPowerLimits;
labelFans.Text = Properties.Strings.FanCurves;
labelBoost.Text = Properties.Strings.CPUBoost;
buttonReset.Text = Properties.Strings.FactoryDefaults;
checkApplyFans.Text = Properties.Strings.ApplyFanCurve;
InitTheme();
MinRPM = 18;
MaxRPM = HardwareMonitor.GetFanMax();
labelTip.Visible = false;
labelTip.BackColor = Color.Transparent;
@@ -71,6 +78,7 @@ namespace GHelper
//labelInfo.MaximumSize = new Size(280, 0);
labelInfo.Text = Properties.Strings.PPTExperimental;
labelFansResult.Visible = false;
InitFans();
InitPower();
@@ -86,6 +94,7 @@ namespace GHelper
private void InitGPUClocks()
{
/*
try
{
using (var _gpuControl = new NvidiaGpuControl())
@@ -100,6 +109,9 @@ namespace GHelper
{
panelGPU.Visible=false;
}
*/
panelGPU.Visible = false;
}
@@ -271,7 +283,7 @@ namespace GHelper
public void LabelFansResult(string text)
{
labelFansResult.Text = text;
labelFansResult.Visible = (text.Length == 0);
labelFansResult.Visible = (text.Length > 0);
}
private void Fans_FormClosing(object? sender, FormClosingEventArgs e)
@@ -298,7 +310,7 @@ namespace GHelper
// Yes, that's stupid, but Total slider on 2021 model actually adjusts CPU PPT
if (!cpuBmode)
{
label1.Text = "CPU SPPT";
labelPlatform.Text = "CPU SPPT";
}
int limit_total;

View File

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

View File

@@ -155,14 +155,16 @@ public static class HardwareMonitor
}
_gpuControl.Dispose();
/*
_gpuControl = new AmdGpuControl();
if (_gpuControl.IsValid)
{
GpuControl = _gpuControl;
return;
}
_gpuControl.Dispose();
*/
GpuControl = null;
}

View File

@@ -3,11 +3,43 @@ using System.Diagnostics;
using System.Globalization;
using System.Management;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security.Principal;
using Tools;
namespace GHelper
{
class CustomContextMenu : ContextMenuStrip
{
[DllImport("dwmapi.dll", CharSet = CharSet.Unicode, SetLastError = true)]
private static extern long DwmSetWindowAttribute(IntPtr hwnd,
DWMWINDOWATTRIBUTE attribute,
ref DWM_WINDOW_CORNER_PREFERENCE pvAttribute,
uint cbAttribute);
public CustomContextMenu()
{
var preference = DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUNDSMALL; //change as you want
DwmSetWindowAttribute(Handle,
DWMWINDOWATTRIBUTE.DWMWA_WINDOW_CORNER_PREFERENCE,
ref preference,
sizeof(uint));
}
public enum DWMWINDOWATTRIBUTE
{
DWMWA_WINDOW_CORNER_PREFERENCE = 33
}
public enum DWM_WINDOW_CORNER_PREFERENCE
{
DWMWA_DEFAULT = 0,
DWMWCP_DONOTROUND = 1,
DWMWCP_ROUND = 2,
DWMWCP_ROUNDSMALL = 3,
}
}
static class Program
{
public static NotifyIcon trayIcon = new NotifyIcon
@@ -82,7 +114,7 @@ namespace GHelper
Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture;
Debug.WriteLine(CultureInfo.CurrentUICulture);
//Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("es");
//Thread.CurrentThread.CurrentUICulture = CultureInfo.CreateSpecificCulture("zh");
CheckProcesses();
@@ -142,10 +174,10 @@ namespace GHelper
Application.Run();
}
static void SystemEvents_UserPreferenceChanged(object sender, UserPreferenceChangedEventArgs e)
{
@@ -173,7 +205,7 @@ namespace GHelper
public static void SetAutoModes(bool monitor = true)
public static void SetAutoModes()
{
if (Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastAuto) < 3000) return;
@@ -185,8 +217,7 @@ namespace GHelper
settingsForm.SetBatteryChargeLimit(config.getConfig("charge_limit"));
settingsForm.AutoPerformance();
bool switched = false;
if (monitor) switched = settingsForm.AutoGPUMode();
bool switched = settingsForm.AutoGPUMode();
if (!switched)
{
@@ -253,7 +284,7 @@ namespace GHelper
if (action is null || action.Length <= 1)
{
if (name == "m4")
action = "performance";
action = "ghelper";
if (name == "fnf4")
action = "aura";
}
@@ -338,10 +369,11 @@ namespace GHelper
static void TrayIcon_MouseClick(object? sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left || e.Button == MouseButtons.Right)
if (e.Button == MouseButtons.Left)
{
SettingsToggle();
}
}

View File

@@ -330,6 +330,9 @@
<data name="OptimizedGPUTooltip" xml:space="preserve">
<value>Cambia a Eco con batería y a Estándar cuando está enchufado</value>
</data>
<data name="OptimizedUSBC" xml:space="preserve">
<value>Deshabilitar dGPU con cargador USB-C en modo Optimizado</value>
</data>
<data name="Other" xml:space="preserve">
<value>Otro</value>
</data>
@@ -384,6 +387,12 @@
<data name="ToggleAura" xml:space="preserve">
<value>Alternar Aura</value>
</data>
<data name="ToggleMiniled" xml:space="preserve">
<value>Alternar Miniled (si es compatible)</value>
</data>
<data name="ToggleScreen" xml:space="preserve">
<value>Alternar pantalla</value>
</data>
<data name="Turbo" xml:space="preserve">
<value>Turbo</value>
</data>

View File

@@ -1,11 +1,11 @@
using CustomControls;
using Starlight.AnimeMatrix;
using System;
using System.Diagnostics;
using System.Drawing.Imaging;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text.Json;
using System.Threading;
using System.Timers;
using Tools;
@@ -15,6 +15,9 @@ namespace GHelper
public partial class SettingsForm : RForm
{
private ContextMenuStrip contextMenuStrip = new CustomContextMenu();
private ToolStripMenuItem menuSilent, menuBalanced, menuTurbo, menuEco, menuStandard, menuUltimate, menuOptimized;
public static System.Timers.Timer aTimer = default!;
public static Point trayPoint;
@@ -129,6 +132,7 @@ namespace GHelper
aTimer = new System.Timers.Timer(1000);
aTimer.Elapsed += OnTimedEvent;
aTimer.Enabled = true;
SetVersionLabel(Properties.Strings.VersionLabel + ": " + Assembly.GetExecutingAssembly().GetName().Version);
@@ -138,7 +142,9 @@ namespace GHelper
labelModel.Text = model;
this.TopMost = Program.config.getConfig("topmost") == 1;
TopMost = Program.config.getConfig("topmost") == 1;
SetContextMenu();
Task.Run(async () =>
{
@@ -146,6 +152,111 @@ namespace GHelper
CheckForUpdatesAsync();
});
}
public void SetContextMenu()
{
contextMenuStrip.Items.Clear();
Padding padding = new Padding(5, 5, 5, 5);
/*
TableLayoutPanel[] tables = { tablePerf, tableGPU };
string[] titles = { Properties.Strings.PerformanceMode, Properties.Strings.GPUMode};
int index = 0;
foreach (TableLayoutPanel table in tables)
{
var title = new ToolStripMenuItem(titles[index]);
title.Margin = padding;
title.Enabled = false;
contextMenuStrip.Items.Add(title);
foreach (Control control in table.Controls)
{
var button = control as RButton;
if (button != null && !button.Secondary && button.Enabled)
{
var menu = new ToolStripMenuItem(button.Text);
menu.Margin = padding;
menu.Checked = button.Activated;
menu.Click += delegate { button.PerformClick(); };
contextMenuStrip.Items.Add(menu);
}
}
contextMenuStrip.Items.Add("-");
index++;
}*/
var title = new ToolStripMenuItem(Properties.Strings.PerformanceMode);
title.Margin = padding;
title.Enabled = false;
contextMenuStrip.Items.Add(title);
menuSilent = new ToolStripMenuItem(Properties.Strings.Silent);
menuSilent.Click += ButtonSilent_Click;
menuSilent.Margin = padding;
contextMenuStrip.Items.Add(menuSilent);
menuBalanced = new ToolStripMenuItem(Properties.Strings.Balanced);
menuBalanced.Click += ButtonBalanced_Click;
menuBalanced.Margin = padding;
contextMenuStrip.Items.Add(menuBalanced);
menuTurbo = new ToolStripMenuItem(Properties.Strings.Turbo);
menuTurbo.Click += ButtonTurbo_Click;
menuTurbo.Checked = true;
menuTurbo.Margin = padding;
contextMenuStrip.Items.Add(menuTurbo);
contextMenuStrip.Items.Add("-");
var titleGPU = new ToolStripMenuItem(Properties.Strings.GPUMode);
titleGPU.Margin = padding;
titleGPU.Enabled = false;
contextMenuStrip.Items.Add(titleGPU);
menuEco = new ToolStripMenuItem(Properties.Strings.EcoMode);
menuEco.Click += ButtonEco_Click;
menuEco.Margin = padding;
contextMenuStrip.Items.Add(menuEco);
menuStandard = new ToolStripMenuItem(Properties.Strings.StandardMode);
menuStandard.Click += ButtonStandard_Click;
menuStandard.Margin = padding;
contextMenuStrip.Items.Add(menuStandard);
menuUltimate = new ToolStripMenuItem(Properties.Strings.UltimateMode);
menuUltimate.Click += ButtonUltimate_Click;
menuUltimate.Margin = padding;
contextMenuStrip.Items.Add(menuUltimate);
menuOptimized = new ToolStripMenuItem(Properties.Strings.Optimized);
menuOptimized.Click += ButtonOptimized_Click;
menuOptimized.Margin = padding;
contextMenuStrip.Items.Add(menuOptimized);
contextMenuStrip.Items.Add("-");
var quit = new ToolStripMenuItem(Properties.Strings.Quit);
quit.Click += ButtonQuit_Click;
quit.Margin = padding;
contextMenuStrip.Items.Add(quit);
contextMenuStrip.ShowCheckMargin = true;
contextMenuStrip.RenderMode = ToolStripRenderMode.System;
if (CheckSystemDarkModeStatus())
{
contextMenuStrip.BackColor = this.BackColor;
contextMenuStrip.ForeColor = this.ForeColor;
}
Program.trayIcon.ContextMenuStrip = contextMenuStrip;
}
@@ -154,7 +265,8 @@ namespace GHelper
if (Program.wmi.DeviceGet(ASUSWmi.GPUXG) == 1)
{
Program.wmi.DeviceSet(ASUSWmi.GPUXG, 0, "GPU XGM");
} else
}
else
{
Program.wmi.DeviceSet(ASUSWmi.GPUXG, 1, "GPU XGM");
}
@@ -291,7 +403,7 @@ namespace GHelper
break;
case 1:
Logger.WriteLine("Monitor Power On");
Program.SetAutoModes(false);
Program.SetAutoModes();
break;
case 2:
Logger.WriteLine("Monitor Dimmed");
@@ -517,7 +629,7 @@ namespace GHelper
break;
default:
mat.SetBuiltInAnimation(true, animation);
Logger.WriteLine("Matrix builtin "+animation.AsByte);
Logger.WriteLine("Matrix builtin " + animation.AsByte);
break;
}
@@ -734,7 +846,6 @@ namespace GHelper
}
InitScreen();
}
public void InitScreen()
@@ -781,7 +892,8 @@ namespace GHelper
{
button120Hz.Text = maxFrequency.ToString() + "Hz" + (overdriveSetting ? " + OD" : "");
panelScreen.Visible = true;
} else if (maxFrequency > 0)
}
else if (maxFrequency > 0)
{
panelScreen.Visible = false;
}
@@ -831,8 +943,7 @@ namespace GHelper
SetGPUMode(ASUSWmi.GPUModeEco);
}
private void RefreshSensors(bool force = false)
public void RefreshSensors(bool force = false)
{
if (!force && Math.Abs(DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastRefresh) < 2000) return;
@@ -848,7 +959,7 @@ namespace GHelper
cpuTemp = ": " + Math.Round((decimal)HardwareMonitor.cpuTemp).ToString() + "°C ";
if (HardwareMonitor.batteryDischarge > 0)
battery = Properties.Strings.Discharging +": " + Math.Round((decimal)HardwareMonitor.batteryDischarge, 1).ToString() + "W";
battery = Properties.Strings.Discharging + ": " + Math.Round((decimal)HardwareMonitor.batteryDischarge, 1).ToString() + "W";
if (HardwareMonitor.gpuTemp > 0)
{
@@ -885,11 +996,7 @@ namespace GHelper
this.Top = Screen.FromControl(this).WorkingArea.Height - 10 - this.Height;
this.Activate();
Task.Run(async () =>
{
await Task.Delay(TimeSpan.FromSeconds(1));
aTimer.Enabled = true;
});
aTimer.Enabled = true;
}
else
@@ -901,7 +1008,7 @@ namespace GHelper
private void SetPerformanceLabel()
{
labelPerf.Text = Properties.Strings.PerformanceMode + (customFans?"+":"") + ((customPower > 0) ? " "+customPower+"W" : "");
labelPerf.Text = Properties.Strings.PerformanceMode + (customFans ? "+" : "") + ((customPower > 0) ? " " + customPower + "W" : "");
}
public void SetPower()
@@ -1046,6 +1153,10 @@ namespace GHelper
break;
}
menuSilent.Checked = buttonSilent.Activated;
menuBalanced.Checked = buttonBalanced.Activated;
menuTurbo.Checked = buttonTurbo.Activated;
int oldMode = Program.config.getConfig("performance_mode");
Program.config.setConfig("performance_" + (int)SystemInformation.PowerStatus.PowerLineStatus, PerformanceMode);
Program.config.setConfig("performance_mode", PerformanceMode);
@@ -1069,7 +1180,7 @@ namespace GHelper
if (Program.config.getConfigPerfString("scheme") is not null)
NativeMethods.SetPowerScheme(Program.config.getConfigPerfString("scheme"));
else
else
NativeMethods.SetPowerScheme(PerformanceMode);
if (Program.config.getConfigPerf("auto_boost") != -1)
@@ -1130,12 +1241,17 @@ namespace GHelper
public void AutoScreen(bool force = false)
{
if (!force && Program.config.getConfig("screen_auto") != 1) return;
if (force || Program.config.getConfig("screen_auto") == 1)
{
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
SetScreen(1000, 1);
else
SetScreen(60, 0);
} else
{
SetScreen(overdrive : Program.config.getConfig("overdrive"));
}
if (SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online)
SetScreen(1000, 1);
else
SetScreen(60, 0);
}
@@ -1143,8 +1259,8 @@ namespace GHelper
public static bool IsPlugged()
{
bool optimizedUSBC = Program.config.getConfig("optimized_usbc") != 1;
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online &&
return SystemInformation.PowerStatus.PowerLineStatus == PowerLineStatus.Online &&
(optimizedUSBC || Program.wmi.DeviceGet(ASUSWmi.ChargerMode) != ASUSWmi.ChargerUSB);
}
@@ -1216,6 +1332,7 @@ namespace GHelper
tablePerf.ColumnCount = 0;
tableGPU.ColumnCount = 0;
tableScreen.ColumnCount = 0;
menuUltimate.Visible = false;
}
//tableLayoutMatrix.ColumnCount = 0;
@@ -1226,7 +1343,7 @@ namespace GHelper
int connected = Program.wmi.DeviceGet(ASUSWmi.GPUXGConnected);
int enabled = Program.wmi.DeviceGet(ASUSWmi.GPUXG);
buttonXGM.Visible = (connected == 1);
buttonXGM.Enabled = buttonXGM.Visible = (connected == 1);
buttonXGM.Activated = (enabled == 1);
}
@@ -1280,7 +1397,7 @@ namespace GHelper
ButtonEnabled(buttonStandard, false);
ButtonEnabled(buttonUltimate, false);
labelGPU.Text = Properties.Strings.GPUMode + ": "+ Properties.Strings.GPUChanging + " ...";
labelGPU.Text = Properties.Strings.GPUMode + ": " + Properties.Strings.GPUChanging + " ...";
Thread t = new Thread(() =>
{
@@ -1409,6 +1526,10 @@ namespace GHelper
break;
}
menuEco.Checked = buttonEco.Activated;
menuStandard.Checked = buttonStandard.Activated;
menuUltimate.Checked = buttonUltimate.Activated;
menuOptimized.Checked = buttonOptimized.Activated;
}

View File

@@ -4,9 +4,7 @@
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<!-- UAC Manifest Options
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.

View File

@@ -20,7 +20,7 @@ Control tool for ROG Zephyrus G14, G15, Flow X13, Flow X16, TUF, Strix, Scar and
## [:floppy_disk: Download App](https://github.com/seerge/g-helper/releases/latest/download/GHelper.zip)
If you like this app, please [star :star: it on Github](https://github.com/seerge/g-helper) and spread a word about it!
### :euro: [Donate and support G-Helper](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA)
### [:euro: Donate EUR](https://www.paypal.com/donate/?hosted_button_id=4HMSHS4EBQWTA) | [💵 Donate USD](https://www.paypal.com/donate/?hosted_button_id=SRM6QUX6ACXDY)
_If you post about the app - please include a link. Thanks._
@@ -188,6 +188,14 @@ Full list of keycodes https://learn.microsoft.com/en-us/windows/win32/inputdev/v
![Screenshot 2023-04-13 172537](https://user-images.githubusercontent.com/5920850/231837470-df913847-cf8a-43e1-80b6-5eb6e9eaee4e.png)
### Workaround for [bugged bios on G15](https://github.com/seerge/g-helper/issues/253)
Some people reported that on G15 model bios can be bugged and either not turn on or not turn off fans, when you set custom fan curve (in Armoury or g-helper, or any other app)
I have added a very optional workaround as it was asked, on launch app will try to disable and re-enable dGPU when external monitor is connected, that seems to wake up fans :)
To enable this custom workaround you need to add an extra line in In config.json (under ``%AppData%\GHelper``)
``gpu_reenable : 1,``
------------
**Disclaimers**
"ROG", "TUF", and "Armoury Crate" are trademarked by and belong to AsusTek Computer, Inc. I make no claims to these or any assets belonging to AsusTek Computer and use them purely for informational purposes only.