Merge branch 'rgbcircles'

This commit is contained in:
yugecin 2016-09-30 09:17:47 +02:00
commit c200778588
6 changed files with 38 additions and 2 deletions

View File

@ -666,6 +666,20 @@ public class Options {
}
},
DANCE_RGB_OBJECTS ("Use rgb objects", "RGBObj", "Give each object a new color", false) {
@Override
public void click(GameContainer container) {
bool = !bool;
Dancer.rgbobj = bool;
}
@Override
public void read(String s) {
super.read(s);
Dancer.rgbobj = bool;
}
},
PIPPI_ENABLE ("Pippi", "Pippi", "Move in circles like dancing pippi (osu! april fools joke 2016)", false) {
// TODO
},

View File

@ -23,6 +23,7 @@ import itdelatrisu.opsu.audio.SoundEffect;
import itdelatrisu.opsu.beatmap.HitObject;
import itdelatrisu.opsu.downloads.Download;
import itdelatrisu.opsu.downloads.DownloadNode;
import itdelatrisu.opsu.objects.Circle;
import itdelatrisu.opsu.replay.PlaybackSpeed;
import itdelatrisu.opsu.ui.Fonts;
import itdelatrisu.opsu.ui.UI;
@ -587,4 +588,13 @@ public class Utils {
return n;
}
public static Color nextColor() {
Circle.hue += 10;
return new Color(java.awt.Color.getHSBColor(Circle.hue / 360f, 1.0f, 1.0f).getRGB());
}
public static Color currentShiftColor() {
return new Color(java.awt.Color.getHSBColor((Circle.hue + 180f) / 360f, 1.0f, 1.0f).getRGB());
}
}

View File

@ -59,6 +59,8 @@ public class Circle extends GameObject {
/** Whether or not the circle result ends the combo streak. */
private boolean comboEnd;
public static int hue;
/**
* Initializes the Circle data type with map modifiers, images, and dimensions.
* @param container the game container
@ -87,13 +89,17 @@ public class Circle extends GameObject {
this.color = color;
this.comboEnd = comboEnd;
updatePosition();
if (Dancer.rgbobj) {
this.color = Utils.nextColor();
}
}
@Override
public void draw(Graphics g, int trackPosition, boolean mirror) {
Color orig = color;
if (mirror) {
color = Utils.shiftHue(color, 180d);
//color = Utils.currentShiftColor();
color = Utils.shiftHue(color, 180f);
}
int timeDiff = hitObject.getTime() - trackPosition;

View File

@ -159,6 +159,9 @@ public class Slider extends GameObject {
this.data = data;
this.color = color;
this.comboEnd = comboEnd;
if (Dancer.rgbobj) {
this.color = Utils.nextColor();
}
updatePosition();
// slider time calculations
@ -183,7 +186,8 @@ public class Slider extends GameObject {
public void draw(Graphics g, int trackPosition, boolean mirror) {
Color orig = color;
if (mirror) {
color = Utils.shiftHue(color, 180d);
//color = Utils.currentShiftColor();
color = Utils.shiftHue(color, 180f);
}
int timeDiff = hitObject.getTime() - trackPosition;

View File

@ -112,6 +112,7 @@ public class OptionsMenu extends BasicGameState {
GameOption.DANCE_ONLY_CIRCLE_STACKS,
GameOption.DANCE_MIRROR,
GameOption.DANCE_DRAW_APPROACH,
GameOption.DANCE_RGB_OBJECTS,
}),
PIPPI ("Pippi", new GameOption[] {
GameOption.PIPPI_ENABLE,

View File

@ -52,6 +52,7 @@ public class Dancer {
public static boolean mirror; // this should really get its own place somewhere...
public static boolean drawApproach; // this should really get its own place somewhere...
public static boolean rgbobj; // this should really get its own place somewhere...
private int dir;
private GameObject p;