Merge branch 'sb'

This commit is contained in:
yugecin 2016-11-13 01:39:41 +01:00
commit 8d9e7aba94
7 changed files with 23 additions and 14 deletions

View File

@ -102,8 +102,4 @@ public class FakeGameObject extends GameObject {
this.halfTime = time;
}
@Override
public void updateColor() {
}
}

View File

@ -269,6 +269,7 @@ public class Circle extends GameObject {
@Override
public void updateColor() {
super.updateColor();
color = Dancer.colorOverride.getColor(comboColorIndex);
mirrorColor = Dancer.colorMirrorOverride.getColor(comboColorIndex);
}

View File

@ -100,8 +100,4 @@ public class DummyObject extends GameObject {
return null;
}
@Override
public void updateColor() {
}
}

View File

@ -22,6 +22,7 @@ import itdelatrisu.opsu.objects.curves.Vec2f;
import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import yugecin.opsudance.ObjectColorOverrides;
/**
* Interface for hit object types used during gameplay.
@ -33,6 +34,8 @@ public abstract class GameObject {
private int time;
private float hue;
public void updateStartEndPositions(int startTime) {
time = startTime;
start = getPointAt(startTime);
@ -101,6 +104,14 @@ public abstract class GameObject {
public abstract Color getColor();
public abstract Color getMirroredColor();
public abstract void updateColor();
public void updateColor() {
hue = ObjectColorOverrides.hue;
}
// the hue of objectcoloroverrides at the point of this circle..... i know, shit placement... used for sb when hue inc changes / rainbow override
public float getHue() {
return hue;
}
}

View File

@ -714,6 +714,7 @@ public class Slider extends GameObject {
@Override
public void updateColor() {
super.updateColor();
color = Dancer.colorOverride.getColor(comboColorIndex);
mirrorColor = Dancer.colorMirrorOverride.getColor(comboColorIndex);
}

View File

@ -438,7 +438,4 @@ public class Spinner extends GameObject {
return null;
}
@Override
public void updateColor() {
}
}

View File

@ -27,6 +27,7 @@ import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Input;
import org.newdawn.slick.state.StateBasedGame;
import yugecin.opsudance.ObjectColorOverrides;
import java.util.HashMap;
import java.util.Map;
@ -79,7 +80,7 @@ public class SBOverlay {
int i = 0;
for (Object o : optionsMap[index].entrySet()) {
Map.Entry<Options.GameOption, String> option = (Map.Entry<Options.GameOption, String>) o;
Fonts.SMALL.drawString(10, 50 + i * lh, option.getKey().getDisplayName(), Color.cyan);
Fonts.SMALL.drawString(10, 50 + i++ * lh, option.getKey().getDisplayName(), Color.cyan);
}
}
if (menu) {
@ -175,6 +176,7 @@ public class SBOverlay {
optionsMap[index] = new HashMap<>();
}
optionsMap[index].put(option, option.write());
readOption(option);
}
public boolean mousePressed(int button, int x, int y) {
@ -227,7 +229,12 @@ public class SBOverlay {
// needed for object color overrides...
private void readOption(Options.GameOption o) {
if (o == Options.GameOption.DANCE_OBJECT_COLOR_OVERRIDE || o == Options.GameOption.DANCE_OBJECT_COLOR_OVERRIDE_MIRRORED) {
if (o == Options.GameOption.DANCE_OBJECT_COLOR_OVERRIDE
|| o == Options.GameOption.DANCE_OBJECT_COLOR_OVERRIDE_MIRRORED
|| o == Options.GameOption.DANCE_RGB_OBJECT_INC) {
if (index < gameObjects.length) {
ObjectColorOverrides.hue = gameObjects[index].getHue();
}
for (int i = index; i < gameObjects.length; i++) {
gameObjects[i].updateColor();
}