content/hifi-public/huffman/rocketchair/remoteBoostClientEntity.js
Dale Glass 0d14e5a379 Initial data.
Needs a lot of cleanup. Data has been de-duplicated, and where identical copies existed, one of them
has been replaced with a symlink.

Some files have been excluded, such as binaries, installers and debug dumps. Some of that may still
be present.
2022-02-13 18:59:11 +01:00

29 lines
924 B
JavaScript

(function() {
var self = this;
var on = false;
var heldAt = 0;
self.startEquip = function(entityID, args) {
heldAt = Date.now();
};
self.continueEquip = function(entityID, args) {
if ((Date.now() - heldAt) < 1000) {
return;
}
var triggerValue = Controller.getValue(args[0] === 'left' ? Controller.Standard.LT : Controller.Standard.RT);
if (triggerValue > 0.2 && !on) {
print("Start boost");
on = true;
Messages.sendMessage("RocketChair", "startBoost");
} else if (triggerValue <= 0.2 && on) {
on = false;
Messages.sendMessage("RocketChair", "stopBoost");
}
};
self.releaseEquip = function(entityID, args) {
if (on) {
print("Stop boost");
on = false;
Messages.sendMessage("RocketChair", "stopBoost");
}
};
})