mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 16:21:53 +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;
|
||||
}
|
||||
start = Math.min($SM.get(id), cd);
|
||||
left = (start / cd).toFixed(3);
|
||||
left = (start / cd).toFixed(4);
|
||||
break;
|
||||
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;
|
||||
break;
|
||||
default:
|
||||
@@ -101,7 +101,7 @@ var Button = {
|
||||
if (Engine.options.doubleTime){
|
||||
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);
|
||||
});
|
||||
btn.addClass('disabled');
|
||||
|
||||
Reference in New Issue
Block a user