let the parent draw UI, fix SBoverlay input events

This commit is contained in:
yugecin 2016-12-11 12:16:20 +01:00
parent da65270ab0
commit 03ef993a18
3 changed files with 4 additions and 4 deletions

View File

@ -175,6 +175,7 @@ public class OptionsMenu extends BasicGameState implements OptionsOverlay.Parent
int mouseX = input.getMouseX(), mouseY = input.getMouseY();
optionsOverlay.render(g, mouseX, mouseY);
UI.draw(g);
}
@Override

View File

@ -136,7 +136,6 @@ public class OptionsOverlay {
// UI
UI.getBackButton().draw();
UI.draw(g);
// tooltip
renderTooltip(g, mouseX, mouseY);

View File

@ -247,7 +247,7 @@ public class SBOverlay implements OptionsOverlay.Parent {
}
public boolean mousePressed(int button, int x, int y) {
if (menu) {
if (!menu) {
return false;
}
overlay.mousePressed(button, x, y);
@ -255,7 +255,7 @@ public class SBOverlay implements OptionsOverlay.Parent {
}
public boolean mouseDragged(int oldx, int oldy, int newx, int newy) {
if (menu) {
if (!menu) {
return false;
}
overlay.mouseDragged(oldx, oldy, newx, newy);
@ -278,7 +278,7 @@ public class SBOverlay implements OptionsOverlay.Parent {
}
public boolean mouseReleased(int button, int x, int y) {
if (menu) {
if (!menu) {
return false;
}
overlay.mouseReleased(button, x, y);