mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-07-04 18:22:13 +08:00
Cooldown time from graphics
Not a problem of precision, but a width measurement issue. Fixed and restored to previous precision level.
This commit is contained in:
+3
-3
@@ -78,10 +78,10 @@ var Button = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
start = Math.min($SM.get(id), cd);
|
start = Math.min($SM.get(id), cd);
|
||||||
left = (start / cd).toFixed(3);
|
left = (start / cd).toFixed(4);
|
||||||
break;
|
break;
|
||||||
case 'pause':
|
case 'pause':
|
||||||
left = (btn.children('div.cooldown').width() / btn.width()).toFixed(3);
|
left = (btn.children('div.cooldown').width() / btn.innerWidth()).toFixed(4);
|
||||||
start = cd * left;
|
start = cd * left;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -101,7 +101,7 @@ var Button = {
|
|||||||
if (Engine.options.doubleTime){
|
if (Engine.options.doubleTime){
|
||||||
time /= 2;
|
time /= 2;
|
||||||
}
|
}
|
||||||
$('div.cooldown', btn).width(Math.floor(left * 100) +"%").animate({width: '0%'}, time * 1000, 'linear', function() {
|
$('div.cooldown', btn).width(left * 100 +"%").animate({width: '0%'}, time * 1000, 'linear', function() {
|
||||||
Button.clearCooldown(btn, true);
|
Button.clearCooldown(btn, true);
|
||||||
});
|
});
|
||||||
btn.addClass('disabled');
|
btn.addClass('disabled');
|
||||||
|
|||||||
Reference in New Issue
Block a user