Skip to content

Commit

Permalink
include envcolor check
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-hydrogen committed Jan 27, 2022
1 parent d34e70a commit 8da27e2
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,26 @@ public class BeatmapParser {
JsonArray suggestions;
JsonObject colorLeft;
JsonObject colorRight;
JsonObject envColorLeft;
JsonObject envColorRight;
if (customData != null) {
JsonObject customDataObject = customData.getAsJsonObject();
requirements = (JsonArray) customDataObject.get("_requirements");
suggestions = (JsonArray) customDataObject.get("_suggestions");
colorLeft = (JsonObject) customDataObject.get("_colorLeft");
colorRight = (JsonObject) customDataObject.get("_colorRight");
envColorLeft = (JsonObject) customDataObject.get("_envColorLeft");
envColorRight = (JsonObject) customDataObject.get("_envColorRight");
if (colorLeft != null && colorRight != null) {
primaryColor = new Color(colorLeft.get("r").getAsFloat(), colorLeft.get("g").getAsFloat(), colorLeft.get("b").getAsFloat());
secondaryColor = new Color(colorRight.get("r").getAsFloat(), colorRight.get("g").getAsFloat(), colorRight.get("b").getAsFloat());
isChroma = true;
}
if (envColorLeft != null && envColorRight != null && !isChroma) {
primaryColor = new Color(envColorLeft.get("r").getAsFloat(), envColorLeft.get("g").getAsFloat(), envColorLeft.get("b").getAsFloat());
secondaryColor = new Color(envColorLeft.get("r").getAsFloat(), envColorRight.get("g").getAsFloat(), envColorRight.get("b").getAsFloat());
isChroma = true;
}
if (requirements != null && !isChroma) {
isChroma = requirements.contains(new JsonPrimitive("Chroma"))
|| requirements.contains(new JsonPrimitive("Chroma Lighting Events"))
Expand Down

0 comments on commit 8da27e2

Please sign in to comment.