diff --git a/src/yugecin/opsudance/core/DisplayContainer.java b/src/yugecin/opsudance/core/DisplayContainer.java index 6c6242fd..c827a2e0 100644 --- a/src/yugecin/opsudance/core/DisplayContainer.java +++ b/src/yugecin/opsudance/core/DisplayContainer.java @@ -386,7 +386,9 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen public void mouseMoved(int oldx, int oldy, int newx, int newy) { } @Override - public void mouseDragged(int oldx, int oldy, int newx, int newy) { } + public void mouseDragged(int oldx, int oldy, int newx, int newy) { + state.mouseDragged(oldx, oldy, newx, newy); + } @Override public void setInput(Input input) { } diff --git a/src/yugecin/opsudance/core/state/BaseOpsuState.java b/src/yugecin/opsudance/core/state/BaseOpsuState.java index 72ebc54b..8c13315d 100644 --- a/src/yugecin/opsudance/core/state/BaseOpsuState.java +++ b/src/yugecin/opsudance/core/state/BaseOpsuState.java @@ -107,6 +107,11 @@ public abstract class BaseOpsuState implements OpsuState, EventListener BaseOpsuState dump\n"); diff --git a/src/yugecin/opsudance/core/state/OpsuState.java b/src/yugecin/opsudance/core/state/OpsuState.java index 37902c0b..0a0a65ca 100644 --- a/src/yugecin/opsudance/core/state/OpsuState.java +++ b/src/yugecin/opsudance/core/state/OpsuState.java @@ -58,4 +58,9 @@ public interface OpsuState extends ErrorDumpable { */ boolean mouseReleased(int button, int x, int y); + /** + * @return false to stop event bubbling + */ + boolean mouseDragged(int oldx, int oldy, int newx, int newy); + } diff --git a/src/yugecin/opsudance/states/EmptyRedState.java b/src/yugecin/opsudance/states/EmptyRedState.java index a4102ff3..b8d049ad 100644 --- a/src/yugecin/opsudance/states/EmptyRedState.java +++ b/src/yugecin/opsudance/states/EmptyRedState.java @@ -100,6 +100,11 @@ public class EmptyRedState implements OpsuState { return false; } + @Override + public boolean mouseDragged(int oldx, int oldy, int newx, int newy) { + return false; + } + @Override public void writeErrorDump(StringWriter dump) { dump.append("> EmptyRedState dump\n"); diff --git a/src/yugecin/opsudance/states/EmptyState.java b/src/yugecin/opsudance/states/EmptyState.java index 28703a57..6a75f783 100644 --- a/src/yugecin/opsudance/states/EmptyState.java +++ b/src/yugecin/opsudance/states/EmptyState.java @@ -92,6 +92,11 @@ public class EmptyState implements OpsuState { return false; } + @Override + public boolean mouseDragged(int oldx, int oldy, int newx, int newy) { + return false; + } + @Override public void writeErrorDump(StringWriter dump) { dump.append("> EmptyState dump\n");