From 6b96bbbe4ef629f26681ffcf10d714236b275748 Mon Sep 17 00:00:00 2001 From: marcins78 Date: Wed, 24 Oct 2012 10:41:41 +0000 Subject: [PATCH] - Added replay speed buttons. --- .../src/main/webapp/includes/changeLog.html | 3 +++ .../main/webapp/js/gemp-011/gameAnimations.js | 3 ++- .../src/main/webapp/js/gemp-011/gameUi.js | 22 ++++++++++++++++--- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html index 8842a7564..553c46ecd 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/includes/changeLog.html @@ -1,4 +1,7 @@
+24 Oct. 2012
+- Added replay speed buttons.
+
 23 Oct. 2012
 - "Harrowdale" might be working fine this time around.
 - Changed how Muster works now. At the start of the regroup phase, one of your muster cards will light up (unfortunately
diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gemp-011/gameAnimations.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gemp-011/gameAnimations.js
index 44e19ae69..1b7517d76 100644
--- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gemp-011/gameAnimations.js
+++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gemp-011/gameAnimations.js
@@ -1,5 +1,6 @@
 var GameAnimations = Class.extend({
     game:null,
+    replaySpeed:1,
     playEventDuration:1500,
     putCardIntoPlayDuration:1500,
     cardAffectsCardDuration:1200,
@@ -13,7 +14,7 @@ var GameAnimations = Class.extend({
 
     getAnimationLength:function (origValue) {
         if (this.game.replayMode)
-            return origValue * 1;
+            return origValue * this.replaySpeed;
         return origValue;
     },
 
diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gemp-011/gameUi.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gemp-011/gameUi.js
index 476c83f57..0b25b18c2 100644
--- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gemp-011/gameUi.js
+++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gemp-011/gameUi.js
@@ -102,11 +102,27 @@ var GempLotrGameUI = Class.extend({
         };
 
         if (this.replayMode) {
-            var replayDiv = $("
"); - replayDiv.append(""); + var replayDiv = $("
"); + var slowerBut = $( "" ).button({ icons: {primary:'ui-icon-triangle-1-w'}}); + var fasterBut = $( "" ).button({ icons: {primary:'ui-icon-triangle-1-e'}}); + slowerBut.click( + function() { + that.animations.replaySpeed = Math.min(2, that.animations.replaySpeed+0.2); + }); + fasterBut.click( + function() { + that.animations.replaySpeed = Math.max(0.2, that.animations.replaySpeed-0.2); + }); + replayDiv.append(slowerBut); + replayDiv.append(fasterBut); + replayDiv.append(""); $("#main").append(replayDiv); replayDiv.css({"z-index":1000}); $("#replayButton").button(); + $("#slowerButton").css({position:"absolute", left: "0px", top: "0px", width: "25px", height: "25px", margin: "0px"}); + $("#fasterButton").css({position:"absolute", left: "25px", top: "0px", width: "25px", height: "25px", margin: "0px"}); + $("#replayButton").css({position:"absolute", left: "0px", top: "25px", width: "50px", height: "50px", margin: "0px"}); + $("#replayBut").css({position:"absolute", left: "0px", top: "25px", width: "50px", height: "50px", margin: "0px"}); } this.shadowAssignGroups = {}; @@ -841,7 +857,7 @@ var GempLotrGameUI = Class.extend({ this.chatBox.setBounds(4, 4 + 25, specialUiWidth + advPathWidth - 8, chatHeight - 8 - 25); if (this.replayMode) { - $(".replay").css({position:"absolute", left:width - 50 - 4 - padding, top:height - 50 - 2 - padding, width:50, height:50, "z-index":1000}); + $(".replay").css({position:"absolute", left:width - 50 - 4 - padding, top:height - 75 - 2 - padding, width:50, height:75, "z-index":1000}); } },