From c1b38b2306b314544fda06926982aa23c292b0e0 Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Mon, 25 May 2015 05:33:12 -0400 Subject: [PATCH] Skin options: HitCircleOverlayAboveNumber, LayeredHitSounds. Also includes a cursor fix: beatmap-skinned cursors are now always treated like new-style cursors (as in osu!), and no longer render cursormiddle unless also skinned. Signed-off-by: Jeffrey Han --- src/itdelatrisu/opsu/UI.java | 14 +++++++----- .../opsu/audio/SoundController.java | 22 +++++++++++-------- src/itdelatrisu/opsu/objects/Circle.java | 7 +++++- src/itdelatrisu/opsu/objects/Slider.java | 7 +++++- 4 files changed, 34 insertions(+), 16 deletions(-) diff --git a/src/itdelatrisu/opsu/UI.java b/src/itdelatrisu/opsu/UI.java index 84b65b6f..42aaa105 100644 --- a/src/itdelatrisu/opsu/UI.java +++ b/src/itdelatrisu/opsu/UI.java @@ -227,10 +227,14 @@ public class UI { */ public static void drawCursor(int mouseX, int mouseY, boolean mousePressed) { // determine correct cursor image - // TODO: most beatmaps don't skin CURSOR_MIDDLE, so how to determine style? Image cursor = null, cursorMiddle = null, cursorTrail = null; boolean skinned = GameImage.CURSOR.hasSkinImage(); - boolean newStyle = (skinned) ? true : Options.isNewCursorEnabled(); + boolean newStyle, hasMiddle; + if (skinned) { + newStyle = true; // osu! currently treats all beatmap cursors as new-style cursors + hasMiddle = GameImage.CURSOR_MIDDLE.hasSkinImage(); + } else + newStyle = hasMiddle = Options.isNewCursorEnabled(); if (skinned || newStyle) { cursor = GameImage.CURSOR.getImage(); cursorTrail = GameImage.CURSOR_TRAIL.getImage(); @@ -238,7 +242,7 @@ public class UI { cursor = GameImage.CURSOR_OLD.getImage(); cursorTrail = GameImage.CURSOR_TRAIL_OLD.getImage(); } - if (newStyle) + if (hasMiddle) cursorMiddle = GameImage.CURSOR_MIDDLE.getImage(); int removeCount = 0; @@ -295,7 +299,7 @@ public class UI { if (mousePressed && skin.isCursorExpanded()) { final float scale = 1.25f; cursor = cursor.getScaledCopy(scale); - if (newStyle) + if (hasMiddle) cursorMiddle = cursorMiddle.getScaledCopy(scale); } @@ -303,7 +307,7 @@ public class UI { if (newStyle && skin.isCursorRotated()) cursor.setRotation(cursorAngle); cursor.drawCentered(mouseX, mouseY); - if (newStyle) + if (hasMiddle) cursorMiddle.drawCentered(mouseX, mouseY); } diff --git a/src/itdelatrisu/opsu/audio/SoundController.java b/src/itdelatrisu/opsu/audio/SoundController.java index a16a46fc..fd929cc1 100644 --- a/src/itdelatrisu/opsu/audio/SoundController.java +++ b/src/itdelatrisu/opsu/audio/SoundController.java @@ -279,16 +279,20 @@ public class SoundController { return; // play all sounds - HitSound.setSampleSet(sampleSet); - playClip(HitSound.NORMAL.getClip(), volume, null); + if (hitSound == HitObject.SOUND_NORMAL || Options.getSkin().isLayeredHitSounds()) { + HitSound.setSampleSet(sampleSet); + playClip(HitSound.NORMAL.getClip(), volume, null); + } - HitSound.setSampleSet(additionSampleSet); - if ((hitSound & HitObject.SOUND_WHISTLE) > 0) - playClip(HitSound.WHISTLE.getClip(), volume, null); - if ((hitSound & HitObject.SOUND_FINISH) > 0) - playClip(HitSound.FINISH.getClip(), volume, null); - if ((hitSound & HitObject.SOUND_CLAP) > 0) - playClip(HitSound.CLAP.getClip(), volume, null); + if (hitSound != HitObject.SOUND_NORMAL) { + HitSound.setSampleSet(additionSampleSet); + if ((hitSound & HitObject.SOUND_WHISTLE) > 0) + playClip(HitSound.WHISTLE.getClip(), volume, null); + if ((hitSound & HitObject.SOUND_FINISH) > 0) + playClip(HitSound.FINISH.getClip(), volume, null); + if ((hitSound & HitObject.SOUND_CLAP) > 0) + playClip(HitSound.CLAP.getClip(), volume, null); + } } /** diff --git a/src/itdelatrisu/opsu/objects/Circle.java b/src/itdelatrisu/opsu/objects/Circle.java index 0f5b1d33..d52f32fd 100644 --- a/src/itdelatrisu/opsu/objects/Circle.java +++ b/src/itdelatrisu/opsu/objects/Circle.java @@ -22,6 +22,7 @@ import itdelatrisu.opsu.GameData; import itdelatrisu.opsu.GameData.HitObjectType; import itdelatrisu.opsu.GameImage; import itdelatrisu.opsu.GameMod; +import itdelatrisu.opsu.Options; import itdelatrisu.opsu.Utils; import itdelatrisu.opsu.beatmap.HitObject; import itdelatrisu.opsu.states.Game; @@ -99,9 +100,13 @@ public class Circle implements GameObject { if (timeDiff >= 0) GameImage.APPROACHCIRCLE.getImage().getScaledCopy(approachScale).drawCentered(x, y, color); GameImage.HITCIRCLE.getImage().drawCentered(x, y, color); - GameImage.HITCIRCLE_OVERLAY.getImage().drawCentered(x, y, Utils.COLOR_WHITE_FADE); + boolean overlayAboveNumber = Options.getSkin().isHitCircleOverlayAboveNumber(); + if (!overlayAboveNumber) + GameImage.HITCIRCLE_OVERLAY.getImage().drawCentered(x, y, Utils.COLOR_WHITE_FADE); data.drawSymbolNumber(hitObject.getComboNumber(), x, y, GameImage.HITCIRCLE.getImage().getWidth() * 0.40f / data.getDefaultSymbolImage(0).getHeight(), alpha); + if (overlayAboveNumber) + GameImage.HITCIRCLE_OVERLAY.getImage().drawCentered(x, y, Utils.COLOR_WHITE_FADE); Utils.COLOR_WHITE_FADE.a = oldAlpha; } diff --git a/src/itdelatrisu/opsu/objects/Slider.java b/src/itdelatrisu/opsu/objects/Slider.java index ee91b563..00975303 100644 --- a/src/itdelatrisu/opsu/objects/Slider.java +++ b/src/itdelatrisu/opsu/objects/Slider.java @@ -22,6 +22,7 @@ import itdelatrisu.opsu.GameData; import itdelatrisu.opsu.GameData.HitObjectType; import itdelatrisu.opsu.GameImage; import itdelatrisu.opsu.GameMod; +import itdelatrisu.opsu.Options; import itdelatrisu.opsu.Utils; import itdelatrisu.opsu.beatmap.Beatmap; import itdelatrisu.opsu.beatmap.HitObject; @@ -195,12 +196,16 @@ public class Slider implements GameObject { // start circle hitCircle.drawCentered(x, y, color); - hitCircleOverlay.drawCentered(x, y, Utils.COLOR_WHITE_FADE); + boolean overlayAboveNumber = Options.getSkin().isHitCircleOverlayAboveNumber(); + if (!overlayAboveNumber) + hitCircleOverlay.drawCentered(x, y, Utils.COLOR_WHITE_FADE); if (sliderClickedInitial) ; // don't draw current combo number if already clicked else data.drawSymbolNumber(hitObject.getComboNumber(), x, y, hitCircle.getWidth() * 0.40f / data.getDefaultSymbolImage(0).getHeight(), alpha); + if (overlayAboveNumber) + hitCircleOverlay.drawCentered(x, y, Utils.COLOR_WHITE_FADE); // repeats for (int tcurRepeat = currentRepeats; tcurRepeat <= currentRepeats + 1; tcurRepeat++) {