mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-06-08 13:37:12 +08:00
Switch cooldown
Easy way to switch cooldown on pause button according to new button option
This commit is contained in:
+3
-4
@@ -83,7 +83,7 @@ var Events = {
|
|||||||
var pause = new Button.Button({
|
var pause = new Button.Button({
|
||||||
id: 'pause',
|
id: 'pause',
|
||||||
text: '',
|
text: '',
|
||||||
cooldown: Events._LEAVE_COOLDOWN,
|
cooldown: Events._PAUSE_COOLDOWN,
|
||||||
click: Events.togglePause
|
click: Events.togglePause
|
||||||
}).appendTo(pauseBox);
|
}).appendTo(pauseBox);
|
||||||
$('<span>').addClass('text').insertBefore(pause.children('.cooldown'));
|
$('<span>').addClass('text').insertBefore(pause.children('.cooldown'));
|
||||||
@@ -175,11 +175,10 @@ var Events = {
|
|||||||
}
|
}
|
||||||
switch(state){
|
switch(state){
|
||||||
case 'set':
|
case 'set':
|
||||||
|
Button.cooldown(btn, Events._LEAVE_COOLDOWN);
|
||||||
log = 'started';
|
log = 'started';
|
||||||
time = btn.data('cooldown') * 1000;
|
time = Events._LEAVE_COOLDOWN * 1000;
|
||||||
target = $();
|
target = $();
|
||||||
Button.cooldown(btn);
|
|
||||||
btn.data('cooldown',Events._PAUSE_COOLDOWN);
|
|
||||||
break;
|
break;
|
||||||
case 'end':
|
case 'end':
|
||||||
Button.setDisabled(btn, true);
|
Button.setDisabled(btn, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user