summaryrefslogtreecommitdiff
path: root/scripts/gugus/gear.lua
blob: 1f72d4baf61ab3fbaa7cdcde9e799a3b39748dcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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

print ( "gugus> + gear" )