2016-09-30 19:05:53 +02:00
|
|
|
/*
|
|
|
|
* opsu!dance - fork of opsu! with cursordance auto
|
|
|
|
* Copyright (C) 2016 yugecin
|
|
|
|
*
|
|
|
|
* opsu!dance is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* opsu!dance is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with opsu!dance. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
package yugecin.opsudance;
|
|
|
|
|
|
|
|
import org.newdawn.slick.Color;
|
|
|
|
|
2017-03-26 22:57:10 +02:00
|
|
|
import static yugecin.opsudance.options.Options.*;
|
|
|
|
|
2016-09-30 19:05:53 +02:00
|
|
|
public enum ObjectColorOverrides {
|
|
|
|
|
2017-01-29 18:18:25 +01:00
|
|
|
NONE ("Do not override", 0) {
|
2016-09-30 19:05:53 +02:00
|
|
|
@Override
|
2016-09-30 21:32:24 +02:00
|
|
|
public Color getColor(int comboColorIndex) {
|
|
|
|
return comboColors[comboColorIndex];
|
2016-09-30 19:05:53 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
COMBO1 ("Combo1", 1),
|
|
|
|
COMBO2 ("Combo2", 2),
|
|
|
|
COMBO3 ("Combo3", 3),
|
|
|
|
COMBO4 ("Combo4", 4),
|
|
|
|
COMBO5 ("Combo5", 5),
|
|
|
|
COMBO6 ("Combo6", 6),
|
|
|
|
COMBO7 ("Combo7", 7),
|
|
|
|
COMBO8 ("Combo8", 8),
|
2016-09-30 21:32:24 +02:00
|
|
|
OPPOSITECOMBOCOLOR ("Opposite combo color", 9) {
|
2016-09-30 19:05:53 +02:00
|
|
|
@Override
|
2016-09-30 21:32:24 +02:00
|
|
|
public Color getColor(int comboColorIndex) {
|
|
|
|
return comboColors[(comboColorIndex + comboColors.length / 2) % comboColors.length];
|
|
|
|
}
|
|
|
|
},
|
|
|
|
RAINBOW ("Rainbow", 10) {
|
|
|
|
@Override
|
|
|
|
public Color getColor(int comboColorIndex) {
|
2016-09-30 19:05:53 +02:00
|
|
|
return nextRainbowColor();
|
|
|
|
}
|
|
|
|
},
|
2016-09-30 21:32:24 +02:00
|
|
|
RAINBOWSHIFT ("Rainbow + 180° hue shift", 11) {
|
2016-09-30 19:05:53 +02:00
|
|
|
@Override
|
2016-09-30 21:32:24 +02:00
|
|
|
public Color getColor(int comboColorIndex) {
|
2016-09-30 19:05:53 +02:00
|
|
|
return nextMirrorRainbowColor();
|
|
|
|
}
|
2016-10-01 11:38:17 +02:00
|
|
|
},
|
|
|
|
BLACK ("Black", 12) {
|
|
|
|
@Override
|
|
|
|
public Color getColor(int comboColorIndex) {
|
|
|
|
return Color.black;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
WHITE ("White", 13) {
|
|
|
|
@Override
|
|
|
|
public Color getColor(int comboColorIndex) {
|
2016-10-04 14:57:37 +02:00
|
|
|
return white;
|
2016-10-01 11:38:17 +02:00
|
|
|
}
|
2016-09-30 19:05:53 +02:00
|
|
|
};
|
|
|
|
|
2016-10-04 14:57:37 +02:00
|
|
|
private static Color white = new Color(255, 255, 255);
|
|
|
|
|
2016-09-30 19:05:53 +02:00
|
|
|
public int nr;
|
|
|
|
private String displayText;
|
|
|
|
|
|
|
|
public static Color[] comboColors;
|
|
|
|
|
|
|
|
public static float hue;
|
|
|
|
|
|
|
|
ObjectColorOverrides(String displayText, int nr) {
|
|
|
|
this.displayText = displayText;
|
|
|
|
this.nr = nr;
|
|
|
|
}
|
|
|
|
|
2016-10-01 15:10:20 +02:00
|
|
|
public static void reset(int mapID) {
|
|
|
|
hue = mapID % 360;
|
2016-10-01 15:00:12 +02:00
|
|
|
}
|
|
|
|
|
2016-09-30 19:05:53 +02:00
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return displayText;
|
|
|
|
}
|
|
|
|
|
2016-09-30 21:32:24 +02:00
|
|
|
public Color getColor(int comboColorIndex) {
|
2016-09-30 19:05:53 +02:00
|
|
|
return comboColors[nr % comboColors.length];
|
|
|
|
}
|
|
|
|
|
|
|
|
private static Color nextRainbowColor() {
|
2017-03-26 22:57:10 +02:00
|
|
|
hue += OPTION_DANCE_RGB_OBJECT_INC.val / 10f;
|
2016-09-30 19:05:53 +02:00
|
|
|
return new Color(java.awt.Color.getHSBColor(hue / 360f, 1.0f, 1.0f).getRGB());
|
|
|
|
}
|
|
|
|
|
|
|
|
private static Color nextMirrorRainbowColor() {
|
|
|
|
return new Color(java.awt.Color.getHSBColor((hue + 180f) / 360f, 1.0f, 1.0f).getRGB());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|