aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2014-05-20 16:45:07 +0200
committerPacien TRAN-GIRARD2014-05-20 16:45:07 +0200
commitbf54f0fe13964f41bcd4cfd9450b98e952bafaf2 (patch)
tree30358469dd8bdab15d1ddda1ae3410c87a490bef /src
parent611fd21d13fe2ee223fcf7ca647be20131887c96 (diff)
downloadesieequest-bf54f0fe13964f41bcd4cfd9450b98e952bafaf2.tar.gz
Add the possibility to skip Scene-s
Diffstat (limited to 'src')
-rw-r--r--src/esieequest/view/web/WebInterface.java20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/esieequest/view/web/WebInterface.java b/src/esieequest/view/web/WebInterface.java
index a85fc78..d417d24 100644
--- a/src/esieequest/view/web/WebInterface.java
+++ b/src/esieequest/view/web/WebInterface.java
@@ -87,6 +87,7 @@ class WebInterface extends Composite implements Viewable {
87 Button leftButton; 87 Button leftButton;
88 88
89 private Audio audio; 89 private Audio audio;
90 private Timer timer;
90 91
91 /** 92 /**
92 * The web user interface binder interface. 93 * The web user interface binder interface.
@@ -196,6 +197,9 @@ class WebInterface extends Composite implements Viewable {
196 case KeyCodes.KEY_PAGEUP: 197 case KeyCodes.KEY_PAGEUP:
197 WebInterface.this.actionButton.click(); 198 WebInterface.this.actionButton.click();
198 break; 199 break;
200 case KeyCodes.KEY_ESCAPE:
201 WebInterface.this.skipScene();
202 break;
199 default: 203 default:
200 WebInterface.this.inputField.setFocus(true); 204 WebInterface.this.inputField.setFocus(true);
201 break; 205 break;
@@ -316,6 +320,16 @@ class WebInterface extends Composite implements Viewable {
316 } 320 }
317 321
318 /** 322 /**
323 * Skips the currently player Scene.
324 */
325 private void skipScene() {
326 if (this.timer.isRunning()) {
327 this.timer.cancel();
328 this.timer.run();
329 }
330 }
331
332 /**
319 * Opens the inventory (switches to the inventory tab). 333 * Opens the inventory (switches to the inventory tab).
320 */ 334 */
321 private void openInventory() { 335 private void openInventory() {
@@ -415,13 +429,13 @@ class WebInterface extends Composite implements Viewable {
415 this.setIllustration(scene.name()); 429 this.setIllustration(scene.name());
416 this.playAudio(scene.name()); 430 this.playAudio(scene.name());
417 431
418 new Timer() { 432 this.timer = new Timer() {
419 @Override 433 @Override
420 public void run() { 434 public void run() {
421 scene.getCallback().call(); 435 scene.getCallback().call();
422 } 436 }
423 }.schedule(scene.getDuration()); 437 };
424 438 this.timer.schedule(scene.getDuration());
425 } 439 }
426 440
427} 441}