option to hide all UI

This commit is contained in:
yugecin
2016-09-30 12:06:36 +02:00
parent 6965e33856
commit 3a1f510e31
4 changed files with 80 additions and 62 deletions

View File

@@ -698,6 +698,20 @@ public class Options {
// TODO // TODO
}, },
DANCE_HIDE_UI ("Hide all UI", "HideUI", ".", true) {
@Override
public void click(GameContainer container) {
bool = !bool;
Dancer.hideui = bool;
}
@Override
public void read(String s) {
super.read(s);
Dancer.hideui = bool;
}
},
PIPPI_ENABLE ("Pippi", "Pippi", "Move in circles like dancing pippi (osu! april fools joke 2016)", false) { PIPPI_ENABLE ("Pippi", "Pippi", "Move in circles like dancing pippi (osu! april fools joke 2016)", false) {
// TODO // TODO
}, },

View File

@@ -487,74 +487,76 @@ public class Game extends BasicGameState {
// non-break // non-break
else { else {
// game elements if (!GameMod.AUTO.isActive() || !Dancer.hideui) {
data.drawGameElements(g, false, objectIndex == 0); // game elements
data.drawGameElements(g, false, objectIndex == 0);
// skip beginning // skip beginning
if (objectIndex == 0 && if (objectIndex == 0 &&
trackPosition < beatmap.objects[0].getTime() - SKIP_OFFSET) trackPosition < beatmap.objects[0].getTime() - SKIP_OFFSET)
skipButton.draw(); skipButton.draw();
// show retries // show retries
if (retries >= 2 && timeDiff >= -1000) { if (retries >= 2 && timeDiff >= -1000) {
int retryHeight = Math.max( int retryHeight = Math.max(
GameImage.SCOREBAR_BG.getImage().getHeight(), GameImage.SCOREBAR_BG.getImage().getHeight(),
GameImage.SCOREBAR_KI.getImage().getHeight() GameImage.SCOREBAR_KI.getImage().getHeight()
); );
float oldAlpha = Colors.WHITE_FADE.a; float oldAlpha = Colors.WHITE_FADE.a;
if (timeDiff < -500) if (timeDiff < -500)
Colors.WHITE_FADE.a = (1000 + timeDiff) / 500f; Colors.WHITE_FADE.a = (1000 + timeDiff) / 500f;
Fonts.MEDIUM.drawString( Fonts.MEDIUM.drawString(
2 + (width / 100), retryHeight, 2 + (width / 100), retryHeight,
String.format("%d retries and counting...", retries), String.format("%d retries and counting...", retries),
Colors.WHITE_FADE Colors.WHITE_FADE
); );
Colors.WHITE_FADE.a = oldAlpha; Colors.WHITE_FADE.a = oldAlpha;
} }
if (isLeadIn()) if (isLeadIn())
trackPosition = (leadInTime - Options.getMusicOffset()) * -1; // render approach circles during song lead-in trackPosition = (leadInTime - Options.getMusicOffset()) * -1; // render approach circles during song lead-in
// countdown // countdown
if (beatmap.countdown > 0) { if (beatmap.countdown > 0) {
float speedModifier = GameMod.getSpeedMultiplier() * playbackSpeed.getModifier(); float speedModifier = GameMod.getSpeedMultiplier() * playbackSpeed.getModifier();
timeDiff = firstObjectTime - trackPosition; timeDiff = firstObjectTime - trackPosition;
if (timeDiff >= 500 * speedModifier && timeDiff < 3000 * speedModifier) { if (timeDiff >= 500 * speedModifier && timeDiff < 3000 * speedModifier) {
if (timeDiff >= 1500 * speedModifier) { if (timeDiff >= 1500 * speedModifier) {
GameImage.COUNTDOWN_READY.getImage().drawCentered(width / 2, height / 2); GameImage.COUNTDOWN_READY.getImage().drawCentered(width / 2, height / 2);
if (!countdownReadySound) { if (!countdownReadySound) {
SoundController.playSound(SoundEffect.READY); SoundController.playSound(SoundEffect.READY);
countdownReadySound = true; countdownReadySound = true;
}
} }
} if (timeDiff < 2000 * speedModifier) {
if (timeDiff < 2000 * speedModifier) { GameImage.COUNTDOWN_3.getImage().draw(0, 0);
GameImage.COUNTDOWN_3.getImage().draw(0, 0); if (!countdown3Sound) {
if (!countdown3Sound) { SoundController.playSound(SoundEffect.COUNT3);
SoundController.playSound(SoundEffect.COUNT3); countdown3Sound = true;
countdown3Sound = true; }
} }
} if (timeDiff < 1500 * speedModifier) {
if (timeDiff < 1500 * speedModifier) { GameImage.COUNTDOWN_2.getImage().draw(width - GameImage.COUNTDOWN_2.getImage().getWidth(), 0);
GameImage.COUNTDOWN_2.getImage().draw(width - GameImage.COUNTDOWN_2.getImage().getWidth(), 0); if (!countdown2Sound) {
if (!countdown2Sound) { SoundController.playSound(SoundEffect.COUNT2);
SoundController.playSound(SoundEffect.COUNT2); countdown2Sound = true;
countdown2Sound = true; }
} }
} if (timeDiff < 1000 * speedModifier) {
if (timeDiff < 1000 * speedModifier) { GameImage.COUNTDOWN_1.getImage().drawCentered(width / 2, height / 2);
GameImage.COUNTDOWN_1.getImage().drawCentered(width / 2, height / 2); if (!countdown1Sound) {
if (!countdown1Sound) { SoundController.playSound(SoundEffect.COUNT1);
SoundController.playSound(SoundEffect.COUNT1); countdown1Sound = true;
countdown1Sound = true; }
}
} else if (timeDiff >= -500 * speedModifier && timeDiff < 500 * speedModifier) {
Image go = GameImage.COUNTDOWN_GO.getImage();
go.setAlpha((timeDiff < 0) ? 1 - (timeDiff / speedModifier / -500f) : 1);
go.drawCentered(width / 2, height / 2);
if (!countdownGoSound) {
SoundController.playSound(SoundEffect.GO);
countdownGoSound = true;
} }
}
} else if (timeDiff >= -500 * speedModifier && timeDiff < 500 * speedModifier) {
Image go = GameImage.COUNTDOWN_GO.getImage();
go.setAlpha((timeDiff < 0) ? 1 - (timeDiff / speedModifier / -500f) : 1);
go.drawCentered(width / 2, height / 2);
if (!countdownGoSound) {
SoundController.playSound(SoundEffect.GO);
countdownGoSound = true;
} }
} }
} }
@@ -564,11 +566,11 @@ public class Game extends BasicGameState {
drawHitObjects(g, trackPosition); drawHitObjects(g, trackPosition);
} }
if (GameMod.AUTO.isActive()) if (!Dancer.hideui && GameMod.AUTO.isActive())
GameImage.UNRANKED.getImage().drawCentered(width / 2, height * 0.077f); GameImage.UNRANKED.getImage().drawCentered(width / 2, height * 0.077f);
// draw replay speed button // draw replay speed button
if (isReplay || GameMod.AUTO.isActive()) if (isReplay || (!Dancer.hideui && GameMod.AUTO.isActive()))
playbackSpeed.getButton().draw(); playbackSpeed.getButton().draw();
// draw music position bar (for replay seeking) // draw music position bar (for replay seeking)

View File

@@ -114,6 +114,7 @@ public class OptionsMenu extends BasicGameState {
GameOption.DANCE_DRAW_APPROACH, GameOption.DANCE_DRAW_APPROACH,
GameOption.DANCE_RGB_OBJECTS, GameOption.DANCE_RGB_OBJECTS,
GameOption.DANCE_REMOVE_BG, GameOption.DANCE_REMOVE_BG,
GameOption.DANCE_HIDE_UI,
}), }),
PIPPI ("Pippi", new GameOption[] { PIPPI ("Pippi", new GameOption[] {
GameOption.PIPPI_ENABLE, GameOption.PIPPI_ENABLE,

View File

@@ -54,6 +54,7 @@ public class Dancer {
public static boolean drawApproach; // this should really get its own place somewhere... public static boolean drawApproach; // this should really get its own place somewhere...
public static boolean rgbobj; // this should really get its own place somewhere... public static boolean rgbobj; // this should really get its own place somewhere...
public static boolean removebg; // this should really get its own place somewhere... public static boolean removebg; // this should really get its own place somewhere...
public static boolean hideui; // this should really get its own place somewhere...
private int dir; private int dir;
private GameObject p; private GameObject p;