summary refs log tree commit diff stats
path: root/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventHandler.java')
-rwxr-xr-xsrc/com/fourisland/fourpuzzle/gamestate/mapview/event/EventHandler.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventHandler.java b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventHandler.java index a8a626f..e24b79c 100755 --- a/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventHandler.java +++ b/src/com/fourisland/fourpuzzle/gamestate/mapview/event/EventHandler.java
@@ -6,6 +6,7 @@
6package com.fourisland.fourpuzzle.gamestate.mapview.event; 6package com.fourisland.fourpuzzle.gamestate.mapview.event;
7 7
8import com.fourisland.fourpuzzle.PuzzleApplication; 8import com.fourisland.fourpuzzle.PuzzleApplication;
9import com.fourisland.fourpuzzle.gamestate.mapview.viewpoint.AutomaticViewpoint;
9import com.fourisland.fourpuzzle.util.ResourceNotFoundException; 10import com.fourisland.fourpuzzle.util.ResourceNotFoundException;
10import java.util.concurrent.ExecutorService; 11import java.util.concurrent.ExecutorService;
11import java.util.concurrent.Executors; 12import java.util.concurrent.Executors;
@@ -51,6 +52,14 @@ public class EventHandler {
51 try 52 try
52 { 53 {
53 callback.run(); 54 callback.run();
55 } catch (InterruptedException ex) {
56 /* Swallow the interrupt, as the interruption probably
57 * indicates that the event should be cancelled
58 *
59 * Also reset the viewpoint in case the viewpoint was
60 * fixed during the thread */
61
62 SpecialEvent.mapView.setViewpoint(new AutomaticViewpoint(SpecialEvent.mapView.getCurrentMap()));
54 } catch (ResourceNotFoundException ex) 63 } catch (ResourceNotFoundException ex)
55 { 64 {
56 PuzzleApplication.INSTANCE.reportError(ex); 65 PuzzleApplication.INSTANCE.reportError(ex);