Nested if statements combined
@@ -185,6 +185,7 @@ public void update(float delta) {
@Override
public void onClosed() {
+ System.out.println("Want to exit");
infoService.close();
super.onClosed();
@@ -481,15 +482,17 @@ private void refreshPing() {
}
public boolean onKeyEvent(NUIKeyEvent event) {
- if (event.isDown() && event.getKey() == Keyboard.Key.ESCAPE) {
+ if (event.isDown()) {
+ if (event.getKey() == Keyboard.Key.ESCAPE) {
if (isEscapeToCloseAllowed()) {
triggerBackAnimation();
return true;
}
}
- if (event.isDown() && event.getKey() == Keyboard.Key.R) {
+ else if (event.getKey() == Keyboard.Key.R) {
refresh();
}
+ }
return false;
}
