mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Custom aura colors will be saved to config
This commit is contained in:
@@ -604,16 +604,7 @@ namespace GHelper
|
|||||||
|
|
||||||
private void PictureColor2_Click(object? sender, EventArgs e)
|
private void PictureColor2_Click(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
SetColorPicker("aura_color2");
|
||||||
ColorDialog colorDlg = new ColorDialog();
|
|
||||||
colorDlg.AllowFullOpen = true;
|
|
||||||
colorDlg.Color = pictureColor2.BackColor;
|
|
||||||
|
|
||||||
if (colorDlg.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
AppConfig.Set("aura_color2", colorDlg.Color.ToArgb());
|
|
||||||
SetAura();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PictureColor_Click(object? sender, EventArgs e)
|
private void PictureColor_Click(object? sender, EventArgs e)
|
||||||
@@ -681,20 +672,31 @@ namespace GHelper
|
|||||||
FansToggle();
|
FansToggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonKeyboardColor_Click(object? sender, EventArgs e)
|
private void SetColorPicker(string colorField = "aura_color")
|
||||||
{
|
{
|
||||||
|
|
||||||
ColorDialog colorDlg = new ColorDialog();
|
ColorDialog colorDlg = new ColorDialog();
|
||||||
colorDlg.AllowFullOpen = true;
|
colorDlg.AllowFullOpen = true;
|
||||||
colorDlg.Color = pictureColor.BackColor;
|
colorDlg.Color = pictureColor.BackColor;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
colorDlg.CustomColors = AppConfig.GetString("aura_color_custom", "").Split('-').Select(int.Parse).ToArray();
|
||||||
|
}
|
||||||
|
catch (Exception ex) { }
|
||||||
|
|
||||||
if (colorDlg.ShowDialog() == DialogResult.OK)
|
if (colorDlg.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
AppConfig.Set("aura_color", colorDlg.Color.ToArgb());
|
AppConfig.Set("aura_color_custom", string.Join("-", colorDlg.CustomColors));
|
||||||
|
AppConfig.Set(colorField, colorDlg.Color.ToArgb());
|
||||||
SetAura();
|
SetAura();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ButtonKeyboardColor_Click(object? sender, EventArgs e)
|
||||||
|
{
|
||||||
|
SetColorPicker("aura_color");
|
||||||
|
}
|
||||||
|
|
||||||
public void InitAura()
|
public void InitAura()
|
||||||
{
|
{
|
||||||
Aura.Mode = (AuraMode)AppConfig.Get("aura_mode");
|
Aura.Mode = (AuraMode)AppConfig.Get("aura_mode");
|
||||||
|
|||||||
Reference in New Issue
Block a user