Merge pull request #52 from Bleyddyn/master

Arrow Keys and stores update fix
This commit is contained in:
Michael Townsend
2013-10-10 17:12:30 -07:00
2 changed files with 37 additions and 2 deletions
+35 -1
View File
@@ -362,6 +362,40 @@ var Engine = {
if(Engine.activeModule.keyUp) {
Engine.activeModule.keyUp(e);
}
else
{
switch(event.which) {
case 38: // Up
case 87:
Engine.log('up');
break;
case 40: // Down
case 83:
Engine.log('down');
break;
case 37: // Left
case 65:
if(Engine.activeModule == Ship && Path.tab)
Engine.travelTo(Path)
else if(Engine.activeModule == Path && Outside.tab)
Engine.travelTo(Outside)
else if(Engine.activeModule == Outside && Room.tab)
Engine.travelTo(Room)
Engine.log('left');
break;
case 39: // Right
case 68:
if(Engine.activeModule == Room && Outside.tab)
Engine.travelTo(Outside)
else if(Engine.activeModule == Outside && Path.tab)
Engine.travelTo(Path)
else if(Engine.activeModule == Path && Ship.tab)
Engine.travelTo(Ship)
Engine.log('right');
break;
}
}
return false;
},
@@ -415,4 +449,4 @@ $.Dispatch = function( id ) {
$(function() {
Engine.init();
});
});
+2 -1
View File
@@ -1088,9 +1088,10 @@ var Room = {
Room.updateStoresView();
Room.updateBuildButtons();
} else if(e.category == 'income'){
Room.updateStoresView();
Room.updateIncomeView();
} else if(e.stateName.indexOf('game.buildings') == 0){
Room.updateBuildButtons();
}
}
};
};