Skip to content

Commit

Permalink
Version 1.4.32
Browse files Browse the repository at this point in the history
Added Sensitivity settings for both sticks, triggers, and the gyro
Fixed the select an action window popping up after closing the profile
settings or in another tab
Fixed the lightbar button on the main tab being so long, along with some
other random ui fixes
Fixed many issues with making a new profile
When using a custom color the light now fades out based on the current
profile settings (ie. when the battery is low)
Added Hebrew and Vietnamese translations
Updated Chinese (T), Russian, German, Polish
  • Loading branch information
Jays2Kings committed Dec 5, 2015
1 parent 2846a03 commit b528f3e
Show file tree
Hide file tree
Showing 79 changed files with 50,710 additions and 11,318 deletions.
3 changes: 2 additions & 1 deletion DS4Windows/DS4Control/ControlSerivce.cs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,8 @@ protected virtual void On_Report(object sender, EventArgs e)
EasterTime(ind);
GetInputkeys(ind);
if (LSCurve[ind] != 0 || RSCurve[ind] != 0 || LSDeadzone[ind] != 0 || RSDeadzone[ind] != 0 ||
L2Deadzone[ind] != 0 || R2Deadzone[ind] != 0) //if a curve or deadzone is in place
L2Deadzone[ind] != 0 || R2Deadzone[ind] != 0 || LSSens[ind] != 0 || RSSens[ind] != 0 ||
L2Sens[ind] != 0 || R2Sens[ind] != 0) //if a curve or deadzone is in place
cState = Mapping.SetCurveAndDeadzone(ind, cState);
if (!recordingMacro && (!string.IsNullOrEmpty(tempprofilename[ind]) ||
getHasCustomKeysorButtons(ind) || getHasShiftCustomKeysorButtons(ind) || ProfileActions[ind].Count > 0))
Expand Down
112 changes: 61 additions & 51 deletions DS4Windows/DS4Control/DS4LightBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ public static void updateLightBar(DS4Device device, int deviceNum, DS4State cSta
}
else if (UseCustomLed[deviceNum])
{
color = CustomColor[deviceNum];
if (LedAsBatteryIndicator[deviceNum])
{
DS4Color fullColor = CustomColor[deviceNum];
DS4Color lowColor = LowColor[deviceNum];

color = getTransitionedColor(lowColor, fullColor, device.Battery);
}
else
color = CustomColor[deviceNum];
}
else
{
Expand Down Expand Up @@ -70,7 +78,7 @@ public static void updateLightBar(DS4Device device, int deviceNum, DS4State cSta
//if (device.Charging == false || device.Battery >= 100) // when charged, don't show the charging animation
{
DS4Color fullColor = MainColor[deviceNum];
DS4Color lowColor = LowColor[deviceNum];
DS4Color lowColor = LowColor[deviceNum];

color = getTransitionedColor(lowColor, fullColor, (uint)device.Battery);
}
Expand All @@ -80,63 +88,65 @@ public static void updateLightBar(DS4Device device, int deviceNum, DS4State cSta
color = MainColor[deviceNum];
}

}

if (device.Battery <= FlashAt[deviceNum] && !defualtLight && !device.Charging)
if (device.Battery <= FlashAt[deviceNum] && !defualtLight && !device.Charging)
{
if (!(FlashColor[deviceNum].red == 0 &&
FlashColor[deviceNum].green == 0 &&
FlashColor[deviceNum].blue == 0))
color = FlashColor[deviceNum];
if (FlashType[deviceNum] == 1)
{
if (!(FlashColor[deviceNum].red == 0 &&
FlashColor[deviceNum].green == 0 &&
FlashColor[deviceNum].blue == 0))
color = FlashColor[deviceNum];
if (FlashType[deviceNum] == 1)
{
if (fadetimer[deviceNum] <= 0)
fadedirection[deviceNum] = true;
else if (fadetimer[deviceNum] >= 100)
fadedirection[deviceNum] = false;
if (fadedirection[deviceNum])
fadetimer[deviceNum] += 1;
else
fadetimer[deviceNum] -= 1;
color = getTransitionedColor(color, new DS4Color(0, 0, 0), fadetimer[deviceNum]);
}
}

if (IdleDisconnectTimeout[deviceNum] > 0 && LedAsBatteryIndicator[deviceNum] && (!device.Charging || device.Battery >= 100))
{//Fade lightbar by idle time
TimeSpan timeratio = new TimeSpan(DateTime.UtcNow.Ticks - device.lastActive.Ticks);
double botratio = timeratio.TotalMilliseconds;
double topratio = TimeSpan.FromSeconds(IdleDisconnectTimeout[deviceNum]).TotalMilliseconds;
double ratio = ((botratio / topratio) * 100);
if (ratio >= 50 && ratio <= 100)
color = getTransitionedColor(color, new DS4Color(0, 0, 0), (uint)((ratio - 50) * 2));
else if (ratio >= 100)
color = getTransitionedColor(color, new DS4Color(0, 0, 0), 100);
}
if (device.Charging && device.Battery < 100)
switch (ChargingType[deviceNum])
{
case 1:
if (fadetimer[deviceNum] <= 0)
fadedirection[deviceNum] = true;
else if (fadetimer[deviceNum] >= 100)
else if (fadetimer[deviceNum] >= 105)
fadedirection[deviceNum] = false;
if (fadedirection[deviceNum])
fadetimer[deviceNum] += 1;
fadetimer[deviceNum] += .1;
else
fadetimer[deviceNum] -= 1;
color = getTransitionedColor(color, new DS4Color(0,0,0), fadetimer[deviceNum]);
}
}

if (IdleDisconnectTimeout[deviceNum] > 0 && LedAsBatteryIndicator[deviceNum] && (!device.Charging || device.Battery >= 100))
{//Fade lightbar by idle time
TimeSpan timeratio = new TimeSpan(DateTime.UtcNow.Ticks - device.lastActive.Ticks);
double botratio = timeratio.TotalMilliseconds;
double topratio = TimeSpan.FromSeconds(IdleDisconnectTimeout[deviceNum]).TotalMilliseconds;
double ratio = ((botratio / topratio) * 100);
if (ratio >= 50 && ratio <= 100)
color = getTransitionedColor(color, new DS4Color(0, 0, 0), (uint)((ratio - 50) * 2));
else if (ratio >= 100)
color = getTransitionedColor(color, new DS4Color(0, 0, 0), 100);
}
if (device.Charging && device.Battery < 100)
switch (ChargingType[deviceNum])
{
case 1:
if (fadetimer[deviceNum] <= 0)
fadedirection[deviceNum] = true;
else if (fadetimer[deviceNum] >= 105)
fadedirection[deviceNum] = false;
if (fadedirection[deviceNum])
fadetimer[deviceNum] += .1;
else
fadetimer[deviceNum] -= .1;
color = getTransitionedColor(color, new DS4Color(0, 0, 0), fadetimer[deviceNum]);
break;
case 2:
counters[deviceNum] += .167;
color = HuetoRGB((float)counters[deviceNum] % 360, 255);
break;
case 3:
fadetimer[deviceNum] -= .1;
color = getTransitionedColor(color, new DS4Color(0, 0, 0), fadetimer[deviceNum]);
break;
case 2:
counters[deviceNum] += .167;
color = HuetoRGB((float)counters[deviceNum] % 360, 255);
break;
case 3:
if (!(ShiftColorOn[deviceNum] && ShiftModifier[deviceNum] > 0 && shiftMod(device, deviceNum, cState, eState, tp)) &&
!UseCustomLed[deviceNum])
color = ChargingColor[deviceNum];
break;
default:
break;
}
}
break;
default:
break;
}
}
else if (forcelight[deviceNum])
{
Expand Down
Loading

0 comments on commit b528f3e

Please sign in to comment.