Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_AmbientSoundToggleEditorAttribute.c
Go to the documentation of this file.
1 
6 {
7  override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
8  {
9  //If opened in global attributes
10  if (!IsGameMode(item))
11  return null;
12 
13  ChimeraWorld world = GetGame().GetWorld();
14 
15  if (!world)
16  return null;
17 
18  MusicManager musicManager = world.GetMusicManager();
19  if (!musicManager)
20  return null;
21 
22  return SCR_BaseEditorAttributeVar.CreateBool(!musicManager.ServerIsCategoryMuted(MusicCategory.Ambient));
23 
24  }
25  override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
26  {
27  if (!var)
28  return;
29 
30  ChimeraWorld world = GetGame().GetWorld();
31 
32  if (!world)
33  return;
34 
35  MusicManager musicManager = world.GetMusicManager();
36  if (!musicManager)
37  return;
38 
39  if (var.GetBool())
40  SCR_NotificationsComponent.SendToEveryone(ENotification.EDITOR_ATTRIBUTES_ENABLED_AMBIENT_MUSIC, playerID);
41  else
42  SCR_NotificationsComponent.SendToEveryone(ENotification.EDITOR_ATTRIBUTES_DISABLED_AMBIENT_MUSIC, playerID);
43 
44  musicManager.RequestServerMuteCategory(MusicCategory.Ambient, !var.GetBool());
45  }
46 };
ChimeraWorld
Definition: ChimeraWorld.c:12
SCR_AmbientSoundToggleEditorAttribute
Definition: SCR_AmbientSoundToggleEditorAttribute.c:5
MusicCategory
MusicCategory
Definition: MusicCategory.c:12
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_BaseEditorAttributeCustomTitle
Definition: SCR_BaseEditorAttribute.c:868
ENotification
ENotification
Definition: ENotification.c:4
SCR_BaseEditorAttributeVar
Definition: SCR_BaseEditorAttributeVar.c:1
SCR_BaseEditorAttribute
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Definition: SCR_BaseEditorAttribute.c:3
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468