mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-01-23 05:31:12 +01:00
Removed unwanted boxing for AdvancedColorDialog
This commit is contained in:
parent
45485bb44d
commit
8f3ce714a2
@ -132,7 +132,7 @@ namespace DS4Windows
|
|||||||
private const int WM_INITDIALOG = 0x0110;
|
private const int WM_INITDIALOG = 0x0110;
|
||||||
|
|
||||||
private List<ApiWindow> EditWindows = null;
|
private List<ApiWindow> EditWindows = null;
|
||||||
public delegate void ColorUpdateHandler(object sender, EventArgs e);
|
public delegate void ColorUpdateHandler(Color colValue, EventArgs e);
|
||||||
public event ColorUpdateHandler OnUpdateColor;
|
public event ColorUpdateHandler OnUpdateColor;
|
||||||
|
|
||||||
[DllImport("user32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
|
[DllImport("user32.dll", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
|
||||||
|
@ -2359,11 +2359,10 @@ Properties.Resources.DS4Update, MessageBoxButtons.YesNo, MessageBoxIcon.Question
|
|||||||
DS4LightBar.forcelight[currentCustomLed] = false;
|
DS4LightBar.forcelight[currentCustomLed] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void advColor_CustomColorUpdate(object sender, EventArgs e)
|
private void advColor_CustomColorUpdate(Color color, EventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is Color && currentCustomLed < 4)
|
if (currentCustomLed < 4)
|
||||||
{
|
{
|
||||||
Color color = (Color)sender;
|
|
||||||
DS4Color dcolor = new DS4Color { red = color.R, green = color.G, blue = color.B };
|
DS4Color dcolor = new DS4Color { red = color.R, green = color.G, blue = color.B };
|
||||||
DS4LightBar.forcedColor[currentCustomLed] = dcolor;
|
DS4LightBar.forcedColor[currentCustomLed] = dcolor;
|
||||||
DS4LightBar.forcedFlash[currentCustomLed] = 0;
|
DS4LightBar.forcedFlash[currentCustomLed] = 0;
|
||||||
|
@ -458,11 +458,10 @@ namespace DS4Windows
|
|||||||
DS4LightBar.forcelight[device] = false;
|
DS4LightBar.forcelight[device] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void advColorDialog_OnUpdateColor(object sender, EventArgs e)
|
private void advColorDialog_OnUpdateColor(Color color, EventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is Color && device < 4)
|
if (device < 4)
|
||||||
{
|
{
|
||||||
Color color = (Color)sender;
|
|
||||||
DS4Color dcolor = new DS4Color { red = color.R, green = color.G, blue = color.B };
|
DS4Color dcolor = new DS4Color { red = color.R, green = color.G, blue = color.B };
|
||||||
DS4LightBar.forcedColor[device] = dcolor;
|
DS4LightBar.forcedColor[device] = dcolor;
|
||||||
DS4LightBar.forcedFlash[device] = 0;
|
DS4LightBar.forcedFlash[device] = 0;
|
||||||
|
@ -1431,11 +1431,10 @@ namespace DS4Windows
|
|||||||
ChargingColor[device] = new DS4Color(chargingBackColor);
|
ChargingColor[device] = new DS4Color(chargingBackColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void advColorDialog_OnUpdateColor(object sender, EventArgs e)
|
private void advColorDialog_OnUpdateColor(Color color, EventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is Color && device < 4)
|
if (device < 4)
|
||||||
{
|
{
|
||||||
Color color = (Color)sender;
|
|
||||||
DS4Color dcolor = new DS4Color { red = color.R, green = color.G, blue = color.B };
|
DS4Color dcolor = new DS4Color { red = color.R, green = color.G, blue = color.B };
|
||||||
DS4LightBar.forcedColor[device] = dcolor;
|
DS4LightBar.forcedColor[device] = dcolor;
|
||||||
DS4LightBar.forcedFlash[device] = 0;
|
DS4LightBar.forcedFlash[device] = 0;
|
||||||
|
@ -1356,11 +1356,10 @@ namespace DS4Windows
|
|||||||
cHMacro.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
|
cHMacro.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void advColorDialog_OnUpdateColor(object sender, EventArgs e)
|
private void advColorDialog_OnUpdateColor(Color color, EventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is Color && Program.rootHub.DS4Controllers[0] != null)
|
if (Program.rootHub.DS4Controllers[0] != null)
|
||||||
{
|
{
|
||||||
Color color = (Color)sender;
|
|
||||||
DS4Color dcolor = new DS4Color { red = color.R, green = color.G, blue = color.B };
|
DS4Color dcolor = new DS4Color { red = color.R, green = color.G, blue = color.B };
|
||||||
DS4LightBar.forcedColor[0] = dcolor;
|
DS4LightBar.forcedColor[0] = dcolor;
|
||||||
DS4LightBar.forcedFlash[0] = 0;
|
DS4LightBar.forcedFlash[0] = 0;
|
||||||
|
@ -491,11 +491,10 @@ namespace DS4Windows
|
|||||||
e.Graphics.FillRectangle(linGrBrush, 0, 0, pBGraident.Width, pBGraident.Height);
|
e.Graphics.FillRectangle(linGrBrush, 0, 0, pBGraident.Width, pBGraident.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void advColorDialog_OnUpdateColor(object sender, EventArgs e)
|
private void advColorDialog_OnUpdateColor(Color color, EventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is Color && device < 4)
|
if (device < 4)
|
||||||
{
|
{
|
||||||
Color color = (Color)sender;
|
|
||||||
DS4Color dcolor = new DS4Color { red = color.R, green = color.G, blue = color.B };
|
DS4Color dcolor = new DS4Color { red = color.R, green = color.G, blue = color.B };
|
||||||
DS4LightBar.forcedColor[device] = dcolor;
|
DS4LightBar.forcedColor[device] = dcolor;
|
||||||
DS4LightBar.forcedFlash[device] = 0;
|
DS4LightBar.forcedFlash[device] = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user