Merge branch 'master' into title-blink

This commit is contained in:
Michael Townsend
2014-07-29 18:20:10 -04:00
4 changed files with 148 additions and 7 deletions
+9 -3
View File
@@ -8,6 +8,7 @@ var Events = {
_FIGHT_SPEED: 100,
_EAT_COOLDOWN: 5,
_MEDS_COOLDOWN: 7,
_LEAVE_COOLDOWN: 1,
STUN_DURATION: 4000,
BLINK_INTERVAL: false,
@@ -461,8 +462,9 @@ var Events = {
// Draw the buttons
Events.drawButtons(scene);
} else {
new Button.Button({
Button.cooldown(new Button.Button({
id: 'leaveBtn',
cooldown: Events._LEAVE_COOLDOWN,
click: function() {
var scene = Events.activeEvent().scenes[Events.activeScene];
if(scene.nextScene && scene.nextScene != 'end') {
@@ -472,7 +474,7 @@ var Events = {
}
},
text: _('leave')
}).appendTo(btns);
}).appendTo(btns));
Events.createEatMeatButton(0).appendTo(btns);
if((Path.outfit['medicine'] || 0) != 0) {
@@ -632,11 +634,15 @@ var Events = {
id: id,
text: info.text,
cost: info.cost,
click: Events.buttonClick
click: Events.buttonClick,
cooldown: info.cooldown
}).appendTo(btns);
if(typeof info.available == 'function' && !info.available()) {
Button.setDisabled(b, true);
}
if(typeof info.cooldown == 'number') {
Button.cooldown(b);
}
}
Events.updateButtons();