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_GameOverFactionsEditorAttribute.c
Go to the documentation of this file.
1
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
2
class
SCR_GameOverFactionsEditorAttribute
:
SCR_BaseMultiSelectPresetsEditorAttribute
3
{
4
5
override
SCR_BaseEditorAttributeVar
ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
6
{
7
SCR_RespawnComponent
respawnComponent =
SCR_RespawnComponent
.Cast(item);
8
if
(!respawnComponent)
9
return
null;
10
11
BaseGameMode gameMode =
GetGame
().GetGameMode();
12
if
(!gameMode)
13
return
null;
14
15
SCR_GameOverScreenManagerComponent gameOverManager = SCR_GameOverScreenManagerComponent.Cast(gameMode.FindComponent(SCR_GameOverScreenManagerComponent));
16
if
(!gameOverManager)
17
return
null;
18
19
super.ReadVariable(item, manager);
20
21
SCR_DelegateFactionManagerComponent
delegateFactionManager =
SCR_DelegateFactionManagerComponent
.
GetInstance
();
22
if
(!delegateFactionManager)
23
return
null;
24
25
SCR_FactionManager
factionManager =
SCR_FactionManager
.Cast(
GetGame
().GetFactionManager());
26
if
(!factionManager)
27
return
null;
28
29
SCR_SortedArray<SCR_EditableFactionComponent> factionDelegates =
new
SCR_SortedArray<SCR_EditableFactionComponent>;
30
int
count = delegateFactionManager.
GetSortedFactionDelegates
(factionDelegates);
31
32
33
SCR_Faction
scrFaction;
34
int
playableFactionsCount = 0;
35
36
for
(
int
i = 0; i < count; ++i)
37
{
38
scrFaction =
SCR_Faction
.Cast(factionDelegates.Get(i).GetFaction());
39
40
if
(!scrFaction || !scrFaction.
IsPlayable
())
41
continue
;
42
43
playableFactionsCount++;
44
AddOrderedState
(
false
);
45
}
46
47
if
(playableFactionsCount <= 0)
48
return
null;
49
50
return
SCR_BaseEditorAttributeVar
.
CreateVector
(
GetFlagVector
());
51
}
52
53
override
void
WriteVariable(Managed item,
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
int
playerID)
54
{
55
super.WriteVariable(item, var, manager, playerID);
56
57
SCR_BaseGameMode
gamemode =
SCR_BaseGameMode
.Cast(
GetGame
().
GetGameMode
());
58
if
(!gamemode)
59
return
;
60
61
SCR_GameOverScreenManagerComponent gameOverManager = SCR_GameOverScreenManagerComponent.Cast(gamemode.FindComponent(SCR_GameOverScreenManagerComponent));
62
if
(!gameOverManager)
63
return
;
64
65
SCR_FactionManager
factionManager =
SCR_FactionManager
.Cast(
GetGame
().GetFactionManager());
66
if
(!factionManager)
67
return
;
68
69
SCR_DelegateFactionManagerComponent
delegateFactionManager =
SCR_DelegateFactionManagerComponent
.
GetInstance
();
70
if
(!delegateFactionManager)
71
return
;
72
73
SCR_SortedArray<SCR_EditableFactionComponent> factionDelegates =
new
SCR_SortedArray<SCR_EditableFactionComponent>;
74
int
count = delegateFactionManager.
GetSortedFactionDelegates
(factionDelegates);
75
76
array <int> selectedFactions =
new
array<int>;
77
SCR_Faction
scrFaction;
78
79
//Get all selected factions
80
for
(
int
i = 0; i < count; ++i)
81
{
82
scrFaction =
SCR_Faction
.Cast(factionDelegates.Get(i).GetFaction());
83
84
if
(!scrFaction || !scrFaction.
IsPlayable
() || !
GetOrderedState
())
85
continue
;
86
87
selectedFactions.Insert(factionManager.GetFactionIndex(scrFaction));
88
}
89
90
gameOverManager.SetEditorGameOverFactions(selectedFactions);
91
}
92
93
protected
int
GetEditorGameOverInfoArray
(notnull array <SCR_BaseGameOverScreenInfo> gameOverScreens, notnull out array <SCR_BaseGameOverScreenInfo> editorGameOverScreens)
94
{
95
SCR_BaseGameOverScreenInfoEditor
editorOptional;
96
97
foreach
(
SCR_BaseGameOverScreenInfo
screen: gameOverScreens)
98
{
99
editorOptional = screen.GetEditorOptionalParams();
100
101
if
(!editorOptional || !editorOptional.m_bCanBeSetByGameMaster)
102
continue
;
103
104
editorGameOverScreens.Insert(screen);
105
}
106
107
return
editorGameOverScreens.Count();
108
}
109
110
override
protected
void
CreatePresets
()
111
{
112
SCR_DelegateFactionManagerComponent
delegateFactionManager =
SCR_DelegateFactionManagerComponent
.
GetInstance
();
113
if
(!delegateFactionManager)
114
return
;
115
116
FactionManager factionManager =
GetGame
().GetFactionManager();
117
if
(!factionManager)
118
return
;
119
120
m_aValues
.Clear();
121
122
SCR_SortedArray<SCR_EditableFactionComponent> factionDelegates =
new
SCR_SortedArray<SCR_EditableFactionComponent>;
123
int
count = delegateFactionManager.
GetSortedFactionDelegates
(factionDelegates);
124
125
SCR_Faction
scrFaction;
126
127
for
(
int
i = 0; i < count; ++i)
128
{
129
scrFaction =
SCR_Faction
.Cast(factionDelegates.Get(i).GetFaction());
130
131
if
(!scrFaction || !scrFaction.
IsPlayable
())
132
continue
;
133
134
SCR_EditorAttributeFloatStringValueHolder
value =
new
SCR_EditorAttributeFloatStringValueHolder
();
135
value.
SetWithUIInfo
(scrFaction.GetUIInfo(), factionManager.GetFactionIndex(factionDelegates.Get(i).GetFaction()));
136
m_aValues
.Insert(value);
137
}
138
}
139
};
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition
SCR_BaseGameModeComponent.c:15
SCR_FactionManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
Definition
SCR_FactionManager.c:498
SCR_RespawnComponent
void SCR_RespawnComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_RespawnComponent.c:565
SCR_BaseEditorAttributeCustomTitle
Definition
SCR_BaseEditorAttribute.c:876
SCR_BaseEditorAttributeVar
Definition
SCR_BaseEditorAttributeVar.c:2
SCR_BaseEditorAttributeVar::CreateVector
static SCR_BaseEditorAttributeVar CreateVector(vector value)
Definition
SCR_BaseEditorAttributeVar.c:125
SCR_BaseFloatValueHolderEditorAttribute::m_aValues
ref array< ref SCR_EditorAttributeFloatStringValueHolder > m_aValues
Definition
SCR_BaseFloatValueHolderEditorAttribute.c:6
SCR_BaseGameMode
Definition
SCR_BaseGameMode.c:139
SCR_BaseGameOverScreenInfoEditor
Definition
SCR_BaseGameOverScreenInfo.c:412
SCR_BaseGameOverScreenInfo
Definition
SCR_BaseGameOverScreenInfo.c:3
SCR_BaseMultiSelectPresetsEditorAttribute
Definition
SCR_BaseMultiSelectPresetsEditorAttribute.c:5
SCR_BaseMultiSelectPresetsEditorAttribute::GetOrderedState
bool GetOrderedState()
Definition
SCR_BaseMultiSelectPresetsEditorAttribute.c:50
SCR_BaseMultiSelectPresetsEditorAttribute::GetFlagVector
vector GetFlagVector()
Definition
SCR_BaseMultiSelectPresetsEditorAttribute.c:138
SCR_BaseMultiSelectPresetsEditorAttribute::AddOrderedState
void AddOrderedState(bool state)
Definition
SCR_BaseMultiSelectPresetsEditorAttribute.c:27
SCR_DelegateFactionManagerComponent
Definition
SCR_DelegateFactionManagerComponent.c:16
SCR_DelegateFactionManagerComponent::GetInstance
static SCR_DelegateFactionManagerComponent GetInstance()
Definition
SCR_DelegateFactionManagerComponent.c:27
SCR_DelegateFactionManagerComponent::GetSortedFactionDelegates
int GetSortedFactionDelegates(notnull out SCR_SortedArray< SCR_EditableFactionComponent > outDelegates)
Definition
SCR_DelegateFactionManagerComponent.c:54
SCR_EditorAttributeFloatStringValueHolder
Definition
SCR_BaseFloatValueHolderEditorAttribute.c:61
SCR_EditorAttributeFloatStringValueHolder::SetWithUIInfo
void SetWithUIInfo(SCR_UIInfo info, float value)
Definition
SCR_BaseFloatValueHolderEditorAttribute.c:141
SCR_Faction
Definition
SCR_Faction.c:6
SCR_Faction::IsPlayable
bool IsPlayable()
Definition
SCR_Faction.c:335
SCR_GameOverFactionsEditorAttribute
Definition
SCR_GameOverFactionsEditorAttribute.c:3
SCR_GameOverFactionsEditorAttribute::GetEditorGameOverInfoArray
int GetEditorGameOverInfoArray(notnull array< SCR_BaseGameOverScreenInfo > gameOverScreens, notnull out array< SCR_BaseGameOverScreenInfo > editorGameOverScreens)
Definition
SCR_GameOverFactionsEditorAttribute.c:93
SCR_GameOverFactionsEditorAttribute::CreatePresets
void CreatePresets()
Definition
SCR_GameOverFactionsEditorAttribute.c:110
scripts
Game
Editor
Containers
Attributes
SCR_GameOverFactionsEditorAttribute.c
Generated by
1.17.0