mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Setting Standard mode prior to going Ultimate
This commit is contained in:
@@ -465,7 +465,7 @@ namespace GHelper
|
|||||||
if (auraDevice is null || !auraDevice.IsConnected) GetAuraDevice();
|
if (auraDevice is null || !auraDevice.IsConnected) GetAuraDevice();
|
||||||
if (auraDevice is null || !auraDevice.IsConnected) return;
|
if (auraDevice is null || !auraDevice.IsConnected) return;
|
||||||
|
|
||||||
byte[] msg = new byte[40];
|
byte[] msg = new byte[0x40];
|
||||||
int start = 9;
|
int start = 9;
|
||||||
|
|
||||||
msg[0] = AURA_HID_ID;
|
msg[0] = AURA_HID_ID;
|
||||||
@@ -474,7 +474,14 @@ namespace GHelper
|
|||||||
msg[3] = 1;
|
msg[3] = 1;
|
||||||
msg[4] = 4;
|
msg[4] = 4;
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
|
{
|
||||||
|
msg[start + i * 3] = color.R; // R
|
||||||
|
msg[start + 1 + i * 3] = color.G; // G
|
||||||
|
msg[start + 2 + i * 3] = color.B; // B
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 5; i < 12; i++)
|
||||||
{
|
{
|
||||||
msg[start + i * 3] = color.R; // R
|
msg[start + i * 3] = color.R; // R
|
||||||
msg[start + 1 + i * 3] = color.G; // G
|
msg[start + 1 + i * 3] = color.G; // G
|
||||||
@@ -484,13 +491,16 @@ namespace GHelper
|
|||||||
//Logger.WriteLine(BitConverter.ToString(msg));
|
//Logger.WriteLine(BitConverter.ToString(msg));
|
||||||
if (init)
|
if (init)
|
||||||
{
|
{
|
||||||
auraDevice.WriteFeatureData(AuraMessage(0,Color.Red,color,0));
|
auraDevice.WriteFeatureData(LED_INIT2);
|
||||||
auraDevice.WriteFeatureData(MESSAGE_APPLY);
|
auraDevice.WriteFeatureData(new byte[] { AURA_HID_ID, 0x05, 0x20, 0x31, 0x00, 0x1A});
|
||||||
auraDevice.WriteFeatureData(MESSAGE_SET);
|
//auraDevice.WriteFeatureData(AuraMessage(0,Color.Red,color,0));
|
||||||
auraDevice.Write(new byte[] { AURA_HID_ID, 0xbc });
|
//auraDevice.WriteFeatureData(MESSAGE_APPLY);
|
||||||
auraDevice.Write(new byte[] { AURA_HID_ID, 0xbc, 1, 1, 4 });
|
//auraDevice.WriteFeatureData(MESSAGE_SET);
|
||||||
|
auraDevice.WriteFeatureData(new byte[] { AURA_HID_ID, 0xbc, 1, 0, 0, 0 });
|
||||||
|
auraDevice.WriteFeatureData(new byte[] { AURA_HID_ID, 0xbc, 1, 1, 4, 0 });
|
||||||
}
|
}
|
||||||
auraDevice.Write(msg);
|
|
||||||
|
auraDevice.WriteFeatureData(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -49,11 +49,16 @@ namespace GHelper.Gpu
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void SetGPUMode(int GPUMode)
|
bool NoAutoUltimate()
|
||||||
|
{
|
||||||
|
return AppConfig.ContainsModel("G614") || AppConfig.ContainsModel("M16");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetGPUMode(int GPUMode, int auto = 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
int CurrentGPU = AppConfig.Get("gpu_mode");
|
int CurrentGPU = AppConfig.Get("gpu_mode");
|
||||||
AppConfig.Set("gpu_auto", 0);
|
AppConfig.Set("gpu_auto", auto);
|
||||||
|
|
||||||
if (CurrentGPU == GPUMode)
|
if (CurrentGPU == GPUMode)
|
||||||
{
|
{
|
||||||
@@ -79,6 +84,11 @@ namespace GHelper.Gpu
|
|||||||
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOn, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
|
DialogResult dialogResult = MessageBox.Show(Properties.Strings.AlertUltimateOn, Properties.Strings.AlertUltimateTitle, MessageBoxButtons.YesNo);
|
||||||
if (dialogResult == DialogResult.Yes)
|
if (dialogResult == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
|
if (NoAutoUltimate())
|
||||||
|
{
|
||||||
|
Program.acpi.SetGPUEco(0);
|
||||||
|
Thread.Sleep(100);
|
||||||
|
}
|
||||||
Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux");
|
Program.acpi.DeviceSet(AsusACPI.GPUMux, 0, "GPUMux");
|
||||||
restart = true;
|
restart = true;
|
||||||
changed = true;
|
changed = true;
|
||||||
@@ -188,7 +198,7 @@ namespace GHelper.Gpu
|
|||||||
|
|
||||||
if (mux == 0)
|
if (mux == 0)
|
||||||
{
|
{
|
||||||
if (optimized) SetGPUMode(AsusACPI.GPUModeStandard);
|
if (optimized) SetGPUMode(AsusACPI.GPUModeStandard, 1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user