Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CarControllerComponent.c
Go to the documentation of this file.
2{
3}
4
9class SCR_CarControllerComponent : CarControllerComponent
10{
11 //------------------------------------------------------------------------------------------------
12 override void OnCompartmentEntered(IEntity vehicle, BaseCompartmentManagerComponent mgr, IEntity occupant, int managerId, int slotID)
13 {
14 super.OnCompartmentEntered(vehicle, mgr, occupant, managerId, slotID);
15
16 if (mgr.FindCompartment(slotID, managerId) == GetPilotCompartmentSlot())
17 GetGame().GetInputManager().AddActionListener("CarLightsHiBeamToggle", EActionTrigger.DOWN, ActionCarLightsHiBeamToggle);
18 }
19
20 //------------------------------------------------------------------------------------------------
21 override void OnCompartmentLeft(IEntity vehicle, BaseCompartmentManagerComponent mgr, IEntity occupant, int managerId, int slotID)
22 {
23 super.OnCompartmentLeft(vehicle, mgr, occupant, managerId, slotID);
24
25 if (mgr.FindCompartment(slotID, managerId) == GetPilotCompartmentSlot())
26 GetGame().GetInputManager().RemoveActionListener("CarLightsHiBeamToggle", EActionTrigger.DOWN, ActionCarLightsHiBeamToggle);
27 }
28
29 //------------------------------------------------------------------------------------------------
30 protected void ActionCarLightsHiBeamToggle(float value, EActionTrigger trigger)
31 {
33 if (!pilotSlot || pilotSlot.GetOccupant() != SCR_PlayerController.GetLocalControlledEntity())
34 return;
35
36 BaseLightManagerComponent lightManager = GetLightManager();
37 if (lightManager)
38 lightManager.SetLightsState(ELightType.HiBeam, !lightManager.GetLightsState(ELightType.HiBeam));
39 }
40}
ELightType
Definition ELightType.c:8
ArmaReforgerScripted GetGame()
Definition game.c:1398
void OnCompartmentEntered(AIAgent agent, IEntity targetEntity, BaseCompartmentManagerComponent manager, int mgrID, int slotID, bool move)
void OnCompartmentLeft(AIAgent agent, IEntity targetEntity, BaseCompartmentManagerComponent manager, int mgrID, int slotID, bool move)
void ActionCarLightsHiBeamToggle(float value, EActionTrigger trigger)
PilotCompartmentSlot GetPilotCompartmentSlot()
Get primary pilot compartment slot.
Definition Vehicle.c:104
static IEntity GetLocalControlledEntity()
EActionTrigger