mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-28 08:11: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";
|
//return (num > 0 ? "+" : "") + num + " per " + delay + "s";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
keyLock: false,
|
||||||
tabNavigation: true,
|
tabNavigation: true,
|
||||||
|
restoreNavigation: false,
|
||||||
|
|
||||||
restoreNavigation: function(){
|
|
||||||
setTimeout(function(){
|
|
||||||
Engine.tabNavigation = true;
|
|
||||||
},100);
|
|
||||||
},
|
|
||||||
|
|
||||||
keyDown: function(e) {
|
keyDown: function(e) {
|
||||||
e = e || window.event;
|
e = e || window.event;
|
||||||
if(!Engine.keyPressed && !Engine.keyLock) {
|
if(!Engine.keyPressed && !Engine.keyLock) {
|
||||||
@@ -616,9 +612,7 @@
|
|||||||
Engine.pressed = false;
|
Engine.pressed = false;
|
||||||
if(Engine.activeModule.keyUp) {
|
if(Engine.activeModule.keyUp) {
|
||||||
Engine.activeModule.keyUp(e);
|
Engine.activeModule.keyUp(e);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
switch(e.which) {
|
switch(e.which) {
|
||||||
case 38: // Up
|
case 38: // Up
|
||||||
case 87:
|
case 87:
|
||||||
@@ -666,7 +660,10 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(Engine.restoreNavigation){
|
||||||
|
Engine.tabNavigation = true;
|
||||||
|
Engine.restoreNavigation = false;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -823,7 +823,7 @@ var World = {
|
|||||||
$('#outerSlider').animate({opacity:'1'}, 600, 'linear');
|
$('#outerSlider').animate({opacity:'1'}, 600, 'linear');
|
||||||
Button.cooldown($('#embarkButton'));
|
Button.cooldown($('#embarkButton'));
|
||||||
Engine.keyLock = false;
|
Engine.keyLock = false;
|
||||||
Engine.restoreNavigation();
|
Engine.tabNavigation = true;
|
||||||
}, 2000, true);
|
}, 2000, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -866,7 +866,7 @@ var World = {
|
|||||||
$('#outerSlider').animate({left: '0px'}, 300);
|
$('#outerSlider').animate({left: '0px'}, 300);
|
||||||
Engine.activeModule = Path;
|
Engine.activeModule = Path;
|
||||||
Path.onArrival();
|
Path.onArrival();
|
||||||
Engine.restoreNavigation();
|
Engine.restoreNavigation = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
leaveItAtHome: function(thing) {
|
leaveItAtHome: function(thing) {
|
||||||
|
|||||||
Reference in New Issue
Block a user