@Override public void enter(GameContainer container, StateBasedGame game) throws SlickException { UI.enter(); if (!enterNotification) { if (Updater.get().getStatus() == Updater.Status.UPDATE_AVAILABLE) { UI.sendBarNotification("An opsu! update is available."); enterNotification = true; } else if (Updater.get().justUpdated()) { UI.sendBarNotification("opsu! is now up to date!"); enterNotification = true; } } // reset button hover states if mouse is not currently hovering over the button int mouseX = input.getMouseX(), mouseY = input.getMouseY(); if (!logo.contains(mouseX, mouseY, 0.25f)) logo.resetHover(); if (!playButton.contains(mouseX, mouseY, 0.25f)) playButton.resetHover(); if (!optionsButton.contains(mouseX, mouseY, 0.25f)) optionsButton.resetHover(); if (!exitButton.contains(mouseX, mouseY, 0.25f)) exitButton.resetHover(); if (!musicPlay.contains(mouseX, mouseY)) musicPlay.resetHover(); if (!musicPause.contains(mouseX, mouseY)) musicPause.resetHover(); if (!musicNext.contains(mouseX, mouseY)) musicNext.resetHover(); if (!musicPrevious.contains(mouseX, mouseY)) musicPrevious.resetHover(); if (repoButton != null && !repoButton.contains(mouseX, mouseY)) repoButton.resetHover(); if (!updateButton.contains(mouseX, mouseY)) updateButton.resetHover(); if (!downloadsButton.contains(mouseX, mouseY)) downloadsButton.resetHover(); }
@Override public void enter(GameContainer container, StateBasedGame game) throws SlickException { UI.enter(); if (menuState != null) menuState.enter(container, game); }