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_MusicEditorComponent.c
Go to the documentation of this file.
1
[
EntityEditorProps
(
category
:
"GameScripted/Sound"
, description:
"Music component"
, color:
"0 0 255 255"
)]
2
class
SCR_MusicEditorComponentClass
:
SCR_BaseEditorComponentClass
3
{
4
};
5
class
SCR_MusicEditorComponent
:
SCR_BaseEditorComponent
6
{
7
SCR_EditorManagerEntity
m_EditorManager;
8
protected
bool
m_bMusicWasMutedByEditor
;
9
protected
MusicManager
m_MusicManager
;
10
11
protected
void
OnEditorOpened
()
12
{
13
//Add a short delay to make sure any ambient music that started to play is terminated correctly
14
GetGame
().GetCallqueue().CallLater(
OpenedEditorDelay
, 500);
15
}
16
17
protected
void
OpenedEditorDelay
()
18
{
19
if
(!m_EditorManager.IsOpened() || m_EditorManager.IsLimited())
20
return
;
21
22
m_bMusicWasMutedByEditor
=
true
;
23
if
(
m_MusicManager
)
24
{
25
m_MusicManager
.MuteCategory(
MusicCategory
.Ambient,
true
,
true
);
26
m_MusicManager
.MuteCategory(
MusicCategory
.Menu,
true
,
true
);
27
m_MusicManager
.MuteCategory(
MusicCategory
.Misc,
true
,
true
);
28
}
29
}
30
31
protected
void
OnEditorClosed
()
32
{
33
//Checks this in cause the limited mode changed
34
if
(
m_bMusicWasMutedByEditor
&&
m_MusicManager
)
35
{
36
m_MusicManager
.MuteCategory(
MusicCategory
.Ambient,
false
,
false
);
37
m_MusicManager
.MuteCategory(
MusicCategory
.Menu,
false
,
false
);
38
m_MusicManager
.MuteCategory(
MusicCategory
.Misc,
false
,
false
);
39
}
40
41
42
m_bMusicWasMutedByEditor
=
false
;
43
}
44
45
override
void
EOnEditorInit
()
46
{
47
if
(
SCR_Global
.
IsEditMode
())
48
return
;
49
50
super.EOnEditorInit();
51
52
ChimeraWorld
world =
GetGame
().GetWorld();
53
54
if
(!world)
55
return
;
56
57
m_MusicManager
= world.GetMusicManager();
58
if
(!
m_MusicManager
)
59
return
;
60
61
m_EditorManager =
SCR_EditorManagerEntity
.GetInstance();
62
if
(m_EditorManager)
63
{
64
m_EditorManager.GetOnOpened().Insert(
OnEditorOpened
);
65
m_EditorManager.GetOnClosed().Insert(
OnEditorClosed
);
66
67
if
(m_EditorManager.IsOpened())
68
OnEditorOpened
();
69
}
70
}
71
72
override
void
OnDelete
(
IEntity
owner)
73
{
74
super.OnDelete(owner);
75
76
if
(m_EditorManager)
77
{
78
m_EditorManager.GetOnOpened().Remove(
OnEditorOpened
);
79
m_EditorManager.GetOnClosed().Remove(
OnEditorClosed
);
80
}
81
}
82
};
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
SCR_EditorManagerEntity
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
Definition
SCR_EditorManagerEntity.c:2211
category
params category
Definition
SCR_VehicleDamageManagerComponent.c:302
ChimeraWorld
Definition
ChimeraWorld.c:13
IEntity
Definition
IEntity.c:13
SCR_BaseEditorComponentClass
Definition
SCR_BaseEditorComponent.c:3
SCR_BaseEditorComponent::SCR_BaseEditorComponent
void SCR_BaseEditorComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_BaseEditorComponent.c:683
SCR_Global
Definition
Functions.c:7
SCR_Global::IsEditMode
static bool IsEditMode()
Definition
Functions.c:1566
SCR_MusicEditorComponentClass
Definition
SCR_MusicEditorComponent.c:3
SCR_MusicEditorComponent
Definition
SCR_MusicEditorComponent.c:6
SCR_MusicEditorComponent::OpenedEditorDelay
void OpenedEditorDelay()
Definition
SCR_MusicEditorComponent.c:17
SCR_MusicEditorComponent::m_MusicManager
MusicManager m_MusicManager
Definition
SCR_MusicEditorComponent.c:9
SCR_MusicEditorComponent::EOnEditorInit
override void EOnEditorInit()
Definition
SCR_MusicEditorComponent.c:45
SCR_MusicEditorComponent::m_bMusicWasMutedByEditor
bool m_bMusicWasMutedByEditor
Definition
SCR_MusicEditorComponent.c:8
SCR_MusicEditorComponent::OnDelete
override void OnDelete(IEntity owner)
Definition
SCR_MusicEditorComponent.c:72
SCR_MusicEditorComponent::OnEditorClosed
void OnEditorClosed()
Definition
SCR_MusicEditorComponent.c:31
SCR_MusicEditorComponent::OnEditorOpened
void OnEditorOpened()
Definition
SCR_MusicEditorComponent.c:11
MusicCategory
MusicCategory
Definition
MusicCategory.c:14
scripts
Game
Editor
Components
Editor
SCR_MusicEditorComponent.c
Generated by
1.17.0