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_LightsTurnRightUserAction.c
Go to the documentation of this file.
1
class
SCR_LightsTurnRightUserAction
:
LightUserAction
2
{
3
//------------------------------------------------------------------------------------------------
4
override
void
PerformAction
(
IEntity
pOwnerEntity,
IEntity
pUserEntity)
5
{
6
if
(!pOwnerEntity || !pUserEntity)
7
return
;
8
9
BaseLightManagerComponent
lightManager = GetLightManager();
10
if
(!lightManager)
11
return
;
12
13
bool
lightsState;
14
15
lightsState = lightManager.GetLightsState(
ELightType
.Hazard, 1);
16
17
if
(
RplSession
.Mode() !=
RplMode
.Client)
18
lightsState = !lightsState;
19
20
lightManager.SetLightsState(
ELightType
.Hazard, lightsState, 1);
21
22
if
(lightsState)
23
lightManager.SetLightsState(
ELightType
.Hazard, !lightsState, 0);
24
25
// Sound
26
PlaySound
(pOwnerEntity, lightsState);
27
}
28
29
//------------------------------------------------------------------------------------------------
30
override
bool
GetActionNameScript(out
string
outName)
31
{
32
BaseLightManagerComponent
lightManager = GetLightManager();
33
34
auto
prefix =
""
;
35
UIInfo
actionInfo =
GetUIInfo
();
36
if
(actionInfo)
37
prefix = actionInfo.GetName() +
" "
;
38
39
if
(lightManager && lightManager.GetLightsState(
ELightType
.Hazard, 1))
40
outName = prefix +
"#AR-UserAction_State_Off"
;
41
else
42
outName = prefix +
"#AR-UserAction_State_On"
;
43
44
return
true
;
45
}
46
};
ELightType
ELightType
Definition
ELightType.c:8
RplMode
RplMode
Mode of replication.
Definition
RplMode.c:9
GetUIInfo
SCR_UIInfo GetUIInfo()
Definition
SCR_EditableEntityCampaignBuildingModeLabelSetting.c:27
BaseLightManagerComponent
Definition
BaseLightManagerComponent.c:13
IEntity
Definition
IEntity.c:13
LightUserAction
Definition
LightUserAction.c:2
LightUserAction::PlaySound
void PlaySound(IEntity ownerEntity, bool lightsState)
Definition
LightUserAction.c:135
RplSession
Definition
RplSession.c:8
SCR_LightsTurnRightUserAction
Definition
SCR_LightsTurnRightUserAction.c:2
UIInfo
UIInfo - allows to define UI elements.
Definition
UIInfo.c:14
PerformAction
@ PerformAction
Definition
EUserActionEvent.c:15
scripts
Game
UserActions
SCR_LightsTurnRightUserAction.c
Generated by
1.17.0