mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 00:01:54 +08:00
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:
committed by
Blake Grotewold
parent
f94cfe2590
commit
358fe5fbcc
+7
-10
@@ -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
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user