add option to force fallback sliders (#24)

This commit is contained in:
yugecin 2016-10-15 00:09:52 +02:00
parent 6b1b4e2339
commit 6a5ba7cd9e
3 changed files with 11 additions and 2 deletions

View File

@ -496,6 +496,7 @@ public class Options {
FORCE_DEFAULT_PLAYFIELD ("Force Default Playfield", "ForceDefaultPlayfield", "Override the song background with the default playfield background.", false), FORCE_DEFAULT_PLAYFIELD ("Force Default Playfield", "ForceDefaultPlayfield", "Override the song background with the default playfield background.", false),
IGNORE_BEATMAP_SKINS ("Ignore All Beatmap Skins", "IgnoreBeatmapSkins", "Never use skin element overrides provided by beatmaps.", false), IGNORE_BEATMAP_SKINS ("Ignore All Beatmap Skins", "IgnoreBeatmapSkins", "Never use skin element overrides provided by beatmaps.", false),
SNAKING_SLIDERS ("Snaking sliders", "SnakingSliders", "Sliders gradually snake out from their starting point.", true), SNAKING_SLIDERS ("Snaking sliders", "SnakingSliders", "Sliders gradually snake out from their starting point.", true),
FALLBACK_SLIDERS ("Fallback sliders", "FallbackSliders", "Enable this if sliders won't render", false),
SHOW_HIT_LIGHTING ("Show Hit Lighting", "HitLighting", "Adds an effect behind hit explosions.", true), SHOW_HIT_LIGHTING ("Show Hit Lighting", "HitLighting", "Adds an effect behind hit explosions.", true),
SHOW_COMBO_BURSTS ("Show Combo Bursts", "ComboBurst", "A character image is displayed at combo milestones.", true), SHOW_COMBO_BURSTS ("Show Combo Bursts", "ComboBurst", "A character image is displayed at combo milestones.", true),
SHOW_PERFECT_HIT ("Show Perfect Hits", "PerfectHit", "Whether to show perfect hit result bursts (300s, slider ticks).", true), SHOW_PERFECT_HIT ("Show Perfect Hits", "PerfectHit", "Whether to show perfect hit result bursts (300s, slider ticks).", true),
@ -1559,6 +1560,8 @@ public class Options {
*/ */
public static boolean isSliderSnaking() { return GameOption.SNAKING_SLIDERS.getBooleanValue(); } public static boolean isSliderSnaking() { return GameOption.SNAKING_SLIDERS.getBooleanValue(); }
public static boolean isFallbackSliders() { return GameOption.FALLBACK_SLIDERS.getBooleanValue(); }
/** /**
* Returns the fixed circle size override, if any. * Returns the fixed circle size override, if any.
* @return the CS value (0, 10], 0f if disabled * @return the CS value (0, 10], 0f if disabled

View File

@ -62,6 +62,8 @@ public abstract class Curve {
/** Points along the curve (set by inherited classes). */ /** Points along the curve (set by inherited classes). */
protected Vec2f[] curve; protected Vec2f[] curve;
private Color fallbackSliderColor = new Color(20, 20, 20);
/** /**
* Constructor. * Constructor.
* @param hitObject the associated HitObject * @param hitObject the associated HitObject
@ -129,14 +131,17 @@ public abstract class Curve {
t = Utils.clamp(t, 0f, 1f); t = Utils.clamp(t, 0f, 1f);
// peppysliders // peppysliders
if (Options.getSkin().getSliderStyle() == Skin.STYLE_PEPPYSLIDER || !mmsliderSupported) { if (Options.isFallbackSliders() || Options.getSkin().getSliderStyle() == Skin.STYLE_PEPPYSLIDER || !mmsliderSupported) {
int drawUpTo = (int) (curve.length * t); int drawUpTo = (int) (curve.length * t);
Image hitCircle = GameImage.HITCIRCLE.getImage(); Image hitCircle = GameImage.HITCIRCLE.getImage();
Image hitCircleOverlay = GameImage.HITCIRCLE_OVERLAY.getImage(); Image hitCircleOverlay = GameImage.HITCIRCLE_OVERLAY.getImage();
for (int i = 0; i < drawUpTo; i++) for (int i = 0; i < drawUpTo; i++)
hitCircleOverlay.drawCentered(curve[i].x, curve[i].y, Colors.WHITE_FADE); hitCircleOverlay.drawCentered(curve[i].x, curve[i].y, Colors.WHITE_FADE);
float a = fallbackSliderColor.a;
fallbackSliderColor.a = color.a;
for (int i = 0; i < drawUpTo; i++) for (int i = 0; i < drawUpTo; i++)
hitCircle.drawCentered(curve[i].x, curve[i].y, color); hitCircle.drawCentered(curve[i].x, curve[i].y, fallbackSliderColor);
fallbackSliderColor.a = a;
} }
// mmsliders // mmsliders

View File

@ -82,6 +82,7 @@ public class OptionsMenu extends BasicGameState {
GameOption.FORCE_DEFAULT_PLAYFIELD, GameOption.FORCE_DEFAULT_PLAYFIELD,
GameOption.IGNORE_BEATMAP_SKINS, GameOption.IGNORE_BEATMAP_SKINS,
GameOption.SNAKING_SLIDERS, GameOption.SNAKING_SLIDERS,
GameOption.FALLBACK_SLIDERS,
GameOption.SHOW_HIT_LIGHTING, GameOption.SHOW_HIT_LIGHTING,
GameOption.SHOW_COMBO_BURSTS, GameOption.SHOW_COMBO_BURSTS,
GameOption.SHOW_PERFECT_HIT, GameOption.SHOW_PERFECT_HIT,