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_RadioToggleUserAction.c
Go to the documentation of this file.
1
class
SCR_RadioToggleUserAction
:
SCR_InventoryAction
2
{
3
protected
SCR_RadioComponent
m_RadioComp
;
4
5
//------------------------------------------------------------------------------------------------
6
override
bool
CanBeShownScript
(
IEntity
user)
7
{
8
if
(!
m_RadioComp
)
9
return
false
;
10
11
CharacterControllerComponent charComp = CharacterControllerComponent.Cast(user.
FindComponent
(CharacterControllerComponent));
12
return
charComp.GetInspect();
13
}
14
15
protected
override
void
PerformAction
(
IEntity
pOwnerEntity,
IEntity
pUserEntity)
16
{
17
if
(
CanBePerformed
(pUserEntity))
18
m_RadioComp
.RadioToggle();
19
20
if
(!
m_RadioComp
.GetRadioComponent().IsPowered())
21
SCR_SoundManagerModule
.CreateAndPlayAudioSource(pOwnerEntity,
SCR_SoundEvent
.SOUND_ITEM_RADIO_TOGGLE_ON);
22
else
23
SCR_SoundManagerModule
.CreateAndPlayAudioSource(pOwnerEntity,
SCR_SoundEvent
.SOUND_ITEM_RADIO_TOGGLE_OFF);
24
}
25
26
override
void
Init
(
IEntity
pOwnerEntity,
GenericComponent
pManagerComponent)
27
{
28
m_RadioComp
= SCR_RadioComponent.Cast(pOwnerEntity.
FindComponent
(SCR_RadioComponent));
29
}
30
31
override
bool
HasLocalEffectOnlyScript
()
32
{
33
return
false
;
34
}
35
36
override
bool
GetActionNameScript
(out
string
outName)
37
{
38
if
(
m_RadioComp
.GetRadioComponent().IsPowered())
39
outName =
"#AR-UserAction_TurnOff"
;
40
else
41
outName =
"#AR-UserAction_TurnOn"
;
42
43
return
true
;
44
}
45
};
BaseUserAction::CanBePerformed
proto external bool CanBePerformed(IEntity user)
Can this action be performed by the user?
GenericComponent
Definition
GenericComponent.c:13
IEntity
Definition
IEntity.c:13
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
SCR_InventoryAction
modded version for to be used with the inventory 2.0
Definition
SCR_InventoryAction.c:4
SCR_RadioToggleUserAction
Definition
SCR_RadioToggleUserAction.c:2
SCR_RadioToggleUserAction::m_RadioComp
SCR_RadioComponent m_RadioComp
Definition
SCR_RadioToggleUserAction.c:3
SCR_RadioToggleUserAction::HasLocalEffectOnlyScript
override bool HasLocalEffectOnlyScript()
Definition
SCR_RadioToggleUserAction.c:31
SCR_RadioToggleUserAction::CanBeShownScript
override bool CanBeShownScript(IEntity user)
Definition
SCR_RadioToggleUserAction.c:6
SCR_RadioToggleUserAction::PerformAction
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
Definition
SCR_RadioToggleUserAction.c:15
SCR_RadioToggleUserAction::GetActionNameScript
override bool GetActionNameScript(out string outName)
Definition
SCR_RadioToggleUserAction.c:36
SCR_RadioToggleUserAction::Init
override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
Definition
SCR_RadioToggleUserAction.c:26
SCR_SoundEvent
Definition
SCR_SoundEvent.c:2
SCR_SoundManagerModule
Definition
SCR_SoundManagerModule.c:12
scripts
Game
UserActions
Inspection
SCR_RadioToggleUserAction.c
Generated by
1.17.0