From 834682a6cae4b7dd1dc45119e9d5d4c50937e0a1 Mon Sep 17 00:00:00 2001 From: Jeffrey Han Date: Fri, 18 Jul 2014 21:33:07 -0400 Subject: [PATCH] Minor bug fixes. - Fixed null pointer in "Main Menu" state if no tracks loaded. (since b0c0b44) - Fixed "keyOsuLeft" and "keyOsuRight" writing KEY_NONE to configuration file on first run (instead of default values). Signed-off-by: Jeffrey Han --- src/itdelatrisu/opsu/states/MainMenu.java | 2 +- src/itdelatrisu/opsu/states/Options.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/itdelatrisu/opsu/states/MainMenu.java b/src/itdelatrisu/opsu/states/MainMenu.java index 1c7de45f..ade93a3f 100644 --- a/src/itdelatrisu/opsu/states/MainMenu.java +++ b/src/itdelatrisu/opsu/states/MainMenu.java @@ -188,7 +188,7 @@ public class MainMenu extends BasicGameState { g.setColor(Utils.COLOR_BLACK_ALPHA); g.fillRoundRect(width - 168, 54, 148, 5, 4); g.setColor(Color.white); - if (!MusicController.isTrackLoading()) + if (!MusicController.isTrackLoading() && osu != null) g.fillRoundRect(width - 168, 54, 148f * MusicController.getPosition() / osu.endTime, 5, 4); diff --git a/src/itdelatrisu/opsu/states/Options.java b/src/itdelatrisu/opsu/states/Options.java index 671dc3d0..4b802bce 100644 --- a/src/itdelatrisu/opsu/states/Options.java +++ b/src/itdelatrisu/opsu/states/Options.java @@ -1433,9 +1433,9 @@ public class Options extends BasicGameState { writer.newLine(); writer.write(String.format("DisableSound = %b", disableSound)); writer.newLine(); - writer.write(String.format("keyOsuLeft = %s", Keyboard.getKeyName(keyLeft))); + writer.write(String.format("keyOsuLeft = %s", Keyboard.getKeyName(getGameKeyLeft()))); writer.newLine(); - writer.write(String.format("keyOsuRight = %s", Keyboard.getKeyName(keyRight))); + writer.write(String.format("keyOsuRight = %s", Keyboard.getKeyName(getGameKeyRight()))); writer.newLine(); writer.write(String.format("DimLevel = %d", backgroundDim)); writer.newLine();