From b2f85edb132ab432f54392027c4e68f3ae450517 Mon Sep 17 00:00:00 2001 From: yugecin Date: Sat, 21 Jan 2017 13:29:10 +0100 Subject: [PATCH] fix nullpointer for mover storyboard --- src/itdelatrisu/opsu/states/Game.java | 10 ++++++---- src/yugecin/opsudance/sbv2/MoveStoryboard.java | 12 ++---------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 1cfc90c8..bbabf670 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -333,6 +333,8 @@ public class Game extends ComplexOpsuState { @Override public void revalidate() { + super.revalidate(); + // create offscreen graphics try { offscreen = new Image(displayContainer.width, displayContainer.height); @@ -1445,10 +1447,6 @@ public class Game extends ComplexOpsuState { @Override public void enter() { - super.enter(); - - displayContainer.drawCursor = false; - overlays.clear(); if (Options.isEnableSB()) { overlays.add(optionsOverlay); @@ -1458,6 +1456,10 @@ public class Game extends ComplexOpsuState { optionsOverlay.revalidate(); } + super.enter(); + + displayContainer.drawCursor = false; + isInGame = true; if (!skippedToCheckpoint) { UI.enter(); diff --git a/src/yugecin/opsudance/sbv2/MoveStoryboard.java b/src/yugecin/opsudance/sbv2/MoveStoryboard.java index aa4e95c8..a7d1818d 100644 --- a/src/yugecin/opsudance/sbv2/MoveStoryboard.java +++ b/src/yugecin/opsudance/sbv2/MoveStoryboard.java @@ -69,6 +69,8 @@ public class MoveStoryboard extends OverlayOpsuState{ @Override public void revalidate() { + super.revalidate(); + btnAddLinear = new SimpleButton(displayContainer.width - 205, 50, 200, 25, Fonts.SMALL, "add linear", Colors.BLUE_BUTTON, Colors.WHITE_FADE, Colors.WHITE_FADE, Colors.ORANGE_BUTTON); btnAddQuadratic = new SimpleButton(displayContainer.width - 205, 80, 200, 25, Fonts.SMALL, "add quadratic", Colors.BLUE_BUTTON, Colors.WHITE_FADE, Colors.WHITE_FADE, Colors.ORANGE_BUTTON); btnAddCubic = new SimpleButton(displayContainer.width - 205, 110, 200, 25, Fonts.SMALL, "add cubic", Colors.BLUE_BUTTON, Colors.WHITE_FADE, Colors.WHITE_FADE, Colors.ORANGE_BUTTON); @@ -94,16 +96,6 @@ public class MoveStoryboard extends OverlayOpsuState{ return moves[objectIndex].getPointAt(t); } - @Override - public void hide() { - - } - - @Override - public void show() { - - } - @Override protected void onPreRenderUpdate() { int x = displayContainer.mouseX;