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_WindSpeedEditorAttribute.c
Go to the documentation of this file.
1
// Script File
2
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
3
class
SCR_WindSpeedEditorAttribute
:
SCR_BaseValueListEditorAttribute
4
{
5
override
SCR_BaseEditorAttributeVar
ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
6
{
7
//If opened in global attributes
8
if
(!
IsGameMode
(item))
return
null;
9
10
GenericEntity
ent =
GenericEntity
.Cast(item);
11
ChimeraWorld
world = ent.
GetWorld
();
12
TimeAndWeatherManagerEntity
weatherManager = world.GetTimeAndWeatherManager();
13
if
(!weatherManager)
return
null;
14
15
return
SCR_BaseEditorAttributeVar
.
CreateFloat
(weatherManager.GetWindSpeed());
16
}
17
18
override
void
WriteVariable(Managed item,
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
int
playerID)
19
{
20
if
(!var)
21
return
;
22
23
GenericEntity
ent =
GenericEntity
.Cast(item);
24
ChimeraWorld
world = ent.
GetWorld
();
25
TimeAndWeatherManagerEntity
weatherManager = world.GetTimeAndWeatherManager();
26
if
(!weatherManager)
27
return
;
28
29
weatherManager.
DelayedOverrideWindSpeed
(var.
GetFloat
(), playerID);
30
}
31
32
override
int
GetEntries(notnull array<ref SCR_BaseEditorAttributeEntry> outEntries)
33
{
34
//Make sure max wind speed is set to heighest wind speed in varients
35
ChimeraWorld
world =
GetGame
().GetWorld();
36
TimeAndWeatherManagerEntity
weatherManager = world.GetTimeAndWeatherManager();
37
if
(weatherManager)
38
{
39
array<ref WeatherState> weatherStates =
new
array<ref WeatherState>;
40
weatherManager.GetWeatherStatesList(weatherStates);
41
42
float
maxValue =
m_baseValues
.GetMaxValue();
43
array<ref WeatherVariant> variants = {};
44
float
newMax;
45
46
foreach
(
WeatherState
state: weatherStates)
47
{
48
state.GetVariantsList(variants);
49
50
foreach
(
WeatherVariant
variant: variants)
51
{
52
WeatherWindPattern
windPattern = variant.GetWindPattern();
53
54
if
(!windPattern)
55
continue
;
56
57
newMax = windPattern.GetMaxSpeed();
58
59
if
(newMax > maxValue)
60
maxValue = newMax;
61
}
62
}
63
64
m_baseValues
.SetMaxValue(
Math
.Ceil(maxValue));
65
}
66
67
return
super.GetEntries(outEntries);
68
}
69
70
//Call PreviewVariable of SCR_WindAutomaticEditorAttribute
71
override
void
PreviewVariable(
bool
setPreview, SCR_AttributesManagerEditorComponent manager)
72
{
73
if
(!setPreview)
74
return
;
75
76
SCR_BaseEditorAttribute
overrideAttribute = manager.GetAttributeRef(
SCR_WindAutomaticEditorAttribute
);
77
if
(!overrideAttribute)
78
return
;
79
80
overrideAttribute.
PreviewVariable
(setPreview, manager);
81
}
82
};
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()
Math
Definition
Math.c:13
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::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_BaseValueListEditorAttribute::m_baseValues
ref SCR_EditorAttributeBaseValues m_baseValues
Definition
SCR_BaseValueListEditorAttribute.c:8
SCR_WindAutomaticEditorAttribute
Weather attribute if it should override certain weather values.
Definition
SCR_WindAutomaticEditorAttribute.c:4
SCR_WindSpeedEditorAttribute
Definition
SCR_WindSpeedEditorAttribute.c:4
TimeAndWeatherManagerEntity
Definition
TimeAndWeatherManagerEntity.c:26
TimeAndWeatherManagerEntity::DelayedOverrideWindSpeed
void DelayedOverrideWindSpeed(float windSpeed, int playerChangingWind=-1)
Definition
TimeAndWeatherManagerEntity.c:692
WeatherState
Definition
WeatherState.c:8
WeatherVariant
Definition
WeatherVariant.c:8
WeatherWindPattern
Definition
WeatherWindPattern.c:8
scripts
Game
Editor
Containers
Attributes
SCR_WindSpeedEditorAttribute.c
Generated by
1.17.0