5 override bool CanBeShown(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags)
8 int selectedEntitiesCount = 0;
11 selectedEntitiesCount = selectedEntities.Count();
14 if (!hoveredEntity && selectedEntitiesCount == 0)
19 owner = hoveredEntity.GetOwner();
24 for (
int i = 0; i < selectedEntitiesCount; i++)
26 owner = selectedEntities[i].GetOwner();
34 override bool CanBePerformed(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags)
39 override void Perform(
SCR_EditableEntityComponent hoveredEntity, notnull set<SCR_EditableEntityComponent> selectedEntities, vector cursorWorldPosition,
int flags,
int param = -1)
41 FactionManager factionManager =
GetGame().GetFactionManager();
45 array<Faction> factions =
new array<Faction>();
46 array<int> factionIDs =
new array<int>();
47 factionManager.GetFactionsList(factions);
52 int factionsCount = factions.Count();
54 if (factionsCount == 0)
59 factionIDs.Insert(factionManager.GetFactionIndex(f));
61 int factionIDsCount = factionIDs.Count();
63 if (factionIDsCount == 0)
67 PerformOn(hoveredEntity, factionIDs, factionIDsCount);
69 if (!selectedEntities)
72 int selectedEntitiesCount = selectedEntities.Count();
73 for (
int i = 0; i < selectedEntitiesCount; i++)
75 if (selectedEntities[i] == hoveredEntity)
78 PerformOn(selectedEntities[i], factionIDs, factionIDsCount);
85 FactionManager factionManager =
GetGame().GetFactionManager();
90 int index = factionIDs.Find(factionManager.GetFactionIndex(base.GetFaction())) + 1;
92 if (
index >= factionIDsCount)
95 PlayerController pc =
GetGame().GetPlayerController();
100 SCR_CampaignNetworkComponent campaignNetworkComponent = SCR_CampaignNetworkComponent.Cast(pc.FindComponent(SCR_CampaignNetworkComponent));
102 if (!campaignNetworkComponent)
105 campaignNetworkComponent.CaptureBaseGM(base, factionIDs[
index]);