11 BaseGameMode gameMode =
GetGame().GetGameMode();
15 SCR_GameOverScreenManagerComponent gameOverManager = SCR_GameOverScreenManagerComponent.Cast(gameMode.FindComponent(SCR_GameOverScreenManagerComponent));
19 super.ReadVariable(item, manager);
22 if (!delegateFactionManager)
29 SCR_SortedArray<SCR_EditableFactionComponent> factionDelegates =
new SCR_SortedArray<SCR_EditableFactionComponent>;
30 int count = delegateFactionManager.GetSortedFactionDelegates(factionDelegates);
34 int playableFactionsCount = 0;
36 for(
int i = 0; i < count; ++i)
38 scrFaction =
SCR_Faction.Cast(factionDelegates.Get(i).GetFaction());
40 if (!scrFaction || !scrFaction.IsPlayable())
43 playableFactionsCount++;
44 AddOrderedState(
false);
47 if (playableFactionsCount <= 0)
53 override void WriteVariable(Managed item,
SCR_BaseEditorAttributeVar var, SCR_AttributesManagerEditorComponent manager,
int playerID)
55 super.WriteVariable(item, var, manager, playerID);
61 SCR_GameOverScreenManagerComponent gameOverManager = SCR_GameOverScreenManagerComponent.Cast(gamemode.FindComponent(SCR_GameOverScreenManagerComponent));
70 if (!delegateFactionManager)
73 SCR_SortedArray<SCR_EditableFactionComponent> factionDelegates =
new SCR_SortedArray<SCR_EditableFactionComponent>;
74 int count = delegateFactionManager.GetSortedFactionDelegates(factionDelegates);
76 array <int> selectedFactions =
new array<int>;
80 for(
int i = 0; i < count; ++i)
82 scrFaction =
SCR_Faction.Cast(factionDelegates.Get(i).GetFaction());
84 if (!scrFaction || !scrFaction.IsPlayable() || !GetOrderedState())
87 selectedFactions.Insert(factionManager.GetFactionIndex(scrFaction));
90 gameOverManager.SetEditorGameOverFactions(selectedFactions);
93 protected int GetEditorGameOverInfoArray(notnull array <SCR_BaseGameOverScreenInfo> gameOverScreens, notnull out array <SCR_BaseGameOverScreenInfo> editorGameOverScreens)
99 editorOptional = screen.GetEditorOptionalParams();
101 if (!editorOptional || !editorOptional.m_bCanBeSetByGameMaster)
104 editorGameOverScreens.Insert(screen);
107 return editorGameOverScreens.Count();
110 override protected void CreatePresets()
113 if (!delegateFactionManager)
116 FactionManager factionManager =
GetGame().GetFactionManager();
122 SCR_SortedArray<SCR_EditableFactionComponent> factionDelegates =
new SCR_SortedArray<SCR_EditableFactionComponent>;
123 int count = delegateFactionManager.GetSortedFactionDelegates(factionDelegates);
127 for(
int i = 0; i < count; ++i)
129 scrFaction =
SCR_Faction.Cast(factionDelegates.Get(i).GetFaction());
131 if (!scrFaction || !scrFaction.IsPlayable())
135 value.SetWithUIInfo(scrFaction.GetUIInfo(), factionManager.GetFactionIndex(factionDelegates.Get(i).GetFaction()));