summaryrefslogtreecommitdiff
path: root/scripts/slipro_gus.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/slipro_gus.lua')
-rw-r--r--[-rwxr-xr-x]scripts/slipro_gus.lua60
1 files changed, 36 insertions, 24 deletions
diff --git a/scripts/slipro_gus.lua b/scripts/slipro_gus.lua
index cd281d6..7883b88 100755..100644
--- a/scripts/slipro_gus.lua
+++ b/scripts/slipro_gus.lua
@@ -20,9 +20,13 @@
-- ================================
-- additional scripts file ( use 'require' statement )
+require "scripts/slipro_digits"
+
-- ================================
-- custom globals
-mGugusse_Ignition = 0
+function custom_initEvent(scriptFile)
+ return 0
+end
-- ================================
-- custom functions
@@ -32,7 +36,7 @@ mGugusse_Ignition = 0
function global_custom_controlsEvent(devType, ctrlType, ctrlPos, value, funcIndex)
-- type your custom controls script here (manage buttons, switches and encoders)
- return 2
+ return 0
end
function global_custom_deviceReport(devType)
@@ -50,6 +54,7 @@ function global_custom_enterSessionEvent(devType)
--print (string.format("session: %s",GetContextInfo("session")))
print ()
if GetContextInfo("ospcustom") then print ("has ospcustom") end
+
print (string.format("shiftlightsmethod: %s",GetContextInfo("shiftlightsmethod")))
print (string.format("ospmethod : %s",GetContextInfo("ospmethod")))
print (string.format("speedlimitemethod: %s",GetContextInfo("speedlimitermethod")))
@@ -57,7 +62,7 @@ function global_custom_enterSessionEvent(devType)
end
function global_custom_exitSessionEvent(devType)
- -- type your custom script on session ending, here
+ -- type your custom script on session ending, here
if GetContextInfo("ospcustom") then print ("has ospcustom") end
print ()
print (string.format("shiftlightsmethod: %s",GetContextInfo("shiftlightsmethod")))
@@ -65,7 +70,13 @@ function global_custom_exitSessionEvent(devType)
print (string.format("speedlimitemethod: %s",GetContextInfo("speedlimitermethod")))
print ( "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^")
print ()
- return 2
+
+ --my_setups=io.open("gus_cars.cfg", "a")
+ --my_setups:write(GetContextInfo("carname"), " shiftligts ", GetContextInfo("shiftlightsmethod"), "\n")
+ --my_setups:write(GetContextInfo("carname"), " speedlimiter ", GetContextInfo("speedlimitermethod"), "\n")
+ --my_setups:close()
+
+ return 2
end
@@ -105,33 +116,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))
+
+ toggleAllLed(0)
+ if ignition == 2 then
+ SetLeftDigits(" ---- ")
+ SetRightDigits(" ---- ")
+ else
+ SetLeftDigits(" ")
+ SetRightDigits(" ")
+ end
- update = 1
- end
+ if ignition == 0 then
+ SetGearDigit(" ")
+ elseif ignition == 1 then
+ SetGearDigit(GetCurrentGear())
+ end
- if update ~= 0 then SLISendReport(1) end
+ SLISendReport(1)
return 1
end
- mGugusseIgnition = 1
- return 2
+ return 2
end
function global_custom_ledEvent(idx, ledFunction, state)