Closed Gankra closed 12 years ago
Would it be enough to just set a flag to ignore all key commands?
More or less, yeah, that should be sufficient.
You don't want to stop registering key presses, just to stop them from having any effect. Perhaps just an if block around handleInputs()?
Yeah. That is more so what I meant. Specifically something like:
if(hasControl() && !inputDisabled){
Sburb.char.handleInputs(Sburb.pressed, Sburb.pressedOrder);
}else{
Sburb.char.moveNone();
}
Or something.
hasControl() has some serious code smell around it these days. It might be worth refactoring to just kill it once and for all.
This isn't enough, the chooser still opens when standing before an object with actions and pressing space. When I additionally use this line in _onkeydown it works fine:
if(Sburb.updateLoop && !Sburb.inputDisabled) {
disableControl: Prevents user from providing input to the character syntax: none (possibly optionally give it an event to listen for?)
enableControl: undoes disableControl syntax: none
Disabling control should not prevent the action queue from progressing.