Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_DayDurationEditorAttribute.c
Go to the documentation of this file.
1
6{
7 //---- REFACTOR NOTE START: Hardcoded values that are not clear
8
9 override SCR_BaseEditorAttributeVar ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
10 {
11 //If opened in global attributes
12 if (!IsGameMode(item))
13 return null;
14
15 GenericEntity ent = GenericEntity.Cast(item);
16 ChimeraWorld world = ent.GetWorld();
17 TimeAndWeatherManagerEntity timeManager = world.GetTimeAndWeatherManager();
18 if (!timeManager) return null;
19
20 return SCR_BaseEditorAttributeVar.CreateFloat(86400 / timeManager.GetDayDuration());
21 }
22 override void WriteVariable(Managed item, SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager, int playerID)
23 {
24 if (!var) return;
25
26 GenericEntity ent = GenericEntity.Cast(item);
27 ChimeraWorld world = ent.GetWorld();
28 TimeAndWeatherManagerEntity timeManager = world.GetTimeAndWeatherManager();
29 if (!timeManager) return;
30
31 timeManager.SetDayDuration(86400 / var.GetFloat());
32
33 //Notification
34 if (item)
35 {
36 int notificationInt = var.GetFloat() * 10;
37 SCR_NotificationsComponent.SendToUnlimitedEditorPlayers(ENotification.EDITOR_ATTRIBUTES_DAY_DURATION_CHANGED, playerID, notificationInt * 100);
38 }
39 }
40
41 //---- REFACTOR NOTE END ----
42};
ENotification
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
proto external BaseWorld GetWorld()
static SCR_BaseEditorAttributeVar CreateFloat(float value)