Brake ligths killswitch
This commit is contained in:
@@ -95,5 +95,13 @@
|
|||||||
"onDown": "extensions.use('ESBtnBoxDrivetrain').toggleBothDiffLock()",
|
"onDown": "extensions.use('ESBtnBoxDrivetrain').toggleBothDiffLock()",
|
||||||
"title": "ESBtnBox Bindings: Toggle Both Diff Locks",
|
"title": "ESBtnBox Bindings: Toggle Both Diff Locks",
|
||||||
"desc": "Lock front and rear diffs"
|
"desc": "Lock front and rear diffs"
|
||||||
|
},
|
||||||
|
"bb_brake_light_killswitch": {
|
||||||
|
"cat": "vehicle",
|
||||||
|
"order": 54340,
|
||||||
|
"ctx": "vlua",
|
||||||
|
"onDown": "extensions.use('ESBtnBoxHeadlights').toggleBrakeLights()",
|
||||||
|
"title": "ESBtnBox Bindings: Toggle Brake Lights",
|
||||||
|
"desc": "Toggles the brake lights for those proper police runs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,7 @@ local M = {}
|
|||||||
local headlightsOff = 0
|
local headlightsOff = 0
|
||||||
local lowBeams = 1
|
local lowBeams = 1
|
||||||
local highBeams = 2
|
local highBeams = 2
|
||||||
|
local brakeLightSwitch = false
|
||||||
|
|
||||||
-- I will be forcing each state due to my controls not being sequential
|
-- I will be forcing each state due to my controls not being sequential
|
||||||
-- I have a toggle switch (On - Off - On) and it will control both low and high beams, so
|
-- I have a toggle switch (On - Off - On) and it will control both low and high beams, so
|
||||||
@@ -43,6 +44,14 @@ local function toggleLowBeams()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function toggleBrakeLights()
|
||||||
|
brakeLightSwitch = not brakeLightSwitch
|
||||||
|
end
|
||||||
|
|
||||||
|
M.toggleHighBeams = toggleHighBeams
|
||||||
|
M.toggleLowBeams = toggleLowBeams
|
||||||
|
M.toggleBrakeLights = toggleBrakeLights
|
||||||
|
|
||||||
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
||||||
-- Lightbar handling
|
-- Lightbar handling
|
||||||
----------------------------------------------------------------------------------------------------
|
----------------------------------------------------------------------------------------------------
|
||||||
@@ -73,14 +82,16 @@ local function turnLightbarSound()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
M.toggleHighBeams = toggleHighBeams
|
|
||||||
M.toggleLowBeams = toggleLowBeams
|
|
||||||
M.toggleLigthbarLight = turnLightbarLight
|
M.toggleLigthbarLight = turnLightbarLight
|
||||||
M.toggleLigthbarSound = turnLightbarSound
|
M.toggleLigthbarSound = turnLightbarSound
|
||||||
|
|
||||||
local myTimer = 0
|
local myTimer = 0
|
||||||
local requestToReset = false
|
local requestToReset = false
|
||||||
local function updateGFX(dt)
|
local function updateGFX(dt)
|
||||||
|
if brakeLightSwitch then
|
||||||
|
electrics.values.brake = 0
|
||||||
|
end
|
||||||
|
|
||||||
if not requestToReset then
|
if not requestToReset then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user