Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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};
ENotification
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
static SCR_BaseEditorAttributeVar CreateBool(bool value)
MusicCategory