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 <itdelatrisu@gmail.com>
This commit is contained in:
Jeffrey Han 2015-05-25 05:33:12 -04:00
parent b804a4d154
commit c1b38b2306
4 changed files with 34 additions and 16 deletions

View File

@ -227,10 +227,14 @@ public class UI {
*/ */
public static void drawCursor(int mouseX, int mouseY, boolean mousePressed) { public static void drawCursor(int mouseX, int mouseY, boolean mousePressed) {
// determine correct cursor image // determine correct cursor image
// TODO: most beatmaps don't skin CURSOR_MIDDLE, so how to determine style?
Image cursor = null, cursorMiddle = null, cursorTrail = null; Image cursor = null, cursorMiddle = null, cursorTrail = null;
boolean skinned = GameImage.CURSOR.hasSkinImage(); 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) { if (skinned || newStyle) {
cursor = GameImage.CURSOR.getImage(); cursor = GameImage.CURSOR.getImage();
cursorTrail = GameImage.CURSOR_TRAIL.getImage(); cursorTrail = GameImage.CURSOR_TRAIL.getImage();
@ -238,7 +242,7 @@ public class UI {
cursor = GameImage.CURSOR_OLD.getImage(); cursor = GameImage.CURSOR_OLD.getImage();
cursorTrail = GameImage.CURSOR_TRAIL_OLD.getImage(); cursorTrail = GameImage.CURSOR_TRAIL_OLD.getImage();
} }
if (newStyle) if (hasMiddle)
cursorMiddle = GameImage.CURSOR_MIDDLE.getImage(); cursorMiddle = GameImage.CURSOR_MIDDLE.getImage();
int removeCount = 0; int removeCount = 0;
@ -295,7 +299,7 @@ public class UI {
if (mousePressed && skin.isCursorExpanded()) { if (mousePressed && skin.isCursorExpanded()) {
final float scale = 1.25f; final float scale = 1.25f;
cursor = cursor.getScaledCopy(scale); cursor = cursor.getScaledCopy(scale);
if (newStyle) if (hasMiddle)
cursorMiddle = cursorMiddle.getScaledCopy(scale); cursorMiddle = cursorMiddle.getScaledCopy(scale);
} }
@ -303,7 +307,7 @@ public class UI {
if (newStyle && skin.isCursorRotated()) if (newStyle && skin.isCursorRotated())
cursor.setRotation(cursorAngle); cursor.setRotation(cursorAngle);
cursor.drawCentered(mouseX, mouseY); cursor.drawCentered(mouseX, mouseY);
if (newStyle) if (hasMiddle)
cursorMiddle.drawCentered(mouseX, mouseY); cursorMiddle.drawCentered(mouseX, mouseY);
} }

View File

@ -279,9 +279,12 @@ public class SoundController {
return; return;
// play all sounds // play all sounds
if (hitSound == HitObject.SOUND_NORMAL || Options.getSkin().isLayeredHitSounds()) {
HitSound.setSampleSet(sampleSet); HitSound.setSampleSet(sampleSet);
playClip(HitSound.NORMAL.getClip(), volume, null); playClip(HitSound.NORMAL.getClip(), volume, null);
}
if (hitSound != HitObject.SOUND_NORMAL) {
HitSound.setSampleSet(additionSampleSet); HitSound.setSampleSet(additionSampleSet);
if ((hitSound & HitObject.SOUND_WHISTLE) > 0) if ((hitSound & HitObject.SOUND_WHISTLE) > 0)
playClip(HitSound.WHISTLE.getClip(), volume, null); playClip(HitSound.WHISTLE.getClip(), volume, null);
@ -290,6 +293,7 @@ public class SoundController {
if ((hitSound & HitObject.SOUND_CLAP) > 0) if ((hitSound & HitObject.SOUND_CLAP) > 0)
playClip(HitSound.CLAP.getClip(), volume, null); playClip(HitSound.CLAP.getClip(), volume, null);
} }
}
/** /**
* Plays a hit sound. * Plays a hit sound.

View File

@ -22,6 +22,7 @@ import itdelatrisu.opsu.GameData;
import itdelatrisu.opsu.GameData.HitObjectType; import itdelatrisu.opsu.GameData.HitObjectType;
import itdelatrisu.opsu.GameImage; import itdelatrisu.opsu.GameImage;
import itdelatrisu.opsu.GameMod; import itdelatrisu.opsu.GameMod;
import itdelatrisu.opsu.Options;
import itdelatrisu.opsu.Utils; import itdelatrisu.opsu.Utils;
import itdelatrisu.opsu.beatmap.HitObject; import itdelatrisu.opsu.beatmap.HitObject;
import itdelatrisu.opsu.states.Game; import itdelatrisu.opsu.states.Game;
@ -99,9 +100,13 @@ public class Circle implements GameObject {
if (timeDiff >= 0) if (timeDiff >= 0)
GameImage.APPROACHCIRCLE.getImage().getScaledCopy(approachScale).drawCentered(x, y, color); GameImage.APPROACHCIRCLE.getImage().getScaledCopy(approachScale).drawCentered(x, y, color);
GameImage.HITCIRCLE.getImage().drawCentered(x, y, color); GameImage.HITCIRCLE.getImage().drawCentered(x, y, color);
boolean overlayAboveNumber = Options.getSkin().isHitCircleOverlayAboveNumber();
if (!overlayAboveNumber)
GameImage.HITCIRCLE_OVERLAY.getImage().drawCentered(x, y, Utils.COLOR_WHITE_FADE); GameImage.HITCIRCLE_OVERLAY.getImage().drawCentered(x, y, Utils.COLOR_WHITE_FADE);
data.drawSymbolNumber(hitObject.getComboNumber(), x, y, data.drawSymbolNumber(hitObject.getComboNumber(), x, y,
GameImage.HITCIRCLE.getImage().getWidth() * 0.40f / data.getDefaultSymbolImage(0).getHeight(), alpha); 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; Utils.COLOR_WHITE_FADE.a = oldAlpha;
} }

View File

@ -22,6 +22,7 @@ import itdelatrisu.opsu.GameData;
import itdelatrisu.opsu.GameData.HitObjectType; import itdelatrisu.opsu.GameData.HitObjectType;
import itdelatrisu.opsu.GameImage; import itdelatrisu.opsu.GameImage;
import itdelatrisu.opsu.GameMod; import itdelatrisu.opsu.GameMod;
import itdelatrisu.opsu.Options;
import itdelatrisu.opsu.Utils; import itdelatrisu.opsu.Utils;
import itdelatrisu.opsu.beatmap.Beatmap; import itdelatrisu.opsu.beatmap.Beatmap;
import itdelatrisu.opsu.beatmap.HitObject; import itdelatrisu.opsu.beatmap.HitObject;
@ -195,12 +196,16 @@ public class Slider implements GameObject {
// start circle // start circle
hitCircle.drawCentered(x, y, color); hitCircle.drawCentered(x, y, color);
boolean overlayAboveNumber = Options.getSkin().isHitCircleOverlayAboveNumber();
if (!overlayAboveNumber)
hitCircleOverlay.drawCentered(x, y, Utils.COLOR_WHITE_FADE); hitCircleOverlay.drawCentered(x, y, Utils.COLOR_WHITE_FADE);
if (sliderClickedInitial) if (sliderClickedInitial)
; // don't draw current combo number if already clicked ; // don't draw current combo number if already clicked
else else
data.drawSymbolNumber(hitObject.getComboNumber(), x, y, data.drawSymbolNumber(hitObject.getComboNumber(), x, y,
hitCircle.getWidth() * 0.40f / data.getDefaultSymbolImage(0).getHeight(), alpha); hitCircle.getWidth() * 0.40f / data.getDefaultSymbolImage(0).getHeight(), alpha);
if (overlayAboveNumber)
hitCircleOverlay.drawCentered(x, y, Utils.COLOR_WHITE_FADE);
// repeats // repeats
for (int tcurRepeat = currentRepeats; tcurRepeat <= currentRepeats + 1; tcurRepeat++) { for (int tcurRepeat = currentRepeats; tcurRepeat <= currentRepeats + 1; tcurRepeat++) {