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_PlayableFactionsEditorAttribute.c
Go to the documentation of this file.
1
2
[
BaseContainerProps
(),
SCR_BaseEditorAttributeCustomTitle
()]
3
class
SCR_PlayableFactionsEditorAttribute
:
SCR_BaseMultiSelectPresetsEditorAttribute
4
{
5
override
SCR_BaseEditorAttributeVar
ReadVariable(Managed item, SCR_AttributesManagerEditorComponent manager)
6
{
7
//If opened in global attributes
8
if
(!
IsGameMode
(item))
9
{
10
SCR_TaskSystem
taskSystem =
SCR_TaskSystem
.Cast(item);
11
if
(!taskSystem)
12
return
null;
13
}
14
15
super.ReadVariable(item, manager);
16
17
SCR_DelegateFactionManagerComponent
delegateFactionManager =
SCR_DelegateFactionManagerComponent
.
GetInstance
();
18
if
(!delegateFactionManager)
19
return
null;
20
21
SCR_FactionManager
factionManager =
SCR_FactionManager
.Cast(
GetGame
().GetFactionManager());
22
if
(!factionManager || !factionManager.CanChangeFactionsPlayable())
23
return
null;
24
25
SCR_SortedArray<SCR_EditableFactionComponent> factionDelegates =
new
SCR_SortedArray<SCR_EditableFactionComponent>;
26
int
count = delegateFactionManager.
GetSortedFactionDelegates
(factionDelegates);
27
SCR_Faction
scrFaction;
28
29
for
(
int
i = 0; i < count; ++i)
30
{
31
scrFaction =
SCR_Faction
.Cast(factionDelegates.Get(i).GetFaction());
32
33
if
(!scrFaction)
34
continue
;
35
36
AddOrderedState
(scrFaction.
IsPlayable
());
37
}
38
39
return
SCR_BaseEditorAttributeVar
.
CreateVector
(
GetFlagVector
());
40
}
41
42
override
void
WriteVariable(Managed item,
SCR_BaseEditorAttributeVar
var, SCR_AttributesManagerEditorComponent manager,
int
playerID)
43
{
44
super.WriteVariable(item, var, manager, playerID);
45
46
SCR_DelegateFactionManagerComponent
delegateFactionManager =
SCR_DelegateFactionManagerComponent
.
GetInstance
();
47
if
(!delegateFactionManager)
48
return
;
49
50
SCR_SortedArray<SCR_EditableFactionComponent> factionDelegates =
new
SCR_SortedArray<SCR_EditableFactionComponent>;
51
int
count = delegateFactionManager.
GetSortedFactionDelegates
(factionDelegates);
52
SCR_Faction
scrFaction;
53
54
for
(
int
i = 0; i < count; ++i)
55
{
56
scrFaction =
SCR_Faction
.Cast(factionDelegates.Get(i).GetFaction());
57
58
if
(!scrFaction)
59
continue
;
60
61
factionDelegates.Get(i).SetFactionPlayableServer(
GetOrderedState
());
62
}
63
64
if
(item)
65
SCR_NotificationsComponent.SendToEveryone(
ENotification
.EDITOR_ATTRIBUTES_FACTION_CHANGED, playerID);
66
}
67
68
override
protected
void
CreatePresets
()
69
{
70
SCR_DelegateFactionManagerComponent
delegateFactionManager =
SCR_DelegateFactionManagerComponent
.
GetInstance
();
71
if
(!delegateFactionManager)
72
return
;
73
74
FactionManager factionManager =
GetGame
().GetFactionManager();
75
if
(!factionManager)
76
return
;
77
78
m_aValues
.Clear();
79
80
SCR_SortedArray<SCR_EditableFactionComponent> factionDelegates =
new
SCR_SortedArray<SCR_EditableFactionComponent>;
81
int
count = delegateFactionManager.
GetSortedFactionDelegates
(factionDelegates);
82
83
SCR_Faction
scrFaction;
84
85
for
(
int
i = 0; i < count; ++i)
86
{
87
scrFaction =
SCR_Faction
.Cast(factionDelegates.Get(i).GetFaction());
88
89
if
(!scrFaction || scrFaction.
GetParent
() != null)
90
continue
;
91
92
SCR_EditorAttributeFloatStringValueHolder
value =
new
SCR_EditorAttributeFloatStringValueHolder
();
93
value.
SetWithUIInfo
(scrFaction.GetUIInfo(), factionManager.GetFactionIndex(factionDelegates.Get(i).GetFaction()));
94
m_aValues
.Insert(value);
95
}
96
}
97
};
ENotification
ENotification
Definition
ENotification.c:5
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
BaseContainerProps
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
Definition
SCR_AIAnimationWaypoint.c:14
SCR_FactionManager
void SCR_FactionManager(IEntitySource src, IEntity parent)
Definition
SCR_FactionManager.c:498
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::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_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::GetParent
Faction GetParent()
Definition
SCR_Faction.c:546
SCR_Faction::IsPlayable
bool IsPlayable()
Definition
SCR_Faction.c:335
SCR_PlayableFactionsEditorAttribute
Definition
SCR_PlayableFactionsEditorAttribute.c:4
SCR_PlayableFactionsEditorAttribute::CreatePresets
void CreatePresets()
Definition
SCR_PlayableFactionsEditorAttribute.c:68
SCR_TaskSystem
Definition
SCR_TaskSystem.c:6
scripts
Game
Editor
Containers
Attributes
SCR_PlayableFactionsEditorAttribute.c
Generated by
1.17.0