From e620dce4b9d7b18cf884fe897ba230b978a4ad71 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 9 May 2017 17:23:51 -0700 Subject: [PATCH] Minor clean up --- DS4Windows/DS4Control/ControlSerivce.cs | 110 +++--------------------- DS4Windows/DS4Forms/DS4Form.cs | 1 - 2 files changed, 11 insertions(+), 100 deletions(-) diff --git a/DS4Windows/DS4Control/ControlSerivce.cs b/DS4Windows/DS4Control/ControlSerivce.cs index c92f45d..b58704c 100644 --- a/DS4Windows/DS4Control/ControlSerivce.cs +++ b/DS4Windows/DS4Control/ControlSerivce.cs @@ -20,8 +20,6 @@ namespace DS4Windows public DS4StateExposed[] ExposedState = new DS4StateExposed[DS4_CONTROLLER_COUNT]; public bool recordingMacro = false; public event EventHandler Debug = null; - public bool eastertime = false; - private int eCode = 0; bool[] buttonsdown = { false, false, false, false }; List dcs = new List(); bool[] held = new bool[DS4_CONTROLLER_COUNT]; @@ -399,9 +397,9 @@ namespace DS4Windows public string getDS4ControllerInfo(int index) { - if (DS4Controllers[index] != null) + DS4Device d = DS4Controllers[index]; + if (d != null) { - DS4Device d = DS4Controllers[index]; if (!d.IsAlive()) //return "Connecting..."; // awaiting the first battery charge indication { @@ -435,9 +433,9 @@ namespace DS4Windows public string getDS4MacAddress(int index) { - if (DS4Controllers[index] != null) + DS4Device d = DS4Controllers[index]; + if (d != null) { - DS4Device d = DS4Controllers[index]; if (!d.IsAlive()) //return "Connecting..."; // awaiting the first battery charge indication { @@ -456,10 +454,10 @@ namespace DS4Windows public string getShortDS4ControllerInfo(int index) { - if (DS4Controllers[index] != null) + DS4Device d = DS4Controllers[index]; + if (d != null) { - DS4Device d = DS4Controllers[index]; - String battery; + string battery; if (!d.IsAlive()) battery = "..."; @@ -483,9 +481,9 @@ namespace DS4Windows public string getDS4Battery(int index) { - if (DS4Controllers[index] != null) + DS4Device d = DS4Controllers[index]; + if (d != null) { - DS4Device d = DS4Controllers[index]; string battery; if (!d.IsAlive()) battery = "..."; @@ -510,9 +508,9 @@ namespace DS4Windows public string getDS4Status(int index) { - if (DS4Controllers[index] != null) + DS4Device d = DS4Controllers[index]; + if (d != null) { - DS4Device d = DS4Controllers[index]; return d.getConnectionType() + ""; } else @@ -628,10 +626,6 @@ namespace DS4Windows CheckForTouchToggle(ind, cState, pState); } - // Temporarily disable easter time routine - //if (eastertime) - // EasterTime(ind); - cState = Mapping.SetCurveAndDeadzone(ind, cState); if (!recordingMacro && (!string.IsNullOrEmpty(tempprofilename[ind]) || @@ -692,88 +686,6 @@ namespace DS4Windows } } - /* TODO: Not used. Possible candidate for removal. Currently keeping for reference. */ - /*public void EasterTime(int ind) - { - DS4State cState = CurrentState[ind]; - DS4StateExposed eState = ExposedState[ind]; - Mouse tp = touchPad[ind]; - - bool pb = false; - //foreach (DS4Controls dc in dcs) - for (int i = 0, dcslen = dcs.Count; i < dcslen; i++) - { - DS4Controls dc = dcs[i]; - if (Mapping.getBoolMapping(ind, dc, cState, eState, tp)) - { - pb = true; - break; - } - } - - int temp = eCode; - //Looks like you found the easter egg code, since you're already cheating, - //I scrambled the code for you :) - if (pb && !buttonsdown[ind]) - { - if (cState.Cross && eCode == 9) - eCode++; - else if (!cState.Cross && eCode == 9) - eCode = 0; - else if (cState.DpadLeft && eCode == 6) - eCode++; - else if (!cState.DpadLeft && eCode == 6) - eCode = 0; - else if (cState.DpadRight && eCode == 7) - eCode++; - else if (!cState.DpadRight && eCode == 7) - eCode = 0; - else if (cState.DpadLeft && eCode == 4) - eCode++; - else if (!cState.DpadLeft && eCode == 4) - eCode = 0; - else if (cState.DpadDown && eCode == 2) - eCode++; - else if (!cState.DpadDown && eCode == 2) - eCode = 0; - else if (cState.DpadRight && eCode == 5) - eCode++; - else if (!cState.DpadRight && eCode == 5) - eCode = 0; - else if (cState.DpadUp && eCode == 1) - eCode++; - else if (!cState.DpadUp && eCode == 1) - eCode = 0; - else if (cState.DpadDown && eCode == 3) - eCode++; - else if (!cState.DpadDown && eCode == 3) - eCode = 0; - else if (cState.Circle && eCode == 8) - eCode++; - else if (!cState.Circle && eCode == 8) - eCode = 0; - - if (cState.DpadUp && eCode == 0) - eCode++; - - if (eCode == 10) - { - string message = "(!)"; - sp.Play(); - LogDebug(message, true); - eCode = 0; - } - - if (temp != eCode) - Console.WriteLine(eCode); - - buttonsdown[ind] = true; - } - else if (!pb) - buttonsdown[ind] = false; - } - */ - public string GetInputkeys(int ind) { DS4State cState = CurrentState[ind]; diff --git a/DS4Windows/DS4Forms/DS4Form.cs b/DS4Windows/DS4Forms/DS4Form.cs index 37860f0..6f8ea9e 100644 --- a/DS4Windows/DS4Forms/DS4Form.cs +++ b/DS4Windows/DS4Forms/DS4Form.cs @@ -1738,7 +1738,6 @@ namespace DS4Windows opt.inputtimer.Stop(); else if (opt.Visible && tabMain.SelectedIndex == 1) opt.inputtimer.Start(); - Program.rootHub.eastertime = tabMain.SelectedTab == tabLog; } private void Items_MouseHover(object sender, EventArgs e)