Version 1.4.0.85

Many fixes for shift modifier
This commit is contained in:
jays2kings 2014-11-01 17:49:22 -04:00
parent c8632a96c6
commit 8acd9b7ad1
7 changed files with 5546 additions and 5468 deletions

View File

@ -329,7 +329,6 @@ namespace DS4Control
public static async void MapCustom(int device, DS4State cState, DS4State MappedState, DS4StateExposed eState, Mouse tp) public static async void MapCustom(int device, DS4State cState, DS4State MappedState, DS4StateExposed eState, Mouse tp)
{ {
bool shift; bool shift;
cState.CopyTo(MappedState);
SyntheticState deviceState = Mapping.deviceState[device]; SyntheticState deviceState = Mapping.deviceState[device];
switch (Global.getShiftModifier(device)) switch (Global.getShiftModifier(device))
{ {
@ -361,8 +360,10 @@ namespace DS4Control
case 26: shift = cState.Touch1; break; case 26: shift = cState.Touch1; break;
default: shift = false; break; default: shift = false; break;
} }
cState.CopyTo(MappedState);
if (shift) if (shift)
MapShiftCustom(device, cState, MappedState, eState, tp); MapShiftCustom(device, cState, MappedState, eState, tp);
//else
foreach (KeyValuePair<DS4Controls, string> customKey in Global.getCustomMacros(device)) foreach (KeyValuePair<DS4Controls, string> customKey in Global.getCustomMacros(device))
{ {
if (shift == false || if (shift == false ||
@ -782,7 +783,7 @@ namespace DS4Control
public static async void MapShiftCustom(int device, DS4State cState, DS4State MappedState, DS4StateExposed eState, Mouse tp) public static async void MapShiftCustom(int device, DS4State cState, DS4State MappedState, DS4StateExposed eState, Mouse tp)
{ {
cState.CopyTo(MappedState); //cState.CopyTo(MappedState);
SyntheticState deviceState = Mapping.deviceState[device]; SyntheticState deviceState = Mapping.deviceState[device];
foreach (KeyValuePair<DS4Controls, string> customKey in Global.getShiftCustomMacros(device)) //with delays foreach (KeyValuePair<DS4Controls, string> customKey in Global.getShiftCustomMacros(device)) //with delays
{ {
@ -955,6 +956,7 @@ namespace DS4Control
List<DS4Controls> RYP = new List<DS4Controls>(); List<DS4Controls> RYP = new List<DS4Controls>();
foreach (KeyValuePair<DS4Controls, X360Controls> customButton in customButtons) foreach (KeyValuePair<DS4Controls, X360Controls> customButton in customButtons)
{ {
resetToDefaultValue(customButton.Key, MappedState); // erase default mappings for things that are remapped
DS4KeyType keyType = Global.getShiftCustomKeyType(device, customButton.Key); DS4KeyType keyType = Global.getShiftCustomKeyType(device, customButton.Key);
int keyvalue = 0; int keyvalue = 0;
switch (customButton.Value) switch (customButton.Value)
@ -969,7 +971,6 @@ namespace DS4Control
{ {
if (getBoolMapping(customButton.Key, cState, eState, tp)) if (getBoolMapping(customButton.Key, cState, eState, tp))
{ {
resetToDefaultValue(customButton.Key, MappedState);
if (!pressedonce[keyvalue]) if (!pressedonce[keyvalue])
{ {
deviceState.currentClicks.toggle = !deviceState.currentClicks.toggle; deviceState.currentClicks.toggle = !deviceState.currentClicks.toggle;
@ -1068,6 +1069,7 @@ namespace DS4Control
break; break;
} }
} }
Console.WriteLine(Cross.Count);
foreach (DS4Controls dc in Cross) foreach (DS4Controls dc in Cross)
if (getBoolMapping(dc, cState, eState, tp)) if (getBoolMapping(dc, cState, eState, tp))
MappedState.Cross = true; MappedState.Cross = true;
@ -1120,21 +1122,21 @@ namespace DS4Control
if (getBoolMapping(dc, cState, eState, tp)) if (getBoolMapping(dc, cState, eState, tp))
MappedState.PS = true; MappedState.PS = true;
if (Global.getCustomButton(device, DS4Controls.LXNeg) == X360Controls.None) if (Global.getShiftCustomButton(device, DS4Controls.LXNeg) == X360Controls.None)
LXN.Add(DS4Controls.LXNeg); LXN.Add(DS4Controls.LXNeg);
if (Global.getCustomButton(device, DS4Controls.LXPos) == X360Controls.None) if (Global.getShiftCustomButton(device, DS4Controls.LXPos) == X360Controls.None)
LXP.Add(DS4Controls.LXPos); LXP.Add(DS4Controls.LXPos);
if (Global.getCustomButton(device, DS4Controls.LYNeg) == X360Controls.None) if (Global.getShiftCustomButton(device, DS4Controls.LYNeg) == X360Controls.None)
LYN.Add(DS4Controls.LYNeg); LYN.Add(DS4Controls.LYNeg);
if (Global.getCustomButton(device, DS4Controls.LYPos) == X360Controls.None) if (Global.getShiftCustomButton(device, DS4Controls.LYPos) == X360Controls.None)
LYP.Add(DS4Controls.LYPos); LYP.Add(DS4Controls.LYPos);
if (Global.getCustomButton(device, DS4Controls.RXNeg) == X360Controls.None) if (Global.getShiftCustomButton(device, DS4Controls.RXNeg) == X360Controls.None)
RXN.Add(DS4Controls.RXNeg); RXN.Add(DS4Controls.RXNeg);
if (Global.getCustomButton(device, DS4Controls.RXPos) == X360Controls.None) if (Global.getShiftCustomButton(device, DS4Controls.RXPos) == X360Controls.None)
RXP.Add(DS4Controls.RXPos); RXP.Add(DS4Controls.RXPos);
if (Global.getCustomButton(device, DS4Controls.RYNeg) == X360Controls.None) if (Global.getShiftCustomButton(device, DS4Controls.RYNeg) == X360Controls.None)
RYN.Add(DS4Controls.RYNeg); RYN.Add(DS4Controls.RYNeg);
if (Global.getCustomButton(device, DS4Controls.RYPos) == X360Controls.None) if (Global.getShiftCustomButton(device, DS4Controls.RYPos) == X360Controls.None)
RYP.Add(DS4Controls.RYPos); RYP.Add(DS4Controls.RYPos);
if (LXN.Count > 0 || LXP.Count > 0) if (LXN.Count > 0 || LXP.Count > 0)
{ {
@ -1356,10 +1358,10 @@ namespace DS4Control
case DS4Controls.Square: return (byte)(cState.Square ? 255 : 0); case DS4Controls.Square: return (byte)(cState.Square ? 255 : 0);
case DS4Controls.Triangle: return (byte)(cState.Triangle ? 255 : 0); case DS4Controls.Triangle: return (byte)(cState.Triangle ? 255 : 0);
case DS4Controls.Circle: return (byte)(cState.Circle ? 255 : 0); case DS4Controls.Circle: return (byte)(cState.Circle ? 255 : 0);
case DS4Controls.TouchLeft: return (byte)(tp.leftDown ? 255 : 0); case DS4Controls.TouchLeft: return (byte)(tp != null && tp.leftDown ? 255 : 0);
case DS4Controls.TouchRight: return (byte)(tp.rightDown ? 255 : 0); case DS4Controls.TouchRight: return (byte)(tp != null && tp.rightDown ? 255 : 0);
case DS4Controls.TouchMulti: return (byte)(tp.multiDown ? 255 : 0); case DS4Controls.TouchMulti: return (byte)(tp != null && tp.multiDown ? 255 : 0);
case DS4Controls.TouchUpper: return (byte)(tp.upperDown ? 255 : 0); case DS4Controls.TouchUpper: return (byte)(tp != null && tp.upperDown ? 255 : 0);
case DS4Controls.LXNeg: return (byte)cState.LX; case DS4Controls.LXNeg: return (byte)cState.LX;
case DS4Controls.LYNeg: return (byte)cState.LY; case DS4Controls.LYNeg: return (byte)cState.LY;
case DS4Controls.RXNeg: return (byte)cState.RX; case DS4Controls.RXNeg: return (byte)cState.RX;
@ -1444,10 +1446,10 @@ namespace DS4Control
case DS4Controls.Square: return (byte)(cState.Square ? trueVal : falseVal); case DS4Controls.Square: return (byte)(cState.Square ? trueVal : falseVal);
case DS4Controls.Triangle: return (byte)(cState.Triangle ? trueVal : falseVal); case DS4Controls.Triangle: return (byte)(cState.Triangle ? trueVal : falseVal);
case DS4Controls.Circle: return (byte)(cState.Circle ? trueVal : falseVal); case DS4Controls.Circle: return (byte)(cState.Circle ? trueVal : falseVal);
case DS4Controls.TouchLeft: return (byte)(tp.leftDown ? trueVal : falseVal); case DS4Controls.TouchLeft: return (byte)(tp != null && tp.leftDown ? trueVal : falseVal);
case DS4Controls.TouchRight: return (byte)(tp.rightDown ? trueVal : falseVal); case DS4Controls.TouchRight: return (byte)(tp != null && tp.rightDown ? trueVal : falseVal);
case DS4Controls.TouchMulti: return (byte)(tp.multiDown ? trueVal : falseVal); case DS4Controls.TouchMulti: return (byte)(tp != null && tp.multiDown ? trueVal : falseVal);
case DS4Controls.TouchUpper: return (byte)(tp.upperDown ? trueVal : falseVal); case DS4Controls.TouchUpper: return (byte)(tp != null && tp.upperDown ? trueVal : falseVal);
case DS4Controls.L2: if (alt) return (byte)(127 + cState.L2 / 2); else return (byte)(127 - cState.L2 / 2); case DS4Controls.L2: if (alt) return (byte)(127 + cState.L2 / 2); else return (byte)(127 - cState.L2 / 2);
case DS4Controls.R2: if (alt) return (byte)(127 + cState.R2 / 2); else return (byte)(127 - cState.R2 / 2); case DS4Controls.R2: if (alt) return (byte)(127 + cState.R2 / 2); else return (byte)(127 - cState.R2 / 2);
case DS4Controls.GyroXPos: if (eState.GyroX > SXD * 7500) case DS4Controls.GyroXPos: if (eState.GyroX > SXD * 7500)

View File

@ -1102,6 +1102,45 @@ namespace DS4Control
case "bnGyroZN": return DS4Controls.GyroZNeg; case "bnGyroZN": return DS4Controls.GyroZNeg;
case "bnShiftShare": return DS4Controls.Share;
case "bnShiftL3": return DS4Controls.L3;
case "bnShiftR3": return DS4Controls.R3;
case "bnShiftOptions": return DS4Controls.Options;
case "bnShiftUp": return DS4Controls.DpadUp;
case "bnShiftRight": return DS4Controls.DpadRight;
case "bnShiftDown": return DS4Controls.DpadDown;
case "bnShiftLeft": return DS4Controls.DpadLeft;
case "bnShiftL1": return DS4Controls.L1;
case "bnShiftR1": return DS4Controls.R1;
case "bnShiftTriangle": return DS4Controls.Triangle;
case "bnShiftCircle": return DS4Controls.Circle;
case "bnShiftCross": return DS4Controls.Cross;
case "bnShiftSquare": return DS4Controls.Square;
case "bnShiftPS": return DS4Controls.PS;
case "bnShiftLSLeft": return DS4Controls.LXNeg;
case "bnShiftLSUp": return DS4Controls.LYNeg;
case "bnShiftRSLeft": return DS4Controls.RXNeg;
case "bnShiftRSUp": return DS4Controls.RYNeg;
case "bnShiftLSRight": return DS4Controls.LXPos;
case "bnShiftLSDown": return DS4Controls.LYPos;
case "bnShiftRSRight": return DS4Controls.RXPos;
case "bnShiftRSDown": return DS4Controls.RYPos;
case "bnShiftL2": return DS4Controls.L2;
case "bnShiftR2": return DS4Controls.R2;
case "bnShiftTouchLeft": return DS4Controls.TouchLeft;
case "bnShiftTouchMulti": return DS4Controls.TouchMulti;
case "bnShiftTouchUpper": return DS4Controls.TouchUpper;
case "bnShiftTouchRight": return DS4Controls.TouchRight;
case "bnShiftGsyroXP": return DS4Controls.GyroXPos;
case "bnShiftGyroXN": return DS4Controls.GyroXNeg;
case "bnShiftGyroZP": return DS4Controls.GyroZPos;
case "bnShiftGyroZN": return DS4Controls.GyroZNeg;
//old name
case "sbnShare": return DS4Controls.Share; case "sbnShare": return DS4Controls.Share;
case "sbnL3": return DS4Controls.L3; case "sbnL3": return DS4Controls.L3;
case "sbnR3": return DS4Controls.R3; case "sbnR3": return DS4Controls.R3;
@ -1139,6 +1178,45 @@ namespace DS4Control
case "sbnGyroXN": return DS4Controls.GyroXNeg; case "sbnGyroXN": return DS4Controls.GyroXNeg;
case "sbnGyroZP": return DS4Controls.GyroZPos; case "sbnGyroZP": return DS4Controls.GyroZPos;
case "sbnGyroZN": return DS4Controls.GyroZNeg; case "sbnGyroZN": return DS4Controls.GyroZNeg;
//end old name
case "bnHoldShare": return DS4Controls.Share;
case "bnHoldL3": return DS4Controls.L3;
case "bnHoldR3": return DS4Controls.R3;
case "bnHoldOptions": return DS4Controls.Options;
case "bnHoldUp": return DS4Controls.DpadUp;
case "bnHoldRight": return DS4Controls.DpadRight;
case "bnHoldDown": return DS4Controls.DpadDown;
case "bnHoldLeft": return DS4Controls.DpadLeft;
case "bnHoldL1": return DS4Controls.L1;
case "bnHoldR1": return DS4Controls.R1;
case "bnHoldTriangle": return DS4Controls.Triangle;
case "bnHoldCircle": return DS4Controls.Circle;
case "bnHoldCross": return DS4Controls.Cross;
case "bnHoldSquare": return DS4Controls.Square;
case "bnHoldPS": return DS4Controls.PS;
case "bnHoldLSLeft": return DS4Controls.LXNeg;
case "bnHoldLSUp": return DS4Controls.LYNeg;
case "bnHoldRSLeft": return DS4Controls.RXNeg;
case "bnHoldRSUp": return DS4Controls.RYNeg;
case "bnHoldLSRight": return DS4Controls.LXPos;
case "bnHoldLSDown": return DS4Controls.LYPos;
case "bnHoldRSRight": return DS4Controls.RXPos;
case "bnHoldRSDown": return DS4Controls.RYPos;
case "bnHoldL2": return DS4Controls.L2;
case "bnHoldR2": return DS4Controls.R2;
case "bnHoldTouchLeft": return DS4Controls.TouchLeft;
case "bnHoldTouchMulti": return DS4Controls.TouchMulti;
case "bnHoldTouchUpper": return DS4Controls.TouchUpper;
case "bnHoldTouchRight": return DS4Controls.TouchRight;
case "bnHoldGsyroXP": return DS4Controls.GyroXPos;
case "bnHoldGyroXN": return DS4Controls.GyroXNeg;
case "bnHoldGyroZP": return DS4Controls.GyroZPos;
case "bnHoldGyroZN": return DS4Controls.GyroZNeg;
} }
return 0; return 0;
} }

View File

@ -29,13 +29,18 @@ namespace ScpServer
cbScanCode.Checked = button.Font.Bold; cbScanCode.Checked = button.Font.Bold;
//cBMacro.Checked = button.Font.Underline; //cBMacro.Checked = button.Font.Underline;
lBMacroOn.Visible = button.Font.Underline; lBMacroOn.Visible = button.Font.Underline;
if (button.Name.StartsWith("bn")) if (button.Name.StartsWith("bnHold"))
Text = Properties.Resources.SelectActionTitle.Replace("*action*", button.Name.Substring(2));
else if (button.Name.StartsWith("sbn"))
{ {
Text = Properties.Resources.SelectActionTitle.Replace("*action*", button.Name.Substring(3)); Text = Properties.Resources.SelectActionTitle.Replace("*action*", button.Name.Substring(6));
btnFallBack.Text = "Fall Back"; btnFallBack.Text = "Disable";
} }
else if (button.Name.StartsWith("bnShift"))
{
Text = Properties.Resources.SelectActionTitle.Replace("*action*", button.Name.Substring(7));
btnFallBack.Text = "Fall Back";
}
else if (button.Name.StartsWith("bn"))
Text = Properties.Resources.SelectActionTitle.Replace("*action*", button.Name.Substring(2));
foreach (System.Windows.Forms.Control control in this.Controls) foreach (System.Windows.Forms.Control control in this.Controls)
if (control is Button) if (control is Button)
((Button)control).Click += anybtn_Click; ((Button)control).Click += anybtn_Click;

File diff suppressed because it is too large Load Diff

View File

@ -34,29 +34,23 @@ namespace ScpServer
root = rt; root = rt;
g = CreateGraphics(); g = CreateGraphics();
greyscale = GreyscaleImage((Bitmap)pBRainbow.Image); greyscale = GreyscaleImage((Bitmap)pBRainbow.Image);
foreach (System.Windows.Forms.Control control in SticksPanel.Controls) foreach (System.Windows.Forms.Control control in pnlMain.Controls)
if (control is Button) if (control is Button && !((Button)control).Name.Contains("btn"))
if (!((Button)control).Name.Contains("btn"))
buttons.Add((Button)control); buttons.Add((Button)control);
foreach (System.Windows.Forms.Control control in MainPanel.Controls) foreach (System.Windows.Forms.Control control in pnlSticks.Controls)
if (control is Button) if (control is Button && !((Button)control).Name.Contains("btn"))
if (!((Button)control).Name.Contains("btn"))
buttons.Add((Button)control); buttons.Add((Button)control);
foreach (System.Windows.Forms.Control control in fLPTiltControls.Controls) foreach (System.Windows.Forms.Control control in fLPTiltControls.Controls)
if (control is Button) if (control is Button && !((Button)control).Name.Contains("btn"))
if (!((Button)control).Name.Contains("btn"))
buttons.Add((Button)control); buttons.Add((Button)control);
foreach (System.Windows.Forms.Control control in ShiftMainPanel.Controls) foreach (System.Windows.Forms.Control control in pnlShiftMain.Controls)
if (control is Button) if (control is Button && !((Button)control).Name.Contains("btnShift"))
if (!((Button)control).Name.Contains("sbtn"))
subbuttons.Add((Button)control); subbuttons.Add((Button)control);
foreach (System.Windows.Forms.Control control in ShiftSticksPanel.Controls) foreach (System.Windows.Forms.Control control in pnlShiftSticks.Controls)
if (control is Button) if (control is Button && !((Button)control).Name.Contains("btnShift"))
if (!((Button)control).Name.Contains("sbtn"))
subbuttons.Add((Button)control); subbuttons.Add((Button)control);
foreach (System.Windows.Forms.Control control in sfLPTiltControls.Controls) foreach (System.Windows.Forms.Control control in fLPShiftTiltControls.Controls)
if (control is Button) if (control is Button && !((Button)control).Name.Contains("btnShift"))
if (!((Button)control).Name.Contains("sbtn"))
subbuttons.Add((Button)control); subbuttons.Add((Button)control);
string butts = ""; string butts = "";
foreach (Button b in buttons) foreach (Button b in buttons)
@ -92,9 +86,9 @@ namespace ScpServer
cBLightbyBattery.Checked = Global.getLedAsBatteryIndicator(device); cBLightbyBattery.Checked = Global.getLedAsBatteryIndicator(device);
nUDflashLED.Value = Global.getFlashAt(device); nUDflashLED.Value = Global.getFlashAt(device);
lowBatteryPanel.Visible = cBLightbyBattery.Checked; pnlLowBattery.Visible = cBLightbyBattery.Checked;
lbFull.Text = (cBLightbyBattery.Checked ? "Full:" : "Color:"); lbFull.Text = (cBLightbyBattery.Checked ? "Full:" : "Color:");
FullPanel.Location = (cBLightbyBattery.Checked ? new Point(FullPanel.Location.X, 42) : new Point(FullPanel.Location.X, 48)); pnlFull.Location = (cBLightbyBattery.Checked ? new Point(pnlFull.Location.X, 42) : new Point(pnlFull.Location.X, 48));
DS4Color lowColor = Global.loadLowColor(device); DS4Color lowColor = Global.loadLowColor(device);
tBLowRedBar.Value = lowColor.red; tBLowRedBar.Value = lowColor.red;
@ -197,8 +191,8 @@ namespace ScpServer
advColorDialog.OnUpdateColor += advColorDialog_OnUpdateColor; advColorDialog.OnUpdateColor += advColorDialog_OnUpdateColor;
btnLeftStick.Enter += btnSticks_Enter; btnLeftStick.Enter += btnSticks_Enter;
btnRightStick.Enter += btnSticks_Enter; btnRightStick.Enter += btnSticks_Enter;
sbtnLeftStick.Enter += sbtnSticks_Enter; btnShiftLeftStick.Enter += btnShiftSticks_Enter;
sbtnRightStick.Enter += sbtnSticks_Enter; btnShiftRightStick.Enter += btnShiftSticks_Enter;
UpdateLists(); UpdateLists();
inputtimer.Start(); inputtimer.Start();
inputtimer.Tick += InputDS4; inputtimer.Tick += InputDS4;
@ -343,39 +337,39 @@ namespace ScpServer
case ("bnGyroXP"): lBControls.SelectedIndex = 31; break; case ("bnGyroXP"): lBControls.SelectedIndex = 31; break;
case ("bnGyroXN"): lBControls.SelectedIndex = 32; break; case ("bnGyroXN"): lBControls.SelectedIndex = 32; break;
case ("sbnCross"): lBShiftControls.SelectedIndex = 0; break; case ("bnShiftCross"): lBShiftControls.SelectedIndex = 0; break;
case ("sbnCircle"): lBShiftControls.SelectedIndex = 1; break; case ("bnShiftCircle"): lBShiftControls.SelectedIndex = 1; break;
case ("sbnSquare"): lBShiftControls.SelectedIndex = 2; break; case ("bnShiftSquare"): lBShiftControls.SelectedIndex = 2; break;
case ("sbnTriangle"): lBShiftControls.SelectedIndex = 3; break; case ("bnShiftTriangle"): lBShiftControls.SelectedIndex = 3; break;
case ("sbnOptions"): lBShiftControls.SelectedIndex = 4; break; case ("bnShiftOptions"): lBShiftControls.SelectedIndex = 4; break;
case ("sbnShare"): lBShiftControls.SelectedIndex = 5; break; case ("bnShiftShare"): lBShiftControls.SelectedIndex = 5; break;
case ("sbnUp"): lBShiftControls.SelectedIndex = 6; break; case ("bnShiftUp"): lBShiftControls.SelectedIndex = 6; break;
case ("sbnDown"): lBShiftControls.SelectedIndex = 7; break; case ("bnShiftDown"): lBShiftControls.SelectedIndex = 7; break;
case ("sbnLeft"): lBShiftControls.SelectedIndex = 8; break; case ("bnShiftLeft"): lBShiftControls.SelectedIndex = 8; break;
case ("sbnRight"): lBShiftControls.SelectedIndex = 9; break; case ("bnShiftRight"): lBShiftControls.SelectedIndex = 9; break;
case ("sbnPS"): lBShiftControls.SelectedIndex = 10; break; case ("bnShiftPS"): lBShiftControls.SelectedIndex = 10; break;
case ("sbnL1"): lBShiftControls.SelectedIndex = 11; break; case ("bnShiftL1"): lBShiftControls.SelectedIndex = 11; break;
case ("sbnR1"): lBShiftControls.SelectedIndex = 12; break; case ("bnShiftR1"): lBShiftControls.SelectedIndex = 12; break;
case ("sbnL2"): lBShiftControls.SelectedIndex = 13; break; case ("bnShiftL2"): lBShiftControls.SelectedIndex = 13; break;
case ("sbnR2"): lBShiftControls.SelectedIndex = 14; break; case ("bnShiftR2"): lBShiftControls.SelectedIndex = 14; break;
case ("sbnL3"): lBShiftControls.SelectedIndex = 15; break; case ("bnShiftL3"): lBShiftControls.SelectedIndex = 15; break;
case ("sbnR3"): lBShiftControls.SelectedIndex = 16; break; case ("bnShiftR3"): lBShiftControls.SelectedIndex = 16; break;
case ("sbnTouchLeft"): lBShiftControls.SelectedIndex = 17; break; case ("bnShiftTouchLeft"): lBShiftControls.SelectedIndex = 17; break;
case ("sbnTouchRight"): lBShiftControls.SelectedIndex = 18; break; case ("bnShiftTouchRight"): lBShiftControls.SelectedIndex = 18; break;
case ("sbnTouchMulti"): lBShiftControls.SelectedIndex = 19; break; case ("bnShiftTouchMulti"): lBShiftControls.SelectedIndex = 19; break;
case ("sbnTouchUpper"): lBShiftControls.SelectedIndex = 20; break; case ("bnShiftTouchUpper"): lBShiftControls.SelectedIndex = 20; break;
case ("sbnLSUp"): lBShiftControls.SelectedIndex = 21; break; case ("bnShiftLSUp"): lBShiftControls.SelectedIndex = 21; break;
case ("sbnLSDown"): lBShiftControls.SelectedIndex = 22; break; case ("bnShiftLSDown"): lBShiftControls.SelectedIndex = 22; break;
case ("sbnLSLeft"): lBShiftControls.SelectedIndex = 23; break; case ("bnShiftLSLeft"): lBShiftControls.SelectedIndex = 23; break;
case ("sbnLSRight"): lBShiftControls.SelectedIndex = 24; break; case ("bnShiftLSRight"): lBShiftControls.SelectedIndex = 24; break;
case ("sbnRSUp"): lBShiftControls.SelectedIndex = 25; break; case ("bnShiftRSUp"): lBShiftControls.SelectedIndex = 25; break;
case ("sbnRSDown"): lBShiftControls.SelectedIndex = 26; break; case ("bnShiftRSDown"): lBShiftControls.SelectedIndex = 26; break;
case ("sbnRSLeft"): lBShiftControls.SelectedIndex = 27; break; case ("bnShiftRSLeft"): lBShiftControls.SelectedIndex = 27; break;
case ("sbnRSRight"): lBShiftControls.SelectedIndex = 28; break; case ("bnShiftRSRight"): lBShiftControls.SelectedIndex = 28; break;
case ("sbnGyroZN"): lBShiftControls.SelectedIndex = 29; break; case ("bnShiftGyroZN"): lBShiftControls.SelectedIndex = 29; break;
case ("sbnGyroZP"): lBShiftControls.SelectedIndex = 30; break; case ("bnShiftGyroZP"): lBShiftControls.SelectedIndex = 30; break;
case ("sbnGyroXP"): lBShiftControls.SelectedIndex = 31; break; case ("bnShiftGyroXP"): lBShiftControls.SelectedIndex = 31; break;
case ("sbnGyroXN"): lBShiftControls.SelectedIndex = 32; break; case ("bnShiftGyroXN"): lBShiftControls.SelectedIndex = 32; break;
#endregion #endregion
} }
} }
@ -391,9 +385,9 @@ namespace ScpServer
public void Set() public void Set()
{ {
lowBatteryPanel.Visible = cBLightbyBattery.Checked; pnlLowBattery.Visible = cBLightbyBattery.Checked;
lbFull.Text = (cBLightbyBattery.Checked ? Properties.Resources.Full + ":": Properties.Resources.Color + ":"); lbFull.Text = (cBLightbyBattery.Checked ? Properties.Resources.Full + ":": Properties.Resources.Color + ":");
FullPanel.Location = (cBLightbyBattery.Checked ? new Point(FullPanel.Location.X, 42) : new Point(FullPanel.Location.X, 48)); pnlFull.Location = (cBLightbyBattery.Checked ? new Point(pnlFull.Location.X, 42) : new Point(pnlFull.Location.X, 48));
Global.saveColor(device, (byte)tBRedBar.Value, (byte)tBGreenBar.Value, (byte)tBBlueBar.Value); Global.saveColor(device, (byte)tBRedBar.Value, (byte)tBGreenBar.Value, (byte)tBBlueBar.Value);
Global.saveLowColor(device, (byte)tBLowRedBar.Value, (byte)tBLowGreenBar.Value, (byte)tBLowBlueBar.Value); Global.saveLowColor(device, (byte)tBLowRedBar.Value, (byte)tBLowGreenBar.Value, (byte)tBLowBlueBar.Value);
Global.saveShiftColor(device, (byte)tBShiftRedBar.Value, (byte)tBShiftGreenBar.Value, (byte)tBShiftBlueBar.Value); Global.saveShiftColor(device, (byte)tBShiftRedBar.Value, (byte)tBShiftGreenBar.Value, (byte)tBShiftBlueBar.Value);
@ -466,26 +460,26 @@ namespace ScpServer
} }
private void btnSticks_Enter(object sender, EventArgs e) private void btnSticks_Enter(object sender, EventArgs e)
{ {
SticksPanel.Visible = true; pnlSticks.Visible = true;
MainPanel.Visible = false; pnlMain.Visible = false;
} }
private void btnFullView_Click(object sender, EventArgs e) private void btnFullView_Click(object sender, EventArgs e)
{ {
SticksPanel.Visible = false; pnlSticks.Visible = false;
MainPanel.Visible = true; pnlMain.Visible = true;
} }
private void sbtnSticks_Enter(object sender, EventArgs e) private void btnShiftSticks_Enter(object sender, EventArgs e)
{ {
ShiftSticksPanel.Visible = true; pnlShiftSticks.Visible = true;
ShiftMainPanel.Visible = false; pnlShiftMain.Visible = false;
} }
private void sbtnFullView_Click(object sender, EventArgs e) private void btnShiftFullView_Click(object sender, EventArgs e)
{ {
ShiftSticksPanel.Visible = false; pnlShiftSticks.Visible = false;
ShiftMainPanel.Visible = true; pnlShiftMain.Visible = true;
} }
private void btnLightbar_Click(object sender, EventArgs e) private void btnLightbar_Click(object sender, EventArgs e)
{ {
@ -669,7 +663,7 @@ namespace ScpServer
alphacolor = Math.Max(tBShiftRedBar.Value, Math.Max(tBShiftGreenBar.Value, tBShiftBlueBar.Value)); alphacolor = Math.Max(tBShiftRedBar.Value, Math.Max(tBShiftGreenBar.Value, tBShiftBlueBar.Value));
reg = Color.FromArgb(tBShiftRedBar.Value, tBShiftGreenBar.Value, tBShiftBlueBar.Value); reg = Color.FromArgb(tBShiftRedBar.Value, tBShiftGreenBar.Value, tBShiftBlueBar.Value);
full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg); full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg);
spBController.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); pBShiftController.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full);
Global.saveShiftColor(device, (byte)tBShiftRedBar.Value, (byte)tBShiftGreenBar.Value, (byte)tBShiftBlueBar.Value); Global.saveShiftColor(device, (byte)tBShiftRedBar.Value, (byte)tBShiftGreenBar.Value, (byte)tBShiftBlueBar.Value);
if (g.DpiX == 120) if (g.DpiX == 120)
tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 125, 0, 2000); tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 125, 0, 2000);
@ -686,7 +680,7 @@ namespace ScpServer
alphacolor = Math.Max(tBShiftRedBar.Value, Math.Max(tBShiftGreenBar.Value, tBShiftBlueBar.Value)); alphacolor = Math.Max(tBShiftRedBar.Value, Math.Max(tBShiftGreenBar.Value, tBShiftBlueBar.Value));
reg = Color.FromArgb(tBShiftRedBar.Value, tBShiftGreenBar.Value, tBShiftBlueBar.Value); reg = Color.FromArgb(tBShiftRedBar.Value, tBShiftGreenBar.Value, tBShiftBlueBar.Value);
full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg); full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg);
spBController.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); pBShiftController.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full);
Global.saveShiftColor(device, (byte)tBShiftRedBar.Value, (byte)tBShiftGreenBar.Value, (byte)tBShiftBlueBar.Value); Global.saveShiftColor(device, (byte)tBShiftRedBar.Value, (byte)tBShiftGreenBar.Value, (byte)tBShiftBlueBar.Value);
if (g.DpiX == 120) if (g.DpiX == 120)
tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 125, 0, 2000); tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 125, 0, 2000);
@ -703,7 +697,7 @@ namespace ScpServer
alphacolor = Math.Max(tBShiftRedBar.Value, Math.Max(tBShiftGreenBar.Value, tBShiftBlueBar.Value)); alphacolor = Math.Max(tBShiftRedBar.Value, Math.Max(tBShiftGreenBar.Value, tBShiftBlueBar.Value));
reg = Color.FromArgb(tBShiftRedBar.Value, tBShiftGreenBar.Value, tBShiftBlueBar.Value); reg = Color.FromArgb(tBShiftRedBar.Value, tBShiftGreenBar.Value, tBShiftBlueBar.Value);
full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg); full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg);
spBController.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); pBShiftController.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full);
Global.saveShiftColor(device, (byte)tBShiftRedBar.Value, (byte)tBShiftGreenBar.Value, (byte)tBShiftBlueBar.Value); Global.saveShiftColor(device, (byte)tBShiftRedBar.Value, (byte)tBShiftGreenBar.Value, (byte)tBShiftBlueBar.Value);
if (g.DpiX == 120) if (g.DpiX == 120)
tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 125, 0, 2000); tp.Show(((TrackBar)sender).Value.ToString(), ((TrackBar)sender), 125, 0, 2000);
@ -766,8 +760,8 @@ namespace ScpServer
private void ledAsBatteryIndicator_CheckedChanged(object sender, EventArgs e) private void ledAsBatteryIndicator_CheckedChanged(object sender, EventArgs e)
{ {
Global.setLedAsBatteryIndicator(device, cBLightbyBattery.Checked); Global.setLedAsBatteryIndicator(device, cBLightbyBattery.Checked);
lowBatteryPanel.Visible = cBLightbyBattery.Checked; pnlLowBattery.Visible = cBLightbyBattery.Checked;
FullPanel.Location = (cBLightbyBattery.Checked ? new Point(FullPanel.Location.X, 42) : new Point(FullPanel.Location.X, 48)); pnlFull.Location = (cBLightbyBattery.Checked ? new Point(pnlFull.Location.X, 42) : new Point(pnlFull.Location.X, 48));
lbFull.Text = (cBLightbyBattery.Checked ? Properties.Resources.Full + ":" : Properties.Resources.Color + ":"); lbFull.Text = (cBLightbyBattery.Checked ? Properties.Resources.Full + ":" : Properties.Resources.Color + ":");
} }
@ -893,43 +887,43 @@ namespace ScpServer
foreach (Button b in subbuttons) foreach (Button b in subbuttons)
if (b.Tag == null) if (b.Tag == null)
b.Text = "Fall Back to " + buttons[subbuttons.IndexOf(b)].Text; b.Text = "Fall Back to " + buttons[subbuttons.IndexOf(b)].Text;
lBShiftControls.Items[0] = "Cross : " + sbnCross.Text; lBShiftControls.Items[0] = "Cross : " + bnShiftCross.Text;
lBShiftControls.Items[1] = "Circle : " + sbnCircle.Text; lBShiftControls.Items[1] = "Circle : " + bnShiftCircle.Text;
lBShiftControls.Items[2] = "Square : " + sbnSquare.Text; lBShiftControls.Items[2] = "Square : " + bnShiftSquare.Text;
lBShiftControls.Items[3] = "Triangle : " + sbnTriangle.Text; lBShiftControls.Items[3] = "Triangle : " + bnShiftTriangle.Text;
lBShiftControls.Items[4] = "Options : " + sbnOptions.Text; lBShiftControls.Items[4] = "Options : " + bnShiftOptions.Text;
lBShiftControls.Items[5] = "Share : " + sbnShare.Text; lBShiftControls.Items[5] = "Share : " + bnShiftShare.Text;
lBShiftControls.Items[6] = "Up : " + sbnUp.Text; lBShiftControls.Items[6] = "Up : " + bnShiftUp.Text;
lBShiftControls.Items[7] = "Down : " + sbnDown.Text; lBShiftControls.Items[7] = "Down : " + bnShiftDown.Text;
lBShiftControls.Items[8] = "Left : " + sbnLeft.Text; lBShiftControls.Items[8] = "Left : " + bnShiftLeft.Text;
lBShiftControls.Items[9] = "Right : " + sbnRight.Text; lBShiftControls.Items[9] = "Right : " + bnShiftRight.Text;
lBShiftControls.Items[10] = "PS : " + sbnPS.Text; lBShiftControls.Items[10] = "PS : " + bnShiftPS.Text;
lBShiftControls.Items[11] = "L1 : " + sbnL1.Text; lBShiftControls.Items[11] = "L1 : " + bnShiftL1.Text;
lBShiftControls.Items[12] = "R1 : " + sbnR1.Text; lBShiftControls.Items[12] = "R1 : " + bnShiftR1.Text;
lBShiftControls.Items[13] = "L2 : " + sbnL2.Text; lBShiftControls.Items[13] = "L2 : " + bnShiftL2.Text;
lBShiftControls.Items[14] = "R2 : " + sbnR2.Text; lBShiftControls.Items[14] = "R2 : " + bnShiftR2.Text;
lBShiftControls.Items[15] = "L3 : " + sbnL3.Text; lBShiftControls.Items[15] = "L3 : " + bnShiftL3.Text;
lBShiftControls.Items[16] = "R3 : " + sbnR3.Text; lBShiftControls.Items[16] = "R3 : " + bnShiftR3.Text;
lBShiftControls.Items[17] = "Left Touch : " + sbnTouchLeft.Text; lBShiftControls.Items[17] = "Left Touch : " + bnShiftTouchLeft.Text;
lBShiftControls.Items[18] = "Right Touch : " + sbnTouchRight.Text; lBShiftControls.Items[18] = "Right Touch : " + bnShiftTouchRight.Text;
lBShiftControls.Items[19] = "Multitouch : " + sbnTouchMulti.Text; lBShiftControls.Items[19] = "Multitouch : " + bnShiftTouchMulti.Text;
lBShiftControls.Items[20] = "Upper Touch : " + sbnTouchUpper.Text; lBShiftControls.Items[20] = "Upper Touch : " + bnShiftTouchUpper.Text;
lBShiftControls.Items[21] = "LS Up : " + sbnLSUp.Text; lBShiftControls.Items[21] = "LS Up : " + bnShiftLSUp.Text;
lBShiftControls.Items[22] = "LS Down : " + sbnLSDown.Text; lBShiftControls.Items[22] = "LS Down : " + bnShiftLSDown.Text;
lBShiftControls.Items[23] = "LS Left : " + sbnLSLeft.Text; lBShiftControls.Items[23] = "LS Left : " + bnShiftLSLeft.Text;
lBShiftControls.Items[24] = "LS Right : " + sbnLSRight.Text; lBShiftControls.Items[24] = "LS Right : " + bnShiftLSRight.Text;
lBShiftControls.Items[25] = "RS Up : " + sbnRSUp.Text; lBShiftControls.Items[25] = "RS Up : " + bnShiftRSUp.Text;
lBShiftControls.Items[26] = "RS Down : " + sbnRSDown.Text; lBShiftControls.Items[26] = "RS Down : " + bnShiftRSDown.Text;
lBShiftControls.Items[27] = "RS Left : " + sbnRSLeft.Text; lBShiftControls.Items[27] = "RS Left : " + bnShiftRSLeft.Text;
lBShiftControls.Items[28] = "RS Right : " + sbnRSRight.Text; lBShiftControls.Items[28] = "RS Right : " + bnShiftRSRight.Text;
lBShiftControls.Items[29] = Properties.Resources.TiltUp + " : " + UpdateGyroList(sbnGyroZN); lBShiftControls.Items[29] = Properties.Resources.TiltUp + " : " + UpdateGyroList(bnShiftGyroZN);
lBShiftControls.Items[30] = Properties.Resources.TiltDown + " : " + UpdateGyroList(sbnGyroZP); lBShiftControls.Items[30] = Properties.Resources.TiltDown + " : " + UpdateGyroList(bnShiftGyroZP);
lBShiftControls.Items[31] = Properties.Resources.TiltLeft + " : " + UpdateGyroList(sbnGyroXP); lBShiftControls.Items[31] = Properties.Resources.TiltLeft + " : " + UpdateGyroList(bnShiftGyroXP);
lBShiftControls.Items[32] = Properties.Resources.TiltRight + " : " + UpdateGyroList(sbnGyroXN); lBShiftControls.Items[32] = Properties.Resources.TiltRight + " : " + UpdateGyroList(bnShiftGyroXN);
sbnGyroZN.Text = Properties.Resources.TiltUp; bnShiftGyroZN.Text = Properties.Resources.TiltUp;
sbnGyroZP.Text = Properties.Resources.TiltDown; bnShiftGyroZP.Text = Properties.Resources.TiltDown;
sbnGyroXP.Text = Properties.Resources.TiltLeft; bnShiftGyroXP.Text = Properties.Resources.TiltLeft;
sbnGyroXN.Text = Properties.Resources.TiltRight; bnShiftGyroXN.Text = Properties.Resources.TiltRight;
} }
private string UpdateGyroList(Button button) private string UpdateGyroList(Button button)
@ -991,42 +985,42 @@ namespace ScpServer
private void Show_ShiftControlsList(object sender, EventArgs e) private void Show_ShiftControlsList(object sender, EventArgs e)
{ {
if (lBShiftControls.SelectedIndex == 0) Show_ControlsBn(sbnCross, e); if (lBShiftControls.SelectedIndex == 0) Show_ControlsBn(bnShiftCross, e);
if (lBShiftControls.SelectedIndex == 1) Show_ControlsBn(sbnCircle, e); if (lBShiftControls.SelectedIndex == 1) Show_ControlsBn(bnShiftCircle, e);
if (lBShiftControls.SelectedIndex == 2) Show_ControlsBn(sbnSquare, e); if (lBShiftControls.SelectedIndex == 2) Show_ControlsBn(bnShiftSquare, e);
if (lBShiftControls.SelectedIndex == 3) Show_ControlsBn(sbnTriangle, e); if (lBShiftControls.SelectedIndex == 3) Show_ControlsBn(bnShiftTriangle, e);
if (lBShiftControls.SelectedIndex == 4) Show_ControlsBn(sbnOptions, e); if (lBShiftControls.SelectedIndex == 4) Show_ControlsBn(bnShiftOptions, e);
if (lBShiftControls.SelectedIndex == 5) Show_ControlsBn(sbnShare, e); if (lBShiftControls.SelectedIndex == 5) Show_ControlsBn(bnShiftShare, e);
if (lBShiftControls.SelectedIndex == 6) Show_ControlsBn(sbnUp, e); if (lBShiftControls.SelectedIndex == 6) Show_ControlsBn(bnShiftUp, e);
if (lBShiftControls.SelectedIndex == 7) Show_ControlsBn(sbnDown, e); if (lBShiftControls.SelectedIndex == 7) Show_ControlsBn(bnShiftDown, e);
if (lBShiftControls.SelectedIndex == 8) Show_ControlsBn(sbnLeft, e); if (lBShiftControls.SelectedIndex == 8) Show_ControlsBn(bnShiftLeft, e);
if (lBShiftControls.SelectedIndex == 9) Show_ControlsBn(sbnRight, e); if (lBShiftControls.SelectedIndex == 9) Show_ControlsBn(bnShiftRight, e);
if (lBShiftControls.SelectedIndex == 10) Show_ControlsBn(sbnPS, e); if (lBShiftControls.SelectedIndex == 10) Show_ControlsBn(bnShiftPS, e);
if (lBShiftControls.SelectedIndex == 11) Show_ControlsBn(sbnL1, e); if (lBShiftControls.SelectedIndex == 11) Show_ControlsBn(bnShiftL1, e);
if (lBShiftControls.SelectedIndex == 12) Show_ControlsBn(sbnR1, e); if (lBShiftControls.SelectedIndex == 12) Show_ControlsBn(bnShiftR1, e);
if (lBShiftControls.SelectedIndex == 13) Show_ControlsBn(sbnL2, e); if (lBShiftControls.SelectedIndex == 13) Show_ControlsBn(bnShiftL2, e);
if (lBShiftControls.SelectedIndex == 14) Show_ControlsBn(sbnR2, e); if (lBShiftControls.SelectedIndex == 14) Show_ControlsBn(bnShiftR2, e);
if (lBShiftControls.SelectedIndex == 15) Show_ControlsBn(sbnL3, e); if (lBShiftControls.SelectedIndex == 15) Show_ControlsBn(bnShiftL3, e);
if (lBShiftControls.SelectedIndex == 16) Show_ControlsBn(sbnR3, e); if (lBShiftControls.SelectedIndex == 16) Show_ControlsBn(bnShiftR3, e);
if (lBShiftControls.SelectedIndex == 17) Show_ControlsBn(sbnTouchLeft, e); if (lBShiftControls.SelectedIndex == 17) Show_ControlsBn(bnShiftTouchLeft, e);
if (lBShiftControls.SelectedIndex == 18) Show_ControlsBn(sbnTouchRight, e); if (lBShiftControls.SelectedIndex == 18) Show_ControlsBn(bnShiftTouchRight, e);
if (lBShiftControls.SelectedIndex == 19) Show_ControlsBn(sbnTouchMulti, e); if (lBShiftControls.SelectedIndex == 19) Show_ControlsBn(bnShiftTouchMulti, e);
if (lBShiftControls.SelectedIndex == 20) Show_ControlsBn(sbnTouchUpper, e); if (lBShiftControls.SelectedIndex == 20) Show_ControlsBn(bnShiftTouchUpper, e);
if (lBShiftControls.SelectedIndex == 21) Show_ControlsBn(sbnLSUp, e); if (lBShiftControls.SelectedIndex == 21) Show_ControlsBn(bnShiftLSUp, e);
if (lBShiftControls.SelectedIndex == 22) Show_ControlsBn(sbnLSDown, e); if (lBShiftControls.SelectedIndex == 22) Show_ControlsBn(bnShiftLSDown, e);
if (lBShiftControls.SelectedIndex == 23) Show_ControlsBn(sbnLSLeft, e); if (lBShiftControls.SelectedIndex == 23) Show_ControlsBn(bnShiftLSLeft, e);
if (lBShiftControls.SelectedIndex == 24) Show_ControlsBn(sbnLSRight, e); if (lBShiftControls.SelectedIndex == 24) Show_ControlsBn(bnShiftLSRight, e);
if (lBShiftControls.SelectedIndex == 25) Show_ControlsBn(sbnRSUp, e); if (lBShiftControls.SelectedIndex == 25) Show_ControlsBn(bnShiftRSUp, e);
if (lBShiftControls.SelectedIndex == 26) Show_ControlsBn(sbnRSDown, e); if (lBShiftControls.SelectedIndex == 26) Show_ControlsBn(bnShiftRSDown, e);
if (lBShiftControls.SelectedIndex == 27) Show_ControlsBn(sbnRSLeft, e); if (lBShiftControls.SelectedIndex == 27) Show_ControlsBn(bnShiftRSLeft, e);
if (lBShiftControls.SelectedIndex == 28) Show_ControlsBn(sbnRSRight, e); if (lBShiftControls.SelectedIndex == 28) Show_ControlsBn(bnShiftRSRight, e);
if (lBShiftControls.SelectedIndex == 29) Show_ControlsBn(sbnGyroZN, e); if (lBShiftControls.SelectedIndex == 29) Show_ControlsBn(bnShiftGyroZN, e);
if (lBShiftControls.SelectedIndex == 30) Show_ControlsBn(sbnGyroZP, e); if (lBShiftControls.SelectedIndex == 30) Show_ControlsBn(bnShiftGyroZP, e);
if (lBShiftControls.SelectedIndex == 31) Show_ControlsBn(sbnGyroXP, e); if (lBShiftControls.SelectedIndex == 31) Show_ControlsBn(bnShiftGyroXP, e);
if (lBShiftControls.SelectedIndex == 32) Show_ControlsBn(sbnGyroXN, e); if (lBShiftControls.SelectedIndex == 32) Show_ControlsBn(bnShiftGyroXN, e);
} }
private void List_MouseDoubleClick(object sender, MouseEventArgs e) private void List_MouseDoubleClick(object sender, MouseEventArgs e)
@ -1084,14 +1078,14 @@ namespace ScpServer
} }
else else
{ {
lowBatteryPanel.Enabled = cBLightbyBattery.Checked; pnlLowBattery.Enabled = cBLightbyBattery.Checked;
//pBRainbow.Location = new Point(216, pBRainbow.Location.Y); //pBRainbow.Location = new Point(216, pBRainbow.Location.Y);
pBController.BackgroundImage = null; pBController.BackgroundImage = null;
cBLightbyBattery.Text = Properties.Resources.ColorByBattery.Replace("*nl*", "\n"); cBLightbyBattery.Text = Properties.Resources.ColorByBattery.Replace("*nl*", "\n");
} }
lbspc.Enabled = on; lbspc.Enabled = on;
lowBatteryPanel.Enabled = !on; pnlLowBattery.Enabled = !on;
FullPanel.Enabled = !on; pnlFull.Enabled = !on;
} }
private Bitmap GreyscaleImage(Bitmap image) private Bitmap GreyscaleImage(Bitmap image)
@ -1276,9 +1270,9 @@ namespace ScpServer
else else
sixaxisTimer.Stop(); sixaxisTimer.Stop();
if (tabControls.SelectedIndex == 1) if (tabControls.SelectedIndex == 1)
ShiftPanel.Visible = true; pnlShift.Visible = true;
else else
ShiftPanel.Visible = false; pnlShift.Visible = false;
} }
private void DrawCircle(object sender, PaintEventArgs e) private void DrawCircle(object sender, PaintEventArgs e)
@ -1309,7 +1303,7 @@ namespace ScpServer
private void lbSATip_Click(object sender, EventArgs e) private void lbSATip_Click(object sender, EventArgs e)
{ {
SixaxisPanel.Visible = !SixaxisPanel.Visible; pnlSixaxis.Visible = !pnlSixaxis.Visible;
pBSADeadzone.Visible = !pBSADeadzone.Visible; pBSADeadzone.Visible = !pBSADeadzone.Visible;
btnSATrack.Visible = !btnSATrack.Visible; btnSATrack.Visible = !btnSATrack.Visible;
} }
@ -1330,15 +1324,15 @@ namespace ScpServer
cBShiftLight.Checked = false; cBShiftLight.Checked = false;
if (!cBShiftLight.Checked) if (!cBShiftLight.Checked)
{ {
spBController.BackColor = pBController.BackColor; pBShiftController.BackColor = pBController.BackColor;
spBController.BackgroundImage = pBController.BackgroundImage; pBShiftController.BackgroundImage = pBController.BackgroundImage;
} }
else else
{ {
alphacolor = Math.Max(tBShiftRedBar.Value, Math.Max(tBShiftGreenBar.Value, tBShiftBlueBar.Value)); alphacolor = Math.Max(tBShiftRedBar.Value, Math.Max(tBShiftGreenBar.Value, tBShiftBlueBar.Value));
reg = Color.FromArgb(tBShiftRedBar.Value, tBShiftGreenBar.Value, tBShiftBlueBar.Value); reg = Color.FromArgb(tBShiftRedBar.Value, tBShiftGreenBar.Value, tBShiftBlueBar.Value);
full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg); full = HuetoRGB(reg.GetHue(), reg.GetBrightness(), reg);
spBController.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full); pBShiftController.BackColor = Color.FromArgb((alphacolor > 205 ? 255 : (alphacolor + 50)), full);
} }
Global.setShiftColorOn(device, cBShiftLight.Checked); Global.setShiftColorOn(device, cBShiftLight.Checked);
lbShift.Enabled = cBShiftLight.Checked; lbShift.Enabled = cBShiftLight.Checked;

File diff suppressed because it is too large Load Diff

View File

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.0.81")] [assembly: AssemblyVersion("1.4.0.85")]
[assembly: AssemblyFileVersion("1.4.0.81")] [assembly: AssemblyFileVersion("1.4.0.85")]