summaryrefslogtreecommitdiff
path: root/scripts/gugus/gear.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gugus/gear.lua')
-rw-r--r--scripts/gugus/gear.lua32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/gugus/gear.lua b/scripts/gugus/gear.lua
new file mode 100644
index 0000000..463449a
--- /dev/null
+++ b/scripts/gugus/gear.lua
@@ -0,0 +1,32 @@
+function custom_gearEvent(gear)
+ -- manage gear when ´E´
+ if gear == 69 then
+ local ignition = 1
+ if GetContextInfo("simulation") == "rFactor2.exe" then
+ ignition = GetCarInfo("ignition")
+ end
+ local g = GetCarInfo("gear")
+
+ --print ( string.format("gear %d/ignition %d" , g, ignition))
+
+ toggleAllLed(0)
+ if ignition == 2 then
+ SetLeftDigits(" ---- ")
+ SetRightDigits(" ---- ")
+ else
+ SetLeftDigits(" ")
+ SetRightDigits(" ")
+ end
+
+ if ignition == 0 then
+ SetGearDigit(" ")
+ elseif ignition == 1 then
+ SetGearDigit(GetCurrentGear())
+ end
+
+ SLISendReport(1)
+ return 1
+ end
+
+ return 2
+end