Adds forward walking on shift

The state of the shift modifier is now distributed across the
network. Walking speeds and animation states are being updated
according to it.

Fixes #130
This commit is contained in:
logsol 2016-10-09 19:56:06 +02:00
parent 062402db58
commit b798e6acac
5 changed files with 39 additions and 9 deletions

View file

@ -98,6 +98,18 @@ function (Parent, Nc, KeyboardAndMouse, Gamepad, PointerLockManager) {
Nc.trigger(Nc.ns.client.game.zoomReset, false);
};
PlayerController.prototype.activateModifier = function() {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.activateModifier.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "activateModifier");
};
PlayerController.prototype.deactivateModifier = function() {
if (!this.isPlayerInputAllowed()) return;
Parent.prototype.deactivateModifier.call(this);
Nc.trigger(Nc.ns.client.to.server.gameCommand.send, "deactivateModifier");
};
/*
* Client overwrite - allow player input if PointerLock is locked to canvas
* and is not in between games