summaryrefslogtreecommitdiff
path: root/scripts/gugus/gear.lua
blob: 57820e66080d5724d23d3de03011fce219c8e6f8 (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
35
36
37

function custom_gearEvent(gear)
	-- manage gear when ´E´
	if gear == 69 then
		local ignition = GetCarInfo("ignition")
		local g = GetCarInfo("gear")

		--print ( string.format("gear %d/ignition %d" , g, ignition))

		toggleAllLed(0)

		if ignition == 2 then
			initLedTable(mRPMLedTable, 1)
			SetRPMLed("mRPMLedTable")
			SetLeftDigits("[    ]")
			SetRightDigits("[    ]")
		else
			initLedTable(mRPMLedTable, 0)
			SetRPMLed("mRPMLedTable")
			SetLeftDigits("       ")
			SetRightDigits("       ")
		end

		if ignition == 0 and GetContextInfo("simulation") == "rFactor2.exe" then
			SetGearDigit(" ")
		elseif ignition == 1 then
			SetGearDigit(GetCurrentGear())
		end

		SLISendReport(1)
		return 1
	end

	return 2
end

print ( "gugus> + gear" )