Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_TimeAdvancementEditorAttribute.c
Go to the documentation of this file.
1// Script File
5// Script File
8{
9 override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
10 {
11 //If opened in global attributes
12 if (!IsGameMode(item)) return null;
13
14 GenericEntity ent = GenericEntity.Cast(item);
15 ChimeraWorld world = ent.GetWorld();
16 TimeAndWeatherManagerEntity weatherManager = world.GetTimeAndWeatherManager();
17 if (!weatherManager) return null;
18
19 return SCR_BaseEditorAttributeVar.CreateBool(weatherManager.GetIsDayAutoAdvanced());
20 }
21
22 //Disable respawn time if respawning is disabled
23 override void UpdateInterlinkedVariables(SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, bool isInit = false)
24 {
25 if (isInit)
26 manager.SetAttributeAsSubAttribute(SCR_DayDurationEditorAttribute);
27
28 manager.SetAttributeEnabled(SCR_DayDurationEditorAttribute, var && var.GetBool());
29 }
30
31 override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
32 {
33 GenericEntity ent = GenericEntity.Cast(item);
34 ChimeraWorld world = ent.GetWorld();
35 TimeAndWeatherManagerEntity weatherManager = world.GetTimeAndWeatherManager();
36 if (!weatherManager)
37 return;
38
39 bool value = var.GetBool();
40 weatherManager.SetIsDayAutoAdvanced(value);
41
42 if (item)
43 {
44 if (value)
45 SCR_NotificationsComponent.SendToUnlimitedEditorPlayers(ENotification.EDITOR_ATTRIBUTES_DAY_ADVANCE_ENABLED, playerID);
46 else
47 SCR_NotificationsComponent.SendToUnlimitedEditorPlayers(ENotification.EDITOR_ATTRIBUTES_DAY_ADVANCE_DISABLED, playerID);
48 }
49 }
50};
ENotification
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
proto external BaseWorld GetWorld()
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
static SCR_BaseEditorAttributeVar CreateBool(bool value)