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_WindDirectionEditorAttribute.c
Go to the documentation of this file.
1
4
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
5
class
SCR_WindDirectionEditorAttribute
:
SCR_BaseFloatValueHolderEditorAttribute
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
GenericEntity
ent =
GenericEntity
.Cast(item);
14
ChimeraWorld
world = ent.
GetWorld
();
15
TimeAndWeatherManagerEntity
weatherManager = world.GetTimeAndWeatherManager();
16
if
(!weatherManager)
17
return
null;
18
19
int
CurrentWindDirectionIndex;
20
SCR_WindDirectionInfo
windDirectionInfo;
21
22
weatherManager.
GetWindDirectionInfoFromFloat
(weatherManager.GetWindDirection(), CurrentWindDirectionIndex, windDirectionInfo);
23
return
SCR_BaseEditorAttributeVar
.
CreateInt
(CurrentWindDirectionIndex);
24
}
25
26
27
override
void
WriteVariable(Managed item,
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
int
playerID)
28
{
29
if
(!var)
30
return
;
31
32
GenericEntity
ent =
GenericEntity
.Cast(item);
33
ChimeraWorld
world = ent.
GetWorld
();
34
TimeAndWeatherManagerEntity
weatherManager = world.GetTimeAndWeatherManager();
35
if
(!weatherManager)
36
return
;
37
38
int
windDirectionIndex = var.
GetInt
();
39
int
CurrentWindDirectionIndex;
40
SCR_WindDirectionInfo
windDirectionInfo;
41
weatherManager.
GetWindDirectionInfoFromFloat
(weatherManager.GetWindDirection(), CurrentWindDirectionIndex, windDirectionInfo);
42
43
//Wind did not change
44
if
(CurrentWindDirectionIndex == windDirectionIndex)
45
return
;
46
47
weatherManager.
GetWindDirectionInfoFromIndex
(windDirectionIndex, windDirectionInfo);
48
weatherManager.
DelayedOverrideWindDirection
(windDirectionInfo.
GetWindDirectionValue
(), playerID);
49
}
50
51
protected
void
CreatePresets
()
52
{
53
ChimeraWorld
world =
GetGame
().GetWorld();
54
TimeAndWeatherManagerEntity
timeManager = world.GetTimeAndWeatherManager();
55
if
(!timeManager)
56
return
;
57
58
m_aValues
.Clear();
59
60
array<SCR_WindDirectionInfo> orderedWindDirectionInfo =
new
array<SCR_WindDirectionInfo>;
61
timeManager.
GetOrderedWindDirectionInfoArray
(orderedWindDirectionInfo);
62
SCR_EditorAttributeFloatStringValueHolder
value;
63
64
foreach
(
SCR_WindDirectionInfo
windDirectionInfo: orderedWindDirectionInfo)
65
{
66
value =
new
SCR_EditorAttributeFloatStringValueHolder
();
67
value.
SetName
(windDirectionInfo.GetUIInfo().GetName());
68
value.
SetFloatValue
(windDirectionInfo.GetWindDirectionValue());
69
70
m_aValues
.Insert(value);
71
}
72
}
73
74
//Call PreviewVariable of SCR_WindAutomaticEditorAttribute
75
override
void
PreviewVariable
(
bool
setPreview, SCR_AttributesManagerEditorComponent manager)
76
{
77
if
(!setPreview)
78
return
;
79
80
SCR_BaseEditorAttribute
overrideAttribute = manager.GetAttributeRef(
SCR_WindAutomaticEditorAttribute
);
81
if
(!overrideAttribute)
82
return
;
83
84
overrideAttribute.
PreviewVariable
(setPreview, manager);
85
}
86
87
override
int
GetEntries
(notnull array<ref SCR_BaseEditorAttributeEntry> outEntries)
88
{
89
CreatePresets
();
90
//outEntries.Insert(new SCR_EditorAttributeEntryOverride(weatherManager.IsWindDirectionOverridden(), SCR_WindDirectionOverrideEditorAttribute));
91
return
super.GetEntries(outEntries);
92
}
93
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
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
Base Attribute Script for other attributes to inherent from to get and set varriables in Editor Attri...
Definition
SCR_BaseEditorAttribute.c:4
SCR_BaseEditorAttribute::PreviewVariable
void PreviewVariable(bool setPreview, SCR_AttributesManagerEditorComponent manager)
SCR_BaseEditorAttribute::IsGameMode
bool IsGameMode(Managed item)
Definition
SCR_BaseEditorAttribute.c:466
SCR_BaseEditorAttributeVar
Definition
SCR_BaseEditorAttributeVar.c:2
SCR_BaseEditorAttributeVar::CreateInt
static SCR_BaseEditorAttributeVar CreateInt(int value)
Definition
SCR_BaseEditorAttributeVar.c:107
SCR_BaseEditorAttributeVar::GetInt
int GetInt()
Definition
SCR_BaseEditorAttributeVar.c:20
SCR_BaseFloatValueHolderEditorAttribute
Attribute base for Name, icon and float value for other attributes to inherent from.
Definition
SCR_BaseFloatValueHolderEditorAttribute.c:4
SCR_BaseFloatValueHolderEditorAttribute::m_aValues
ref array< ref SCR_EditorAttributeFloatStringValueHolder > m_aValues
Definition
SCR_BaseFloatValueHolderEditorAttribute.c:6
SCR_EditorAttributeFloatStringValueHolder
Definition
SCR_BaseFloatValueHolderEditorAttribute.c:61
SCR_EditorAttributeFloatStringValueHolder::SetFloatValue
void SetFloatValue(float newValue)
Definition
SCR_BaseFloatValueHolderEditorAttribute.c:129
SCR_EditorAttributeFloatStringValueHolder::SetName
void SetName(string newName)
Definition
SCR_BaseFloatValueHolderEditorAttribute.c:105
SCR_WindAutomaticEditorAttribute
Weather attribute if it should override certain weather values.
Definition
SCR_WindAutomaticEditorAttribute.c:4
SCR_WindDirectionEditorAttribute
Definition
SCR_WindDirectionEditorAttribute.c:6
SCR_WindDirectionEditorAttribute::GetEntries
override int GetEntries(notnull array< ref SCR_BaseEditorAttributeEntry > outEntries)
Definition
SCR_WindDirectionEditorAttribute.c:87
SCR_WindDirectionEditorAttribute::CreatePresets
void CreatePresets()
Definition
SCR_WindDirectionEditorAttribute.c:51
SCR_WindDirectionEditorAttribute::PreviewVariable
override void PreviewVariable(bool setPreview, SCR_AttributesManagerEditorComponent manager)
Definition
SCR_WindDirectionEditorAttribute.c:75
SCR_WindDirectionInfo
Definition
TimeAndWeatherManagerEntity.c:1197
SCR_WindDirectionInfo::GetWindDirectionValue
int GetWindDirectionValue()
Definition
TimeAndWeatherManagerEntity.c:1213
TimeAndWeatherManagerEntity
Definition
TimeAndWeatherManagerEntity.c:26
TimeAndWeatherManagerEntity::GetWindDirectionInfoFromIndex
bool GetWindDirectionInfoFromIndex(int index, out SCR_WindDirectionInfo windDirectionInfo)
Definition
TimeAndWeatherManagerEntity.c:593
TimeAndWeatherManagerEntity::GetOrderedWindDirectionInfoArray
int GetOrderedWindDirectionInfoArray(notnull array< SCR_WindDirectionInfo > orderedWindDirectionInfo)
Definition
TimeAndWeatherManagerEntity.c:574
TimeAndWeatherManagerEntity::GetWindDirectionInfoFromFloat
bool GetWindDirectionInfoFromFloat(float windDirectionFloat, out int index, out SCR_WindDirectionInfo windDirectionInfo)
Definition
TimeAndWeatherManagerEntity.c:615
TimeAndWeatherManagerEntity::DelayedOverrideWindDirection
void DelayedOverrideWindDirection(float windDirection, int playerChangingWind=-1)
Definition
TimeAndWeatherManagerEntity.c:712
scripts
Game
Editor
Containers
Attributes
SCR_WindDirectionEditorAttribute.c
Generated by
1.17.0