- Added replay speed buttons.

This commit is contained in:
marcins78
2012-10-24 10:41:41 +00:00
parent 3e50e0054a
commit 6b96bbbe4e
3 changed files with 24 additions and 4 deletions

View File

@@ -1,4 +1,7 @@
<pre style="font-size:80%">
<b>24 Oct. 2012</b>
- Added replay speed buttons.
<b>23 Oct. 2012</b>
- "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

View File

@@ -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;
},

View File

@@ -102,11 +102,27 @@ var GempLotrGameUI = Class.extend({
};
if (this.replayMode) {
var replayDiv = $("<div class='replay'></div>");
replayDiv.append("<input type='checkbox' id='replayButton' /><label for='replayButton'><img src='images/play.png' width='50' height='50'/></label>");
var replayDiv = $("<div class='replay' style='position:absolute'></div>");
var slowerBut = $( "<button id='slowerButton'></button>" ).button({ icons: {primary:'ui-icon-triangle-1-w'}});
var fasterBut = $( "<button id='fasterButton'></button>" ).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("<input type='checkbox' id='replayButton' /><label id='replayBut' for='replayButton'><img src='images/play.png' width='50' height='50'/></label>");
$("#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});
}
},