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_UISoundEntity.c
Go to the documentation of this file.
1
[
EntityEditorProps
(
category
:
"GameScripted/UI"
, description:
"Handles sounds played by UI"
, color:
"0 0 255 255"
)]
2
class
SCR_UISoundEntityClass
: GenericEntityClass
3
{
4
5
};
6
7
class
SCR_UISoundEntity :
GenericEntity
8
{
9
static
private
SimpleSoundComponent
m_SoundComponent;
10
static
private
SCR_UISoundEntity m_Instance;
11
12
static
SCR_UISoundEntity GetInstance()
13
{
14
return
m_Instance;
15
}
16
17
//------------------------------------------------------------------------------------------------
18
static
AudioHandle
SoundEvent(
string
eventName,
bool
force =
false
)
19
{
20
if
(!m_SoundComponent)
21
{
22
if
(!m_Instance)
23
return
AudioHandle
.Invalid;
24
25
m_SoundComponent =
SimpleSoundComponent
.Cast(m_Instance.FindComponent(
SimpleSoundComponent
));
26
if
(!m_SoundComponent)
27
return
AudioHandle
.Invalid;
28
}
29
30
if
(force)
31
m_SoundComponent.TerminateAll();
32
33
return
m_SoundComponent.PlayStr(eventName);
34
}
35
36
//------------------------------------------------------------------------------------------------
37
static
void
SetSignalValueStr(
string
signal,
float
value)
38
{
39
if
(!m_SoundComponent)
40
{
41
if
(!m_Instance)
42
return
;
43
44
m_SoundComponent =
SimpleSoundComponent
.Cast(m_Instance.FindComponent(
SimpleSoundComponent
));
45
if
(!m_SoundComponent)
46
return
;
47
}
48
49
m_SoundComponent.SetSignalValueStr(signal, value);
50
}
51
52
//------------------------------------------------------------------------------------------------
53
override
void
EOnInit(
IEntity
owner)
54
{
55
m_SoundComponent =
SimpleSoundComponent
.Cast(
FindComponent
(
SimpleSoundComponent
));
56
57
// Insert radio protocol subtitles settings change event
58
GetGame
().OnUserSettingsChangedInvoker().Insert(
SCR_CommunicationSoundComponent
.
SetSubtitiles
);
59
SCR_CommunicationSoundComponent
.
SetSubtitiles
();
60
}
61
62
//------------------------------------------------------------------------------------------------
63
void
SCR_UISoundEntity(
IEntitySource
src,
IEntity
parent)
64
{
65
SetEventMask
(
EntityEvent
.INIT);
66
m_Instance =
this
;
67
}
68
69
//------------------------------------------------------------------------------------------------
70
void
~SCR_UISoundEntity(
IEntitySource
src,
IEntity
parent)
71
{
72
// Remove radio protocol subtitles settings change event
73
GetGame
().OnUserSettingsChangedInvoker().Remove(
SCR_CommunicationSoundComponent
.
SetSubtitiles
);
74
}
75
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
EntityEditorProps
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
Definition
SCR_CompassComponent.c:10
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
AudioHandle
Definition
EnAudio.c:9
GenericEntity
Definition
GenericEntity.c:16
IEntity::IEntity
void IEntity(IEntitySource src, IEntity parent)
protected script Constructor
IEntity::SetEventMask
proto external EntityEvent SetEventMask(EntityEvent e)
IEntity::FindComponent
proto external Managed FindComponent(typename typeName)
IEntitySource
Definition
IEntitySource.c:13
SCR_CommunicationSoundComponent
Definition
SCR_CommunicationSoundComponent.c:61
SCR_CommunicationSoundComponent::SetSubtitiles
static void SetSubtitiles()
Definition
SCR_CommunicationSoundComponent.c:131
SCR_UISoundEntityClass
Definition
SCR_UISoundEntity.c:3
SimpleSoundComponent
Definition
SimpleSoundComponent.c:13
EntityEvent
EntityEvent
Various entity events.
Definition
EntityEvent.c:14
scripts
Game
UI
Sounds
SCR_UISoundEntity.c
Generated by
1.17.0