Restore navigation property

Instead of a timed method to restore lx/rx navigation, a property will be set to true. In that case, the keyup method will not be executed, but it will restore navigation for further use.
This commit is contained in:
Andrea Rendine
2015-06-10 11:24:07 +02:00
committed by Blake Grotewold
parent f94cfe2590
commit 358fe5fbcc
2 changed files with 9 additions and 12 deletions
+7 -10
View File
@@ -593,14 +593,10 @@
//return (num > 0 ? "+" : "") + num + " per " + delay + "s";
},
keyLock: false,
tabNavigation: true,
restoreNavigation: false,
restoreNavigation: function(){
setTimeout(function(){
Engine.tabNavigation = true;
},100);
},
keyDown: function(e) {
e = e || window.event;
if(!Engine.keyPressed && !Engine.keyLock) {
@@ -616,9 +612,7 @@
Engine.pressed = false;
if(Engine.activeModule.keyUp) {
Engine.activeModule.keyUp(e);
}
else
{
} else {
switch(e.which) {
case 38: // Up
case 87:
@@ -666,7 +660,10 @@
break;
}
}
if(Engine.restoreNavigation){
Engine.tabNavigation = true;
Engine.restoreNavigation = false;
}
return false;
},
+2 -2
View File
@@ -823,7 +823,7 @@ var World = {
$('#outerSlider').animate({opacity:'1'}, 600, 'linear');
Button.cooldown($('#embarkButton'));
Engine.keyLock = false;
Engine.restoreNavigation();
Engine.tabNavigation = true;
}, 2000, true);
});
}
@@ -866,7 +866,7 @@ var World = {
$('#outerSlider').animate({left: '0px'}, 300);
Engine.activeModule = Path;
Path.onArrival();
Engine.restoreNavigation();
Engine.restoreNavigation = true;
},
leaveItAtHome: function(thing) {