fix splash state not getting inputs

This commit is contained in:
yugecin 2017-05-28 11:46:31 +02:00
parent 419ffd3d26
commit 2deef7c3a9
2 changed files with 7 additions and 2 deletions

View File

@ -148,7 +148,9 @@ public class Input {
* @param listener The listener to be notified * @param listener The listener to be notified
*/ */
public void addKeyListener(KeyListener listener) { public void addKeyListener(KeyListener listener) {
keyListeners.add(listener); if (!keyListeners.contains(listener)) {
keyListeners.add(listener);
}
} }
/** /**
@ -157,7 +159,9 @@ public class Input {
* @param listener The listener to be notified * @param listener The listener to be notified
*/ */
public void addMouseListener(MouseListener listener) { public void addMouseListener(MouseListener listener) {
mouseListeners.add(listener); if (!mouseListeners.contains(listener)) {
mouseListeners.add(listener);
}
} }
/** /**

View File

@ -440,6 +440,7 @@ public class DisplayContainer implements ErrorDumpable, ResolutionChangedListene
input.addListener(new GlobalInputListener()); input.addListener(new GlobalInputListener());
input.addMouseListener(bubNotifState); input.addMouseListener(bubNotifState);
} }
input.addListener(state);
sout("GL ready"); sout("GL ready");