From 7b74203c84c48b1c049354022e778c9b25b9fa8a Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 15 Nov 2013 10:11:36 +0100 Subject: rF2: manages ignition On/Off/Start with gear (No gear displayed when ignition off) --- scripts/slipro_gus.lua | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'scripts/slipro_gus.lua') 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) -- cgit v1.2.3