From a2d39e7463cd5a795a2d7952ba5b4ada6173c370 Mon Sep 17 00:00:00 2001 From: Parnic Date: Sat, 22 Feb 2020 11:27:09 -0600 Subject: [PATCH] Added some helpers to interpret the controllerType field These aren't particularly useful, at least not to me, but I found them while perusing the official app, so I figured they couldn't hurt to have. --- messages/SLControllerConfigMessage.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/messages/SLControllerConfigMessage.js b/messages/SLControllerConfigMessage.js index 8051c25..738141d 100755 --- a/messages/SLControllerConfigMessage.js +++ b/messages/SLControllerConfigMessage.js @@ -107,4 +107,24 @@ exports.SLControllerConfigMessage = class SLControllerConfigMessage extends SLMe hasIntellichem() { return !!(this.equipFlags & 0x8000); } + + isEasyTouch() { + return this.controllerType === 14 || this.controllerType === 13; + } + + isIntelliTouch() { + return this.controllerType !== 14 && this.controllerType !== 13 && this.controllerType !== 10; + } + + isEasyTouchLite() { + return this.controllerType === 13 && (this.hwType & 4) !== 0; + } + + isDualBody() { + return this.controllerType === 5; + } + + isChem2() { + return this.controllerType === 252 && this.hwType === 2; + } };