Merge branch 'master' into replaystuff
This commit is contained in:
commit
a84786987a
|
@ -60,6 +60,8 @@ public class GameData {
|
|||
/** Time, in milliseconds, for a hit circle to fade. */
|
||||
public static final int HITCIRCLE_FADE_TIME = 300;
|
||||
|
||||
public static final int FOLLOWCIRCLE_FADE_TIME = HITCIRCLE_FADE_TIME / 2;
|
||||
|
||||
/** Duration, in milliseconds, of a combo pop effect. */
|
||||
private static final int COMBO_POP_TIME = 250;
|
||||
|
||||
|
@ -974,6 +976,17 @@ public class GameData {
|
|||
Colors.WHITE_FADE.a = oldWhiteAlpha;
|
||||
hitResult.color.a = oldColorAlpha;
|
||||
}
|
||||
|
||||
// slider follow circle
|
||||
if (hitResult.expand) {
|
||||
float progress = AnimationEquation.OUT_CUBIC.calc((float) Utils.clamp(trackPosition - hitResult.time, 0, FOLLOWCIRCLE_FADE_TIME) / FOLLOWCIRCLE_FADE_TIME);
|
||||
float scale = 1f - 0.2f * progress;
|
||||
float alpha = 1f - progress;
|
||||
Image fc = GameImage.SLIDER_FOLLOWCIRCLE.getImage().getScaledCopy(scale);
|
||||
fc.setAlpha(alpha);
|
||||
fc.drawCentered(hitResult.x, hitResult.y);
|
||||
}
|
||||
|
||||
if (!Options.isDrawSliderEndCircles()) {
|
||||
return;
|
||||
}
|
||||
|
@ -1012,6 +1025,8 @@ public class GameData {
|
|||
scaledRepeat.rotate(ang);
|
||||
scaledRepeat.drawCentered(hitResult.x, hitResult.y, hitResult.color);
|
||||
if (!Options.isDrawSliderEndCircles()) {
|
||||
GameImage.HITCIRCLE.getImage().draw(-1000, -1000); // TODO this 'fixes' #114. Why? Get a better solution!
|
||||
GameImage.HITCIRCLE_OVERLAY.getImage().draw(-1000, -1000);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ import itdelatrisu.opsu.ui.Colors;
|
|||
import itdelatrisu.opsu.ui.animations.AnimationEquation;
|
||||
|
||||
import org.newdawn.slick.Color;
|
||||
import org.newdawn.slick.GameContainer;
|
||||
import org.newdawn.slick.Graphics;
|
||||
import org.newdawn.slick.Image;
|
||||
import yugecin.opsudance.Dancer;
|
||||
|
@ -110,8 +109,12 @@ public class Slider extends GameObject {
|
|||
/** The current tick time for the follow circle expanding animation. */
|
||||
private int tickExpandTime = 0;
|
||||
|
||||
private int followExpandTime = 0;
|
||||
|
||||
/** The duration of the follow circle expanding animation on ticks. */
|
||||
private static final int TICK_EXPAND_TIME = 200;
|
||||
private static final int FOLLOW_EXPAND_TIME = 150;
|
||||
private static final int FOLLOW_SHRINK_TIME = 100;
|
||||
|
||||
/** Container dimensions. */
|
||||
private static int containerWidth, containerHeight;
|
||||
|
@ -366,9 +369,25 @@ public class Slider extends GameObject {
|
|||
}
|
||||
|
||||
// follow circle
|
||||
if (followCircleActive) {
|
||||
if (followCircleActive || followExpandTime > 0) {
|
||||
float followCircleScale = 1f + (tickExpandTime / (float) TICK_EXPAND_TIME) * 0.1f;
|
||||
GameImage.SLIDER_FOLLOWCIRCLE.getImage().getScaledCopy(followCircleScale).drawCentered(c.x, c.y);
|
||||
float followAlpha = 1f;
|
||||
if (followCircleActive && followExpandTime < FOLLOW_EXPAND_TIME) {
|
||||
followExpandTime += DisplayContainer.instance.renderDelta;
|
||||
followCircleScale *= 0.5f;
|
||||
float progress = AnimationEquation.OUT_QUAD.calc((float) followExpandTime / FOLLOW_EXPAND_TIME);
|
||||
followCircleScale = followCircleScale + followCircleScale * progress;
|
||||
followAlpha = progress;
|
||||
} else if (!followCircleActive) {
|
||||
followExpandTime -= DisplayContainer.instance.renderDelta;
|
||||
if (followExpandTime > FOLLOW_SHRINK_TIME) {
|
||||
followExpandTime = FOLLOW_SHRINK_TIME;
|
||||
}
|
||||
float progress = 1f - AnimationEquation.IN_QUAD.calc((float) followExpandTime / FOLLOW_EXPAND_TIME);
|
||||
followCircleScale *= progress;
|
||||
followAlpha = progress;
|
||||
}
|
||||
GameImage.SLIDER_FOLLOWCIRCLE.getImage().getScaledCopy(followCircleScale).setAlpha(followAlpha).drawCentered(c.x, c.y);
|
||||
|
||||
// "flashlight" mod: dim the screen
|
||||
if (GameMod.FLASHLIGHT.isActive()) {
|
||||
|
@ -716,7 +735,10 @@ public class Slider extends GameObject {
|
|||
double distance = Math.hypot(c.x - mouseX, c.y - mouseY);
|
||||
if (((keyPressed || GameMod.RELAX.isActive()) && distance < followRadius) || isAutoMod) {
|
||||
// mouse pressed and within follow circle
|
||||
followCircleActive = true;
|
||||
if (!followCircleActive) {
|
||||
followCircleActive = true;
|
||||
followExpandTime = 0;
|
||||
}
|
||||
|
||||
// held during new repeat
|
||||
if (isNewRepeat) {
|
||||
|
|
|
@ -981,8 +981,9 @@ public class Image implements Renderable {
|
|||
*
|
||||
* @param alpha The alpha value to use when rendering this image
|
||||
*/
|
||||
public void setAlpha(float alpha) {
|
||||
public Image setAlpha(float alpha) {
|
||||
this.alpha = alpha;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user