From de019d1faf3daa90898bb194d1aac64409ca8824 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Tue, 24 Mar 2009 09:13:16 -0400 Subject: Engine: Fixed MessageWindow non-closure Added code to MapViewGameState's deinitalize() that cancells the callbacks of all currently running events. Also added code to SpecialEvent's displayMessage() that allows an InterruptedException to kill the message. With the problem with the Title Screen, it turned out that this bug had nothing to do with it, the Title Screen's interval was just too fast. Fixes #18 --- .../fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java') diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java index d3bd101..6cf9b10 100755 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/MapViewGameState.java @@ -71,7 +71,11 @@ public class MapViewGameState implements GameState { public void deinitalize() { - // Do nothing, yet + // If an event is running when the game state is closing, kill it + for (LayerEvent ev : currentMap.getEvents()) + { + ev.getCallback().cancel(); + } } public void processInput(KeyInput key) -- cgit 1.4.1