Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
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")]
6{
7 SCR_EditorManagerEntity m_EditorManager;
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
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
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
43 }
44
45 override void EOnEditorInit()
46 {
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())
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};
ArmaReforgerScripted GetGame()
Definition game.c:1398
enum SCR_ECompassType EntityEditorProps(category:"GameScripted/Gadgets", description:"Compass", color:"0 0 255 255")
Prefab data class for compass component.
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
void SCR_BaseEditorComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
static bool IsEditMode()
Definition Functions.c:1566
override void OnDelete(IEntity owner)
MusicCategory