fix back button
Make it immune to the "do not hover if options visible" hack. Make the states render it, not the options menu.
This commit is contained in:
parent
70902e42cb
commit
ab6aa75f8b
|
@ -537,7 +537,7 @@ public class DownloadsMenu extends ComplexOpsuState {
|
|||
}
|
||||
importThread = null;
|
||||
}
|
||||
backButton.hoverUpdate(delta, mouseX, mouseY);
|
||||
backButton.hoverUpdate();
|
||||
prevPage.hoverUpdate(delta, mouseX, mouseY);
|
||||
nextPage.hoverUpdate(delta, mouseX, mouseY);
|
||||
clearButton.hoverUpdate(delta, mouseX, mouseY);
|
||||
|
|
|
@ -717,6 +717,9 @@ public class Game extends ComplexOpsuState {
|
|||
|
||||
if (OPTION_DANCE_ENABLE_SB.state) {
|
||||
optionsOverlay.render(g);
|
||||
if (optionsOverlay.isActive()) {
|
||||
backButton.draw(g);
|
||||
}
|
||||
}
|
||||
|
||||
UI.draw(g);
|
||||
|
@ -728,6 +731,9 @@ public class Game extends ComplexOpsuState {
|
|||
|
||||
if (OPTION_DANCE_ENABLE_SB.state) {
|
||||
optionsOverlay.preRenderUpdate();
|
||||
if (optionsOverlay.isActive()) {
|
||||
backButton.hoverUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
int delta = renderDelta;
|
||||
|
|
|
@ -107,7 +107,7 @@ public class GameRanking extends BaseOpsuState {
|
|||
} else {
|
||||
MusicController.loopTrackIfEnded(true);
|
||||
}
|
||||
backButton.hoverUpdate(delta, mouseX, mouseY);
|
||||
backButton.hoverUpdate();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -481,6 +481,9 @@ public class MainMenu extends BaseOpsuState {
|
|||
@Override
|
||||
public void preRenderUpdate() {
|
||||
optionsOverlay.preRenderUpdate();
|
||||
if (optionsOverlay.isActive()) {
|
||||
backButton.hoverUpdate();
|
||||
}
|
||||
|
||||
int delta = renderDelta;
|
||||
|
||||
|
|
|
@ -689,10 +689,10 @@ public class SongMenu extends ComplexOpsuState {
|
|||
|
||||
UI.drawLoadingProgress(g);
|
||||
} else {
|
||||
optionsOverlay.render(g);
|
||||
backButton.draw(g);
|
||||
}
|
||||
|
||||
optionsOverlay.render(g);
|
||||
|
||||
UI.draw(g);
|
||||
|
||||
|
@ -729,7 +729,7 @@ public class SongMenu extends ComplexOpsuState {
|
|||
MusicController.playThemeSong(config.themeBeatmap);
|
||||
reloadThread = null;
|
||||
}
|
||||
backButton.hoverUpdate(delta, mouseX, mouseY);
|
||||
backButton.hoverUpdate();
|
||||
selectModsButton.hoverUpdate(delta, mouseX, mouseY);
|
||||
selectRandomButton.hoverUpdate(delta, mouseX, mouseY);
|
||||
selectMapOptionsButton.hoverUpdate(delta, mouseX, mouseY);
|
||||
|
|
|
@ -172,11 +172,11 @@ public class BackButton {
|
|||
/**
|
||||
* Processes a hover action depending on whether or not the cursor
|
||||
* is hovering over the button.
|
||||
* @param delta the delta interval
|
||||
* @param cx the x coordinate
|
||||
* @param cy the y coordinate
|
||||
*/
|
||||
public void hoverUpdate(int delta, int cx, int cy) {
|
||||
public void hoverUpdate() {
|
||||
final int delta = renderDelta;
|
||||
final int cx = mouseX;
|
||||
final int cy = mouseY;
|
||||
if (backButton != null) {
|
||||
backButton.hoverUpdate(delta, cx, cy);
|
||||
return;
|
||||
|
|
|
@ -702,7 +702,6 @@ public class OptionsOverlay implements ResolutionChangedListener {
|
|||
prevMouseY = mouseY;
|
||||
updateHoverOption(mouseX, mouseY);
|
||||
updateIndicatorAlpha();
|
||||
backButton.hoverUpdate(delta, mouseX, mouseY);
|
||||
if (isAdjustingSlider) {
|
||||
int sliderValue = ((NumericOption) hoverOption).val;
|
||||
updateSliderOption();
|
||||
|
|
Loading…
Reference in New Issue
Block a user