Skip to content

Commit

Permalink
Use default combo colors when "Ignore All Beatmap Skins" is on.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
  • Loading branch information
itdelatrisu committed Jan 2, 2017
1 parent e9889b7 commit 9b627e0
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/itdelatrisu/opsu/states/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,9 @@ public void enter(GameContainer container, StateBasedGame game)
}

// initialize object maps
Color[] combo = beatmap.getComboColors();
boolean ignoreSkins = Options.isBeatmapSkinIgnored();
Color[] combo = ignoreSkins ? Options.getSkin().getComboColors() : beatmap.getComboColors();
int comboIndex = 0;
for (int i = 0; i < beatmap.objects.length; i++) {
HitObject hitObject = beatmap.objects[i];

Expand All @@ -1364,7 +1366,17 @@ public void enter(GameContainer container, StateBasedGame game)
if (i + 1 >= beatmap.objects.length || beatmap.objects[i + 1].isNewCombo())
comboEnd = true;

Color color = combo[hitObject.getComboIndex()];
// calculate color index if ignoring beatmap skin
Color color;
if (ignoreSkins) {
if (hitObject.isNewCombo() || i == 0) {
int skip = (hitObject.isSpinner() ? 0 : 1) + hitObject.getComboSkip();
for (int j = 0; j < skip; j++)
comboIndex = (comboIndex + 1) % combo.length;
}
color = combo[comboIndex];
} else
color = combo[hitObject.getComboIndex()];

// pass beatLength to hit objects
int hitObjectTime = hitObject.getTime();
Expand Down

0 comments on commit 9b627e0

Please sign in to comment.