summaryrefslogtreecommitdiff
path: root/scripts/led.lua
blob: 0e5cd1bb577ea8ea3f96c2ee215ee42dbfac4609 (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
38
39
40
41
42
43
44
45
-- Part of SLIMax Mgr II - Lua Script v2.2
-- Copyright (c)2012-2013  by Zappadoc - All Rights Reserved.
-- Use this script to patch std led behaviors (i.e lowfuel, flags, damage, rev limit, ...)
-- created by Zappadoc - 2012-11-10

-- SLI-M, SLI-PRO, SLI-F1 led event
-- params:
-- idx = led index (assigned in settings)
-- state = the std state of the led; activated if > 0
-- ledFunction: the corresponding function
-- 1=LowFuel
-- 2=TC
-- 3=ABS
-- 4=Green Flag
-- 5=Yellow flag
-- 6=Red Flag
-- 7=Over Heating
-- 8=Damage
-- 9=Pit request
-- 10=Power
-- 11=Rev Limit
-- 12=HeadLights
-- 13=Blue Flag
-- 14=DRS
-- 15=Safe Prefs

function ledEvent(idx, ledFunction, state)
	-- call custom script
	local result = custom_ledEvent(idx, ledFunction, state)
	-- if result = 0 bypass the script below and return 0
	-- if result = 1 bypass the script below and return 1
	if result <= 1 then return result end
	-- if result >= 2 continue
	
	-- call global custom script
	result = global_custom_ledEvent(idx, ledFunction, state)
	-- if result = 0 bypass the script below and return 0
	-- if result = 1 bypass the script below and return 1
	if result <= 1 then return result end
	-- if result >= 2 continue
	
	-- return 0 to use std behaviors
	return 0
end