Merge remote-tracking branch 'remotes/original/master' into upstream

# Conflicts:
#	src/itdelatrisu/opsu/objects/Slider.java
This commit is contained in:
yugecin 2016-12-10 11:00:58 +01:00
commit badae5f85c
5 changed files with 42 additions and 25 deletions

View File

@ -906,6 +906,7 @@ public class GameData {
float scale = (!hitResult.expand) ? 1f : 1f + (HITCIRCLE_ANIM_SCALE - 1f) * progress; float scale = (!hitResult.expand) ? 1f : 1f + (HITCIRCLE_ANIM_SCALE - 1f) * progress;
float alpha = 1f - progress; float alpha = 1f - progress;
// "hidden" mod: circle and slider animations not drawn
if (!GameMod.HIDDEN.isActive()) { if (!GameMod.HIDDEN.isActive()) {
// slider curve // slider curve
if (hitResult.curve != null) { if (hitResult.curve != null) {

View File

@ -33,6 +33,8 @@ import org.json.JSONObject;
/** /**
* Download server: https://osu.hexide.com/ * Download server: https://osu.hexide.com/
* <p>
* <i>This server went offline in 2016.</i>
*/ */
public class HexideServer extends DownloadServer { public class HexideServer extends DownloadServer {
/** Server name. */ /** Server name. */

View File

@ -106,6 +106,12 @@ public class Slider extends GameObject {
/** Number of ticks hit and tick intervals so far. */ /** Number of ticks hit and tick intervals so far. */
private int ticksHit = 0, tickIntervals = 1; private int ticksHit = 0, tickIntervals = 1;
/** The current tick time for the follow circle expanding animation. */
private int tickExpandTime = 0;
/** The duration of the follow circle expanding animation on ticks. */
private static final int TICK_EXPAND_TIME = 200;
/** Container dimensions. */ /** Container dimensions. */
private static int containerWidth, containerHeight; private static int containerWidth, containerHeight;
@ -119,9 +125,6 @@ public class Slider extends GameObject {
private int comboColorIndex; private int comboColorIndex;
private int tickExpand = 0;
private final int TICKEXPAND = 200;
public int baseSliderFrom; public int baseSliderFrom;
/** /**
@ -344,7 +347,8 @@ public class Slider extends GameObject {
// follow circle // follow circle
if (followCircleActive) { if (followCircleActive) {
GameImage.SLIDER_FOLLOWCIRCLE.getImage().getScaledCopy(1f + (tickExpand / (float) TICKEXPAND) * 0.1f).drawCentered(c.x, c.y); float followCircleScale = 1f + (tickExpandTime / (float) TICK_EXPAND_TIME) * 0.1f;
GameImage.SLIDER_FOLLOWCIRCLE.getImage().getScaledCopy(followCircleScale).drawCentered(c.x, c.y);
// "flashlight" mod: dim the screen // "flashlight" mod: dim the screen
if (GameMod.FLASHLIGHT.isActive()) { if (GameMod.FLASHLIGHT.isActive()) {
@ -362,6 +366,13 @@ public class Slider extends GameObject {
color = orig; color = orig;
} }
/**
* Draws slider ticks.
* @param g the graphics context
* @param trackPosition the track position
* @param curveAlpha the curve alpha level
* @param decorationsAlpha the decorations alpha level
*/
private void drawSliderTicks(Graphics g, int trackPosition, float curveAlpha, float decorationsAlpha, boolean mirror) { private void drawSliderTicks(Graphics g, int trackPosition, float curveAlpha, float decorationsAlpha, boolean mirror) {
float tickScale = 0.5f + 0.5f * AnimationEquation.OUT_BACK.calc(decorationsAlpha); float tickScale = 0.5f + 0.5f * AnimationEquation.OUT_BACK.calc(decorationsAlpha);
Image tick = GameImage.SLIDER_TICK.getImage().getScaledCopy(tickScale); Image tick = GameImage.SLIDER_TICK.getImage().getScaledCopy(tickScale);
@ -382,6 +393,7 @@ public class Slider extends GameObject {
min = 0; min = 0;
} }
// draw ticks
for (int i = min; i < max; i++) { for (int i = min; i < max; i++) {
Vec2f c = curve.pointAt(ticksT[i]); Vec2f c = curve.pointAt(ticksT[i]);
Colors.WHITE_FADE.a = Math.min(curveAlpha, decorationsAlpha); Colors.WHITE_FADE.a = Math.min(curveAlpha, decorationsAlpha);
@ -581,17 +593,10 @@ public class Slider extends GameObject {
mousePressed(mouseX, mouseY, trackPosition); mousePressed(mouseX, mouseY, trackPosition);
} }
if (tickExpand > 0) {
tickExpand -= delta;
if (tickExpand < 0) {
tickExpand = 0;
}
}
// end of slider // end of slider
if (trackPosition > hitObject.getTime() + sliderTimeTotal) { if (trackPosition > hitObject.getTime() + sliderTimeTotal) {
tickIntervals++; tickIntervals++;
tickExpand = TICKEXPAND; tickExpandTime = TICK_EXPAND_TIME;
// check if cursor pressed and within end circle // check if cursor pressed and within end circle
if (keyPressed || GameMod.RELAX.isActive()) { if (keyPressed || GameMod.RELAX.isActive()) {
@ -617,16 +622,22 @@ public class Slider extends GameObject {
return true; return true;
} }
// update tick expand time
if (tickExpandTime > 0) {
tickExpandTime -= delta;
if (tickExpandTime < 0)
tickExpandTime = 0;
}
// repeats // repeats
boolean isNewRepeat = false; boolean isNewRepeat = false;
if (repeatCount - 1 > currentRepeats) { if (repeatCount - 1 > currentRepeats) {
float t = getT(trackPosition, true); float t = getT(trackPosition, true);
if (Math.floor(t) > currentRepeats) { if (Math.floor(t) > currentRepeats) {
currentRepeats++; currentRepeats++;
//tickIntervals++;
tickExpand = TICKEXPAND;
isNewRepeat = true;
tickIndex = 0; tickIndex = 0;
isNewRepeat = true;
tickExpandTime = TICK_EXPAND_TIME;
} }
} }
@ -639,8 +650,8 @@ public class Slider extends GameObject {
if (t - Math.floor(t) >= ticksT[tickIndex]) { if (t - Math.floor(t) >= ticksT[tickIndex]) {
tickIntervals++; tickIntervals++;
tickIndex = (tickIndex + 1) % ticksT.length; tickIndex = (tickIndex + 1) % ticksT.length;
tickExpand = TICKEXPAND;
isNewTick = true; isNewTick = true;
tickExpandTime = TICK_EXPAND_TIME;
} }
} }
@ -733,6 +744,7 @@ public class Slider extends GameObject {
tickIndex = 0; tickIndex = 0;
ticksHit = 0; ticksHit = 0;
tickIntervals = 1; tickIntervals = 1;
tickExpandTime = 0;
} }
public Curve getCurve() { public Curve getCurve() {

View File

@ -34,7 +34,6 @@ import itdelatrisu.opsu.downloads.DownloadList;
import itdelatrisu.opsu.downloads.DownloadNode; import itdelatrisu.opsu.downloads.DownloadNode;
import itdelatrisu.opsu.downloads.servers.BloodcatServer; import itdelatrisu.opsu.downloads.servers.BloodcatServer;
import itdelatrisu.opsu.downloads.servers.DownloadServer; import itdelatrisu.opsu.downloads.servers.DownloadServer;
import itdelatrisu.opsu.downloads.servers.HexideServer;
import itdelatrisu.opsu.downloads.servers.MengSkyServer; import itdelatrisu.opsu.downloads.servers.MengSkyServer;
import itdelatrisu.opsu.downloads.servers.MnetworkServer; import itdelatrisu.opsu.downloads.servers.MnetworkServer;
import itdelatrisu.opsu.downloads.servers.YaSOnlineServer; import itdelatrisu.opsu.downloads.servers.YaSOnlineServer;
@ -82,8 +81,10 @@ public class DownloadsMenu extends BasicGameState {
/** Available beatmap download servers. */ /** Available beatmap download servers. */
private static final DownloadServer[] SERVERS = { private static final DownloadServer[] SERVERS = {
new BloodcatServer(), new HexideServer(), new YaSOnlineServer(), new BloodcatServer(),
new MnetworkServer(), new MengSkyServer() new YaSOnlineServer(),
new MnetworkServer(),
new MengSkyServer()
}; };
/** The current list of search results. */ /** The current list of search results. */

View File

@ -498,16 +498,16 @@ public class Game extends BasicGameState {
// letterbox effect (black bars on top/bottom) // letterbox effect (black bars on top/bottom)
if (beatmap.letterboxInBreaks && breakLength >= 4000) { if (beatmap.letterboxInBreaks && breakLength >= 4000) {
// let it fade in/out // let it fade in/out
float a = Color.black.a; float a = Colors.BLACK_ALPHA.a;
if (trackPosition - breakTime > breakLength / 2) { if (trackPosition - breakTime > breakLength / 2) {
Color.black.a = (Math.min(500f, breakTime + breakLength - trackPosition)) / 500f; Colors.BLACK_ALPHA.a = (Math.min(500f, breakTime + breakLength - trackPosition)) / 500f;
} else { } else {
Color.black.a = Math.min(500, trackPosition - breakTime) / 500f; Colors.BLACK_ALPHA.a = Math.min(500, trackPosition - breakTime) / 500f;
} }
g.setColor(Color.black); g.setColor(Colors.BLACK_ALPHA);
Color.black.a = a;
g.fillRect(0, 0, width, height * 0.125f); g.fillRect(0, 0, width, height * 0.125f);
g.fillRect(0, height * 0.875f, width, height * 0.125f); g.fillRect(0, height * 0.875f, width, height * 0.125f);
Colors.BLACK_ALPHA.a = a;
} }
if (!Dancer.hideui || !GameMod.AUTO.isActive()) { if (!Dancer.hideui || !GameMod.AUTO.isActive()) {
@ -954,7 +954,8 @@ public class Game extends BasicGameState {
if (beatmap.breaks != null && breakIndex < beatmap.breaks.size()) { if (beatmap.breaks != null && breakIndex < beatmap.breaks.size()) {
int breakValue = beatmap.breaks.get(breakIndex); int breakValue = beatmap.breaks.get(breakIndex);
if (breakTime > 0) { // in a break period if (breakTime > 0) { // in a break period
if (trackPosition < breakValue && trackPosition < beatmap.objects[objectIndex].getTime() - approachTime) if (trackPosition < breakValue &&
trackPosition < beatmap.objects[objectIndex].getTime() - approachTime)
return; return;
else { else {
// break is over // break is over