Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_RespawnMusic.c
Go to the documentation of this file.
2 {
3  protected MusicManager m_MusicManager;
4  protected bool m_bIsPlaying;
5 
6  protected void OnRespawnMenuOpen()
7  {
8  if (!m_bIsPlaying)
9  m_MusicManager.Play(SCR_SoundEvent.SOUND_RESPAWNMENU);
10  }
11 
12  protected void OnRespawnMenuClosed()
13  {
14  m_MusicManager.Stop(SCR_SoundEvent.SOUND_RESPAWNMENU);
15  }
16 
17  override void Init()
18  {
19  ChimeraWorld world = GetGame().GetWorld();
20 
21  if (!world)
22  return;
23 
24  m_MusicManager = world.GetMusicManager();
25  if (!m_MusicManager)
26  return;
27 
28  // Register respawn menu screen events
29  SCR_DeployMenuBase.SGetOnMenuOpen().Insert(OnRespawnMenuOpen);
30  SCR_PlayerDeployMenuHandlerComponent.SGetOnMenuClosed().Insert(OnRespawnMenuClosed);
31  }
32 
33  override void OnDelete()
34  {
35  SCR_DeployMenuBase.SGetOnMenuOpen().Remove(OnRespawnMenuOpen);
36  SCR_PlayerDeployMenuHandlerComponent.SGetOnMenuClosed().Remove(OnRespawnMenuClosed);
37  }
38 
39  override void OnPlay()
40  {
41  m_bIsPlaying = true;
42  }
43 
44  override void OnStop()
45  {
46  m_bIsPlaying = false;
47  }
48 }
ChimeraWorld
Definition: ChimeraWorld.c:12
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_SoundEvent
Definition: SCR_SoundEvent.c:1
ScriptedMusic
Definition: ScriptedMusic.c:12
SCR_RespawnMusic
Definition: SCR_RespawnMusic.c:1
SCR_DeployMenuBase
Base deploy menu class.
Definition: SCR_DeployMenuBase.c:3
m_MusicManager
protected MusicManager m_MusicManager
Definition: SCR_CharacterTriggerEntity.c:70