summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2013-11-15 10:11:36 +0100
committerHugues Hiegel <hugues@hiegel.fr>2013-11-15 10:20:32 +0100
commit7b74203c84c48b1c049354022e778c9b25b9fa8a (patch)
treedaa6f386e12838aaccd93535e3d8760c220e9792
parent1f08d9e98e44acd50a8bf05f9d3aed0f42481cf7 (diff)
rF2: manages ignition On/Off/Start with gear (No gear displayed when ignition off)
-rw-r--r--scripts/slipro_gus.lua42
1 files changed, 21 insertions, 21 deletions
diff --git a/scripts/slipro_gus.lua b/scripts/slipro_gus.lua
index fa6f1f7..a83c6eb 100644
--- a/scripts/slipro_gus.lua
+++ b/scripts/slipro_gus.lua
@@ -22,7 +22,6 @@
-- ================================
-- custom globals
-mGugusse_Ignition = 0
-- ================================
-- custom functions
@@ -112,33 +111,34 @@ end
function global_custom_gearEvent(gear)
-- manage gear when ŽEŽ
if gear == 69 then
- local update = 0
-
- if mGugusseIgnition == 1 then
- mGugusseIgnition = 0
-
- SetLeftDigits(" ")
- SetRightDigits(" ")
- toggleAllLed(0)
-
- update = 1
- end
-
+ local ignition = 1
+ if GetContextInfo("simulation") == "rFactor2.exe" then
+ ignition = GetCarInfo("ignition")
+ end
local g = GetCarInfo("gear")
- if oldGear == 0 or oldGear ~= g then
- oldGear = g
- SetGearDigit(GetCurrentGear())
+ --print ( string.format("gear %d/ignition %d" , g, ignition))
- update = 1
- end
+ toggleAllLed(0)
+ if ignition == 2 then
+ SetLeftDigits(" ---- ")
+ SetRightDigits(" ---- ")
+ else
+ SetLeftDigits(" ")
+ SetRightDigits(" ")
+ end
- if update ~= 0 then SLISendReport(1) end
+ if ignition == 0 then
+ SetGearDigit(" ")
+ elseif ignition == 1 then
+ SetGearDigit(GetCurrentGear())
+ end
+
+ SLISendReport(1)
return 1
end
- mGugusseIgnition = 1
- return 2
+ return 2
end
function global_custom_ledEvent(idx, ledFunction, state)