Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_UIRequestEvacTaskComponent.c
Go to the documentation of this file.
1//class SCR_UIRequestEvacTaskComponent : ScriptedWidgetComponent
2//{
3// protected static const string NO_SIGNAL = "#AR-CampaignTasks_RequestImpossibleSignal-UC";
4//
5// protected SCR_EUIRequestType m_eRequestType;
6//
7// //*********************//
8// //PUBLIC MEMBER METHODS//
9// //*********************//
10//
11// //------------------------------------------------------------------------------------------------
12// //! \param[in] requesterFaction
13// //! \param[in] requesterEntity
14// //! \return
15// static bool IsInRange(Faction requesterFaction, IEntity requesterEntity)
16// {
17// return SCR_GameModeCampaign.GetInstance().GetBaseManager().IsEntityInFactionRadioSignal(requesterEntity, requesterFaction);
18// }
19//
20// //------------------------------------------------------------------------------------------------
21// //!
22// //! \param[in] playerController
23// //! \return
24// static bool HasSignal(notnull PlayerController playerController)
25// {
26// // Replace all this with better solution
27// //--------------------------------------
28// //--------------------------------------
29// SCR_PlayerController scriptedPlayerController = SCR_PlayerController.Cast(playerController);
30//
31// IEntity controlledEntity;
32// if (scriptedPlayerController)
33// controlledEntity = scriptedPlayerController.GetMainEntity();
34// else
35// controlledEntity = playerController.GetControlledEntity();
36//
37// if (!controlledEntity)
38// return false;
39//
40// FactionAffiliationComponent factionAffiliationComponent = FactionAffiliationComponent.Cast(controlledEntity.FindComponent(FactionAffiliationComponent));
41// if (!factionAffiliationComponent)
42// return false;
43//
44// Faction requesterFaction = factionAffiliationComponent.GetAffiliatedFaction();
45// if (!requesterFaction)
46// return false;
47//
48// if (!IsInRange(requesterFaction, controlledEntity))
49// {
50// SCR_PopUpNotification.GetInstance().PopupMsg(NO_SIGNAL);
51// return false;
52// }
53//
54// return true;
55// //--------------------------------------
56// //--------------------------------------
57// }
58//
59// //------------------------------------------------------------------------------------------------
60// //!
61// //! \param[in] playerController
62// static void RequestReinforcements(notnull PlayerController playerController)
63// {
64// SCR_CampaignTaskNetworkComponent taskNetworkComponent = SCR_CampaignTaskNetworkComponent.Cast(playerController.FindComponent(SCR_CampaignTaskNetworkComponent));
65// if (!taskNetworkComponent)
66// return;
67//
68// if (!HasSignal(playerController))
69// return;
70//
71// taskNetworkComponent.RequestReinforcements();
72// }
73//
74// //------------------------------------------------------------------------------------------------
75// //! \param[in] type
76// void SetRequestType(SCR_EUIRequestType type)
77// {
78// m_eRequestType = type;
79// }
80//
81// //------------------------------------------------------------------------------------------------
82// override bool OnClick(Widget w, int x, int y, int button)
83// {
84// // Find local player controller
85// PlayerController playerController = GetGame().GetPlayerController();
86// if (!playerController)
87// return false;
88//
89// switch (m_eRequestType)
90// {
91// case SCR_EUIRequestType.EVAC:
92// break;
93//
94// case SCR_EUIRequestType.REFUEL:
95// break;
96//
97// case SCR_EUIRequestType.REINFORCEMENTS:
98// RequestReinforcements(playerController);
99// break;
100//
101// case SCR_EUIRequestType.TRANSPORT:
102// break;
103// }
104//
105// return false;
106// }
107//}
108//
109//enum SCR_EUIRequestType
110//{
111// EVAC,
112// REFUEL,
113// REINFORCEMENTS,
114// TRANSPORT
115//}