Hyper-proof cooldown state

Kept the distinction between "argument" time and script time. I called the latter "time" instead of "milliseconds" because, well, it's just tenth of seconds.
Residual timeout is always stored in "nominal" time, not adjusted by hyper. I.e. if a button has a nominal timeout of 60 seconds and half cooldown had expired on reload, residual is stored as 300. In cooldown, Engine.setInterval makes the time flow with double speed
This commit is contained in:
Andrea Rendine
2015-05-11 16:44:43 +02:00
committed by Blake Grotewold
parent a923c1c0bd
commit 65d7cfd784
5 changed files with 144 additions and 106 deletions
+2
View File
@@ -955,6 +955,7 @@ var Events = {
Engine.event('game event', 'event');
Engine.keyLock = true;
Engine.tabNavigation = false;
Button.saveCooldown = false;
Events.eventStack.unshift(event);
event.eventPanel = $('<div>').attr('id', 'event').addClass('eventPanel').css('opacity', '0');
if(options != null && options.width != null) {
@@ -988,6 +989,7 @@ var Events = {
Engine.log(Events.eventStack.length + ' events remaining');
Engine.keyLock = false;
Engine.tabNavigation = true;
Button.saveCooldown = true;
if (Events.BLINK_INTERVAL) {
Events.stopTitleBlink();
}