diff --git a/src/itdelatrisu/opsu/states/DownloadsMenu.java b/src/itdelatrisu/opsu/states/DownloadsMenu.java index 6a2e7c89..718be4dd 100644 --- a/src/itdelatrisu/opsu/states/DownloadsMenu.java +++ b/src/itdelatrisu/opsu/states/DownloadsMenu.java @@ -623,7 +623,6 @@ public class DownloadsMenu extends ComplexOpsuState { // back if (UI.getBackButton().contains(x, y)) { SoundController.playSound(SoundEffect.MENUBACK); - instanceContainer.provide(MainMenu.class).reset(); displayContainer.switchState(MainMenu.class); return true; } @@ -910,7 +909,6 @@ public class DownloadsMenu extends ComplexOpsuState { } else { // return to main menu SoundController.playSound(SoundEffect.MENUBACK); - instanceContainer.provide(MainMenu.class).reset(); displayContainer.switchState(MainMenu.class); } return true; diff --git a/src/itdelatrisu/opsu/states/MainMenu.java b/src/itdelatrisu/opsu/states/MainMenu.java index 8bf821c0..a56418fe 100644 --- a/src/itdelatrisu/opsu/states/MainMenu.java +++ b/src/itdelatrisu/opsu/states/MainMenu.java @@ -224,8 +224,6 @@ public class MainMenu extends BaseOpsuState { logoOpen = new AnimatedValue(100, 0, centerOffsetX, AnimationEquation.OUT_QUAD); logoClose = new AnimatedValue(2200, centerOffsetX, 0, AnimationEquation.OUT_QUAD); logoButtonAlpha = new AnimatedValue(200, 0f, 1f, AnimationEquation.LINEAR); - - reset(); } @Override @@ -459,6 +457,14 @@ public class MainMenu extends BaseOpsuState { @Override public void enter() { super.enter(); + + logo.setX(displayContainer.width / 2); + logoOpen.setTime(0); + logoClose.setTime(0); + logoButtonAlpha.setTime(0); + logoTimer = 0; + logoState = LogoState.DEFAULT; + UI.enter(); if (!enterNotification) { if (Updater.get().getStatus() == Updater.Status.UPDATE_AVAILABLE) { @@ -688,34 +694,6 @@ public class MainMenu extends BaseOpsuState { (cy > musicBarY && cy < musicBarY + musicBarHeight)); } - /** - * Resets the button states. - */ - public void reset() { - // reset logo - logo.setX(displayContainer.width / 2); - logoOpen.setTime(0); - logoClose.setTime(0); - logoButtonAlpha.setTime(0); - logoTimer = 0; - logoState = LogoState.DEFAULT; - - logo.resetHover(); - playButton.resetHover(); - exitButton.resetHover(); - musicPlay.resetHover(); - musicPause.resetHover(); - musicNext.resetHover(); - musicPrevious.resetHover(); - if (repoButton != null) - repoButton.resetHover(); - if (danceRepoButton != null) - danceRepoButton.resetHover(); - updateButton.resetHover(); - restartButton.resetHover(); - downloadsButton.resetHover(); - } - /** * Plays the next track, and adds the previous one to the stack. * @param user {@code true} if this was user-initiated, false otherwise (track end) diff --git a/src/itdelatrisu/opsu/states/SongMenu.java b/src/itdelatrisu/opsu/states/SongMenu.java index 788fb9a8..af2ca892 100644 --- a/src/itdelatrisu/opsu/states/SongMenu.java +++ b/src/itdelatrisu/opsu/states/SongMenu.java @@ -941,7 +941,6 @@ public class SongMenu extends BaseOpsuState { if (UI.getBackButton().contains(x, y)) { SoundController.playSound(SoundEffect.MENUBACK); - instanceContainer.provide(MainMenu.class).reset(); // TODO d why is this needed displayContainer.switchState(MainMenu.class); return true; } @@ -1091,7 +1090,6 @@ public class SongMenu extends BaseOpsuState { } else*/ { // return to main menu SoundController.playSound(SoundEffect.MENUBACK); - instanceContainer.provide(MainMenu.class).reset(); // TODO d is this needed displayContainer.switchState(MainMenu.class); } return true;