Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_TrackedControllerComponent.c
Go to the documentation of this file.
1
class
SCR_TrackedControllerComponentClass
:
TrackedControllerComponentClass
2
{
3
}
4
9
class
SCR_TrackedControllerComponent :
TrackedControllerComponent
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
{
18
GetGame
().GetInputManager().AddActionListener(
"VehicleLightsToggle"
,
EActionTrigger
.DOWN,
ActionVehicleLightsToggle
);
19
GetGame
().GetInputManager().AddActionListener(
"TrackedLightsHiBeamToggle"
,
EActionTrigger
.DOWN,
ActionTrackedLightsHiBeamToggle
);
20
}
21
}
22
23
//------------------------------------------------------------------------------------------------
24
override
void
OnCompartmentLeft
(
IEntity
vehicle,
BaseCompartmentManagerComponent
mgr,
IEntity
occupant,
int
managerId,
int
slotID)
25
{
26
super.OnCompartmentLeft(vehicle, mgr, occupant, managerId, slotID);
27
28
if
(mgr.FindCompartment(slotID, managerId) ==
GetPilotCompartmentSlot
())
29
{
30
GetGame
().GetInputManager().RemoveActionListener(
"VehicleLightsToggle"
,
EActionTrigger
.DOWN,
ActionVehicleLightsToggle
);
31
GetGame
().GetInputManager().RemoveActionListener(
"TrackedLightsHiBeamToggle"
,
EActionTrigger
.DOWN,
ActionTrackedLightsHiBeamToggle
);
32
}
33
}
34
35
//------------------------------------------------------------------------------------------------
36
protected
void
ActionTrackedLightsHiBeamToggle
(
float
value,
EActionTrigger
trigger)
37
{
38
PilotCompartmentSlot
pilotSlot =
GetPilotCompartmentSlot
();
39
if
(!pilotSlot || pilotSlot.GetOccupant() !=
SCR_PlayerController
.
GetLocalControlledEntity
())
40
return
;
41
42
BaseLightManagerComponent
lightManager = GetLightManager();
43
if
(lightManager)
44
lightManager.SetLightsState(
ELightType
.HiBeam, !lightManager.GetLightsState(
ELightType
.HiBeam));
45
}
46
47
//------------------------------------------------------------------------------------------------
48
protected
void
ActionVehicleLightsToggle
(
float
value,
EActionTrigger
trigger)
49
{
50
PilotCompartmentSlot
pilotSlot =
GetPilotCompartmentSlot
();
51
if
(!pilotSlot || pilotSlot.GetOccupant() !=
SCR_PlayerController
.
GetLocalControlledEntity
())
52
return
;
53
54
BaseLightManagerComponent
lightManager = GetLightManager();
55
if
(lightManager)
56
lightManager.SetLightsState(
ELightType
.Presence, !lightManager.GetLightsState(
ELightType
.Presence));
57
}
58
}
ELightType
ELightType
Definition
ELightType.c:8
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
OnCompartmentEntered
void OnCompartmentEntered(AIAgent agent, IEntity targetEntity, BaseCompartmentManagerComponent manager, int mgrID, int slotID, bool move)
Definition
SCR_AIUtilityComponent.c:428
OnCompartmentLeft
void OnCompartmentLeft(AIAgent agent, IEntity targetEntity, BaseCompartmentManagerComponent manager, int mgrID, int slotID, bool move)
Definition
SCR_AIUtilityComponent.c:442
ActionVehicleLightsToggle
void ActionVehicleLightsToggle(float value, EActionTrigger trigger)
Definition
SCR_TrackedControllerComponent.c:48
ActionTrackedLightsHiBeamToggle
void ActionTrackedLightsHiBeamToggle(float value, EActionTrigger trigger)
Definition
SCR_TrackedControllerComponent.c:36
GetPilotCompartmentSlot
PilotCompartmentSlot GetPilotCompartmentSlot()
Get primary pilot compartment slot.
Definition
Vehicle.c:104
BaseCompartmentManagerComponent
Definition
BaseCompartmentManagerComponent.c:13
BaseLightManagerComponent
Definition
BaseLightManagerComponent.c:13
IEntity
Definition
IEntity.c:13
PilotCompartmentSlot
Definition
PilotCompartmentSlot.c:13
SCR_PlayerController
Definition
SCR_PlayerController.c:31
SCR_PlayerController::GetLocalControlledEntity
static IEntity GetLocalControlledEntity()
Definition
SCR_PlayerController.c:495
SCR_TrackedControllerComponentClass
Definition
SCR_TrackedControllerComponent.c:2
TrackedControllerComponentClass
Definition
TrackedControllerComponentClass.c:13
TrackedControllerComponent
Definition
TrackedControllerComponent.c:13
EActionTrigger
EActionTrigger
Definition
EActionTrigger.c:13
scripts
GameCode
Vehicle
SCR_TrackedControllerComponent.c
Generated by
1.17.0