3 protected static const string NO_SIGNAL =
"#AR-CampaignTasks_RequestImpossibleSignal-UC";
5 protected SCR_EUIRequestType m_eRequestType;
15 static bool IsInRange(
Faction requesterFaction, IEntity requesterEntity)
17 return SCR_GameModeCampaign.GetInstance().GetBaseManager().IsEntityInFactionRadioSignal(requesterEntity, requesterFaction);
24 static bool HasSignal(notnull PlayerController playerController)
31 IEntity controlledEntity;
32 if (scriptedPlayerController)
33 controlledEntity = scriptedPlayerController.GetMainEntity();
35 controlledEntity = playerController.GetControlledEntity();
37 if (!controlledEntity)
40 FactionAffiliationComponent factionAffiliationComponent = FactionAffiliationComponent.Cast(controlledEntity.FindComponent(FactionAffiliationComponent));
41 if (!factionAffiliationComponent)
44 Faction requesterFaction = factionAffiliationComponent.GetAffiliatedFaction();
45 if (!requesterFaction)
48 if (!IsInRange(requesterFaction, controlledEntity))
62 static void RequestReinforcements(notnull PlayerController playerController)
65 if (!taskNetworkComponent)
68 if (!HasSignal(playerController))
71 taskNetworkComponent.RequestReinforcements();
76 void SetRequestType(SCR_EUIRequestType
type)
78 m_eRequestType =
type;
82 override bool OnClick(Widget w,
int x,
int y,
int button)
85 PlayerController playerController =
GetGame().GetPlayerController();
86 if (!playerController)
89 switch (m_eRequestType)
91 case SCR_EUIRequestType.EVAC:
94 case SCR_EUIRequestType.REFUEL:
97 case SCR_EUIRequestType.REINFORCEMENTS:
98 RequestReinforcements(playerController);
101 case SCR_EUIRequestType.TRANSPORT:
109 enum SCR_EUIRequestType