Merge branch 'objectcoloroverrides'

This commit is contained in:
yugecin 2016-09-30 21:33:29 +02:00
commit 382ea2b4dc
4 changed files with 23 additions and 18 deletions

View File

@ -78,17 +78,17 @@ public class Circle extends GameObject {
* @param hitObject the associated HitObject * @param hitObject the associated HitObject
* @param game the associated Game object * @param game the associated Game object
* @param data the associated GameData object * @param data the associated GameData object
* @param color the color of this circle * @param comboColorIndex index of the combo color of this circle
* @param comboEnd true if this is the last hit object in the combo * @param comboEnd true if this is the last hit object in the combo
*/ */
public Circle(HitObject hitObject, Game game, GameData data, Color color, boolean comboEnd) { public Circle(HitObject hitObject, Game game, GameData data, int comboColorIndex, boolean comboEnd) {
this.hitObject = hitObject; this.hitObject = hitObject;
this.game = game; this.game = game;
this.data = data; this.data = data;
this.comboEnd = comboEnd; this.comboEnd = comboEnd;
updatePosition(); updatePosition();
this.color = Dancer.colorOverride.getColor(color); color = Dancer.colorOverride.getColor(comboColorIndex);
this.mirrorColor = Dancer.colorMirrorOverride.getColor(color); mirrorColor = Dancer.colorMirrorOverride.getColor(comboColorIndex);
} }
@Override @Override

View File

@ -151,15 +151,16 @@ public class Slider extends GameObject {
* @param hitObject the associated HitObject * @param hitObject the associated HitObject
* @param game the associated Game object * @param game the associated Game object
* @param data the associated GameData object * @param data the associated GameData object
* @param comboColorIndex index of the combo color of this slider
* @param comboEnd true if this is the last hit object in the combo * @param comboEnd true if this is the last hit object in the combo
*/ */
public Slider(HitObject hitObject, Game game, GameData data, Color color, boolean comboEnd) { public Slider(HitObject hitObject, Game game, GameData data, int comboColorIndex, boolean comboEnd) {
this.hitObject = hitObject; this.hitObject = hitObject;
this.game = game; this.game = game;
this.data = data; this.data = data;
this.comboEnd = comboEnd; this.comboEnd = comboEnd;
this.color = Dancer.colorOverride.getColor(color); color = Dancer.colorOverride.getColor(comboColorIndex);
this.mirrorColor = Dancer.colorMirrorOverride.getColor(color); mirrorColor = Dancer.colorMirrorOverride.getColor(comboColorIndex);
updatePosition(); updatePosition();
// slider time calculations // slider time calculations

View File

@ -1219,8 +1219,6 @@ public class Game extends BasicGameState {
if (i + 1 >= beatmap.objects.length || beatmap.objects[i + 1].isNewCombo()) if (i + 1 >= beatmap.objects.length || beatmap.objects[i + 1].isNewCombo())
comboEnd = true; comboEnd = true;
Color color = ObjectColorOverrides.comboColors[hitObject.getComboIndex()];
// pass beatLength to hit objects // pass beatLength to hit objects
int hitObjectTime = hitObject.getTime(); int hitObjectTime = hitObject.getTime();
while (timingPointIndex < beatmap.timingPoints.size()) { while (timingPointIndex < beatmap.timingPoints.size()) {
@ -1233,9 +1231,9 @@ public class Game extends BasicGameState {
try { try {
if (hitObject.isCircle()) if (hitObject.isCircle())
gameObjects[i] = new Circle(hitObject, this, data, color, comboEnd); gameObjects[i] = new Circle(hitObject, this, data, hitObject.getComboIndex(), comboEnd);
else if (hitObject.isSlider()) else if (hitObject.isSlider())
gameObjects[i] = new Slider(hitObject, this, data, color, comboEnd); gameObjects[i] = new Slider(hitObject, this, data, hitObject.getComboIndex(), comboEnd);
else if (hitObject.isSpinner()) else if (hitObject.isSpinner())
gameObjects[i] = new Spinner(hitObject, this, data); gameObjects[i] = new Spinner(hitObject, this, data);
} catch (Exception e) { } catch (Exception e) {

View File

@ -23,8 +23,8 @@ public enum ObjectColorOverrides {
NONE ("None", 0) { NONE ("None", 0) {
@Override @Override
public Color getColor(Color color) { public Color getColor(int comboColorIndex) {
return color; return comboColors[comboColorIndex];
} }
}, },
COMBO1 ("Combo1", 1), COMBO1 ("Combo1", 1),
@ -35,15 +35,21 @@ public enum ObjectColorOverrides {
COMBO6 ("Combo6", 6), COMBO6 ("Combo6", 6),
COMBO7 ("Combo7", 7), COMBO7 ("Combo7", 7),
COMBO8 ("Combo8", 8), COMBO8 ("Combo8", 8),
RAINBOW ("Rainbow", 9) { OPPOSITECOMBOCOLOR ("Opposite combo color", 9) {
@Override @Override
public Color getColor(Color color) { public Color getColor(int comboColorIndex) {
return comboColors[(comboColorIndex + comboColors.length / 2) % comboColors.length];
}
},
RAINBOW ("Rainbow", 10) {
@Override
public Color getColor(int comboColorIndex) {
return nextRainbowColor(); return nextRainbowColor();
} }
}, },
RAINBOWSHIFT ("Rainbow + 180° hue shift", 10) { RAINBOWSHIFT ("Rainbow + 180° hue shift", 11) {
@Override @Override
public Color getColor(Color color) { public Color getColor(int comboColorIndex) {
return nextMirrorRainbowColor(); return nextMirrorRainbowColor();
} }
}; };
@ -65,7 +71,7 @@ public enum ObjectColorOverrides {
return displayText; return displayText;
} }
public Color getColor(Color color) { public Color getColor(int comboColorIndex) {
return comboColors[nr % comboColors.length]; return comboColors[nr % comboColors.length];
} }