From 03ef993a186c187882f37e89044e61265c08b5fc Mon Sep 17 00:00:00 2001 From: yugecin Date: Sun, 11 Dec 2016 12:16:20 +0100 Subject: [PATCH] let the parent draw UI, fix SBoverlay input events --- src/itdelatrisu/opsu/states/OptionsMenu.java | 1 + src/yugecin/opsudance/ui/OptionsOverlay.java | 1 - src/yugecin/opsudance/ui/SBOverlay.java | 6 +++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/itdelatrisu/opsu/states/OptionsMenu.java b/src/itdelatrisu/opsu/states/OptionsMenu.java index f4f96020..123c152e 100644 --- a/src/itdelatrisu/opsu/states/OptionsMenu.java +++ b/src/itdelatrisu/opsu/states/OptionsMenu.java @@ -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 diff --git a/src/yugecin/opsudance/ui/OptionsOverlay.java b/src/yugecin/opsudance/ui/OptionsOverlay.java index f67732c2..ed469348 100644 --- a/src/yugecin/opsudance/ui/OptionsOverlay.java +++ b/src/yugecin/opsudance/ui/OptionsOverlay.java @@ -136,7 +136,6 @@ public class OptionsOverlay { // UI UI.getBackButton().draw(); - UI.draw(g); // tooltip renderTooltip(g, mouseX, mouseY); diff --git a/src/yugecin/opsudance/ui/SBOverlay.java b/src/yugecin/opsudance/ui/SBOverlay.java index a2d6028f..04bce386 100644 --- a/src/yugecin/opsudance/ui/SBOverlay.java +++ b/src/yugecin/opsudance/ui/SBOverlay.java @@ -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);