remove the reset method from mainmenu

This commit is contained in:
yugecin 2017-01-18 22:50:18 +01:00
parent 06a5deb3a1
commit e9046ed65e
3 changed files with 8 additions and 34 deletions

View File

@ -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;

View File

@ -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)

View File

@ -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;