15 super.ReadVariable(item, manager);
18 if (!delegateFactionManager)
22 if (!factionManager || !factionManager.CanChangeFactionsPlayable())
25 SCR_SortedArray<SCR_EditableFactionComponent> factionDelegates =
new SCR_SortedArray<SCR_EditableFactionComponent>;
26 int count = delegateFactionManager.GetSortedFactionDelegates(factionDelegates);
29 for(
int i = 0; i < count; ++i)
31 scrFaction =
SCR_Faction.Cast(factionDelegates.Get(i).GetFaction());
36 AddOrderedState(scrFaction.IsPlayable());
42 override void WriteVariable(Managed item,
SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager,
int playerID)
44 super.WriteVariable(item, var, manager, playerID);
47 if (!delegateFactionManager)
50 SCR_SortedArray<SCR_EditableFactionComponent> factionDelegates =
new SCR_SortedArray<SCR_EditableFactionComponent>;
51 int count = delegateFactionManager.GetSortedFactionDelegates(factionDelegates);
54 for(
int i = 0; i < count; ++i)
56 scrFaction =
SCR_Faction.Cast(factionDelegates.Get(i).GetFaction());
61 factionDelegates.Get(i).SetFactionPlayableServer(GetOrderedState());
65 SCR_NotificationsComponent.SendToEveryone(
ENotification.EDITOR_ATTRIBUTES_FACTION_CHANGED, playerID);
68 override protected void CreatePresets()
71 if (!delegateFactionManager)
74 FactionManager factionManager =
GetGame().GetFactionManager();
80 SCR_SortedArray<SCR_EditableFactionComponent> factionDelegates =
new SCR_SortedArray<SCR_EditableFactionComponent>;
81 int count = delegateFactionManager.GetSortedFactionDelegates(factionDelegates);
85 for(
int i = 0; i < count; ++i)
87 scrFaction =
SCR_Faction.Cast(factionDelegates.Get(i).GetFaction());
93 value.SetWithUIInfo(scrFaction.GetUIInfo(), factionManager.GetFactionIndex(factionDelegates.Get(i).GetFaction()));