Skip to content

Commit

Permalink
take prop mode into account for last step gradient event
Browse files Browse the repository at this point in the history
  • Loading branch information
Caeden117 committed Nov 21, 2021
1 parent c94d895 commit b97dd5e
Showing 1 changed file with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,26 @@ public StrobeStepGradientPass(int value, bool switchColors, float precision, Fun
if (alternateColors) value = InvertColors(value);
}

var lastEvent = new MapEvent(endTime, type, value, new JSONObject());
lastEvent.CustomData.Add("_color", colorPoints.OrderByDescending(x => x.Key).First().Value);
generatedObjects.Add(lastEvent);
if (distanceInBeats < -0.01f)
{
var lastEvent = new MapEvent(endTime, type, value, new JSONObject());
lastEvent.CustomData.Add("_color", colorPoints.OrderByDescending(x => x.Key).First().Value);

if (propMode != EventsContainer.PropMode.Off)
{
if (value != MapEvent.LightValueBlueON && value != MapEvent.LightValueRedON &&
value != MapEvent.LightValueOff)
{
lastEvent.Value = value < 5
? MapEvent.LightValueBlueON
: MapEvent.LightValueRedON;
}

lastEvent.CustomData.Add("_lightID", propID);
}

generatedObjects.Add(lastEvent);
}

return generatedObjects;
}
Expand Down

0 comments on commit b97dd5e

Please sign in to comment.