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_RadioTuningUserAction.c
Go to the documentation of this file.
1
class
SCR_RadioTuningUserAction
:
SCR_InventoryAction
2
{
3
protected
SCR_RadioComponent
m_RadioComp
;
4
5
//------------------------------------------------------------------------------------------------
6
[
Attribute
(
"0"
)]
7
protected
bool
m_bTuneUp
;
8
9
override
bool
CanBeShownScript
(
IEntity
user)
10
{
11
if
(!
m_RadioComp
)
12
return
false
;
13
14
CharacterControllerComponent charComp = CharacterControllerComponent.Cast(user.
FindComponent
(CharacterControllerComponent));
15
return
charComp.GetInspect();
16
}
17
18
override
void
PerformAction
(
IEntity
pOwnerEntity,
IEntity
pUserEntity)
19
{
20
bool
changeFreq;
21
if
(
CanBePerformed
(pUserEntity))
22
changeFreq =
m_RadioComp
.ChangeFrequencyStep(
m_bTuneUp
);
23
24
if
(!changeFreq)
25
{
26
SCR_SoundManagerModule
.CreateAndPlayAudioSource(pOwnerEntity,
SCR_SoundEvent
.SOUND_ITEM_RADIO_TUNE_ERROR);
27
}
28
else
29
{
30
if
(
m_bTuneUp
)
31
SCR_SoundManagerModule
.CreateAndPlayAudioSource(pOwnerEntity,
SCR_SoundEvent
.SOUND_ITEM_RADIO_TUNE_UP);
32
else
33
SCR_SoundManagerModule
.CreateAndPlayAudioSource(pOwnerEntity,
SCR_SoundEvent
.SOUND_ITEM_RADIO_TUNE_DOWN);
34
}
35
}
36
37
override
bool
HasLocalEffectOnlyScript
()
38
{
39
return
false
;
40
}
41
42
override
void
Init
(
IEntity
pOwnerEntity,
GenericComponent
pManagerComponent)
43
{
44
m_RadioComp
= SCR_RadioComponent.Cast(pOwnerEntity.
FindComponent
(SCR_RadioComponent));
45
}
46
47
override
bool
GetActionNameScript
(out
string
outName)
48
{
49
BaseRadioComponent radioComp =
m_RadioComp
.GetRadioComponent();
50
if
(!radioComp)
51
return
false
;
52
53
// Get the first transceiver, but may become problematic for manipulation of multiple channels of the radio
54
BaseTransceiver
transceiver = radioComp.GetTransceiver(0);
55
if
(!transceiver)
56
return
false
;
57
58
float
targetFreq = transceiver.GetFrequency() + transceiver.GetFrequencyResolution();
59
if
(!
m_bTuneUp
)
60
targetFreq = transceiver.GetFrequency() - transceiver.GetFrequencyResolution();
61
62
outName =
WidgetManager
.Translate(
"#AR-UserAction_TuneRadioToFrequency"
, targetFreq / 1000);
63
return
true
;
64
}
65
};
BaseTransceiver
Definition
BaseTransceiver.c:13
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_RadioTuningUserAction
Definition
SCR_RadioTuningUserAction.c:2
SCR_RadioTuningUserAction::HasLocalEffectOnlyScript
override bool HasLocalEffectOnlyScript()
Definition
SCR_RadioTuningUserAction.c:37
SCR_RadioTuningUserAction::PerformAction
override void PerformAction(IEntity pOwnerEntity, IEntity pUserEntity)
Definition
SCR_RadioTuningUserAction.c:18
SCR_RadioTuningUserAction::Init
override void Init(IEntity pOwnerEntity, GenericComponent pManagerComponent)
Definition
SCR_RadioTuningUserAction.c:42
SCR_RadioTuningUserAction::GetActionNameScript
override bool GetActionNameScript(out string outName)
Definition
SCR_RadioTuningUserAction.c:47
SCR_RadioTuningUserAction::CanBeShownScript
override bool CanBeShownScript(IEntity user)
Definition
SCR_RadioTuningUserAction.c:9
SCR_RadioTuningUserAction::m_RadioComp
SCR_RadioComponent m_RadioComp
Definition
SCR_RadioTuningUserAction.c:3
SCR_RadioTuningUserAction::m_bTuneUp
bool m_bTuneUp
Definition
SCR_RadioTuningUserAction.c:7
SCR_SoundEvent
Definition
SCR_SoundEvent.c:2
SCR_SoundManagerModule
Definition
SCR_SoundManagerModule.c:12
WidgetManager
Definition
WidgetManager.c:16
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
scripts
Game
UserActions
Inspection
SCR_RadioTuningUserAction.c
Generated by
1.17.0