Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_DayDurationEditorAttribute.c
Go to the documentation of this file.
1
4
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
5
class
SCR_DayDurationEditorAttribute
:
SCR_BaseValueListEditorAttribute
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
ENotification
Definition
ENotification.c:5
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
ChimeraWorld
Definition
ChimeraWorld.c:13
GenericEntity
Definition
GenericEntity.c:16
IEntity::GetWorld
proto external BaseWorld GetWorld()
SCR_BaseEditorAttributeCustomTitle
Definition
SCR_BaseEditorAttribute.c:876
SCR_BaseEditorAttribute::IsGameMode
bool IsGameMode(Managed item)
Definition
SCR_BaseEditorAttribute.c:466
SCR_BaseEditorAttributeVar
Definition
SCR_BaseEditorAttributeVar.c:2
SCR_BaseEditorAttributeVar::GetFloat
float GetFloat()
Definition
SCR_BaseEditorAttributeVar.c:38
SCR_BaseEditorAttributeVar::CreateFloat
static SCR_BaseEditorAttributeVar CreateFloat(float value)
Definition
SCR_BaseEditorAttributeVar.c:113
SCR_BaseValueListEditorAttribute
Definition
SCR_BaseValueListEditorAttribute.c:6
SCR_DayDurationEditorAttribute
Definition
SCR_DayDurationEditorAttribute.c:6
TimeAndWeatherManagerEntity
Definition
TimeAndWeatherManagerEntity.c:26
scripts
Game
Editor
Containers
Attributes
SCR_DayDurationEditorAttribute.c
Generated by
1.17.0