Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_RequestedTask.c
Go to the documentation of this file.
1//[EntityEditorProps(category: "GameScripted/Tasks", description: "A requested task.", color: "0 0 255 255")]
2//class SCR_RequestedTaskClass: SCR_BaseTaskClass
3//{
4//};
5//
8//class SCR_RequestedTask : SCR_BaseTask
9//{
10// [Attribute(SCR_EXPRewards.SUPPORT_EVAC.ToString(), uiwidget: UIWidgets.ComboBox, enums:ParamEnumArray.FromEnum(SCR_EXPRewards))]
11// SCR_EXPRewards m_AssigneeXPReward;
12//
13// int m_iRequesterID = -1;
14// SCR_TaskExecutor m_Requester;
15//
16// static const string TASK_REQUEST_TRANSMITTED_TEXT = "#AR-Tasks_StatusTransmitted-UC";
17// static const string TASK_SUPPORT_CANCELLED_TEXT = "#AR-Tasks_StatusCancelled-UC";
18// protected static const string LOCAL_PLAYER_REQUEST = "#AR-Tasks_TitleRequest";
19//
20// //------------------------------------------------------------------------------------------------
21// protected void ShowAvailableTask(bool afterAssigneeRemoved = false)
22// {
23// SCR_TaskExecutor localExecutor = SCR_TaskExecutor.FromLocalPlayer();
24// if (localExecutor == m_Requester)
25// {
26// if (!afterAssigneeRemoved)
27// SCR_PopUpNotification.GetInstance().PopupMsg(TASK_REQUEST_TRANSMITTED_TEXT + " " + GetTaskName(), prio: SCR_ECampaignPopupPriority.TASK_AVAILABLE);
28// return;
29// }
30//
31// Faction localPlayerFaction;
32// SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
33// if (factionManager)
34// localPlayerFaction = factionManager.GetLocalPlayerFaction();
35//
36// if (GetOwnerFactionKeys().Contains(localPlayerFaction.GetFactionKey()))
37// SCR_PopUpNotification.GetInstance().PopupMsg(SCR_TextsTaskManagerComponent.TASK_AVAILABLE_TEXT + " " + GetTaskName(), prio: SCR_ECampaignPopupPriority.TASK_AVAILABLE, text2: SCR_TextsTaskManagerComponent.TASK_HINT_TEXT, text2param1: SCR_PopUpNotification.TASKS_KEY_IMAGE_FORMAT, sound: SCR_SoundEvent.TASK_CREATED);
38// }
39//
40// //------------------------------------------------------------------------------------------------
41// protected bool IsLocallyRequestedTask()
42// {
43// if (!GetTaskManager())
44// return false;
45//
46// SCR_RequestedTaskSupportEntity supportEntity = SCR_RequestedTaskSupportEntity.Cast(GetTaskManager().FindSupportEntity(SCR_RequestedTaskSupportEntity));
47// if (!supportEntity)
48// return false;
49//
50// return this == supportEntity.GetLocallyRequestedTask();
51// }
52//
53// //------------------------------------------------------------------------------------------------
54// void SetTitleWidgetText(notnull TextWidget textWidget, string taskText)
55// {
56// if (IsLocallyRequestedTask())
57// {
58// textWidget.SetTextFormat(GetTaskManager().m_sLocalRequestTitle);
59// return;
60// }
61// if (m_Requester)
62// textWidget.SetTextFormat(taskText, m_Requester.GetPlayerName());
63// }
64//
65// //------------------------------------------------------------------------------------------------
66// override LocalizedString GetTaskName(out array<LocalizedString> params)
67// {
68// //if (IsLocallyRequestedTask())
69// //return GetTaskManager().m_sLocalRequestTitle;
70//
73//
74// return super.GetTaskName(params);
75// }
76//
77// //------------------------------------------------------------------------------------------------
89//
90// //------------------------------------------------------------------------------------------------
91// void DoNotifyAssignment(int assigneeID)
92// {
97// }
98//
99// //------------------------------------------------------------------------------------------------
100// void DoNotifyUnassign(int assigneeID)
101// {
106// }
107//
108// //------------------------------------------------------------------------------------------------
109// void SetDescriptionWidgetText(notnull TextWidget textWidget, string taskText)
110// {
111// textWidget.SetTextFormat(taskText, GetRequesterName());
112// }
113//
114// //------------------------------------------------------------------------------------------------
115// void RequesterDied()
116// {
117// SCR_TaskSystem taskSystem = SCR_TaskSystem.GetInstance();
118// if (!taskSystem)
119// return;
120//
121// taskSystem.SetTaskState(this, SCR_ETaskState.FAILED);
122// }
123//
124// //------------------------------------------------------------------------------------------------
125// SCR_TaskExecutor GetRequester()
126// {
127// return m_Requester;
128// }
129//
130// //------------------------------------------------------------------------------------------------
131// string GetRequesterName()
132// {
133// return SCR_PlayerNamesFilterCache.GetInstance().GetPlayerDisplayName(m_iRequesterID);
134// }
135//
136// //------------------------------------------------------------------------------------------------
137// void OnEntityDeath(IEntity killedEntity)
138// {
139// if (!m_Requester)
140// return;
141//
142// if (killedEntity == GetGame().GetPlayerManager().GetPlayerControlledEntity(SCR_TaskExecutorPlayer.Cast(m_Requester).GetPlayerID()))
143// SetTaskState(SCR_ETaskState.FAILED); //TODO
144// }
145//
146// //------------------------------------------------------------------------------------------------
147// void SetRequesterID(int requesterID)
148// {
149// m_iRequesterID = requesterID;
150// SetEventMask(EntityEvent.FRAME);
151// }
152//
153// //------------------------------------------------------------------------------------------------
154// bool AutoSetRequester()
155// {
156// if (m_iRequesterID == -1)
157// return false;
158//
159// SCR_TaskExecutor requester = SCR_TaskExecutor.FromPlayerID(m_iRequesterID);
160// if (requester)
161// SetRequester(requester);
162// else
163// return false;
164//
165// return true;
166// }
167//
168// //------------------------------------------------------------------------------------------------
169// void SetRequester(SCR_TaskExecutor requester)
170// {
171// SCR_TaskSystem taskSystem = SCR_TaskSystem.GetInstance();
172// if (!taskSystem)
173// return;
174//
175// if (!requester)
176// return;
177//
178// m_Requester = requester;
179// m_iRequesterID = SCR_TaskExecutorPlayer.Cast(requester).GetPlayerID();
180//
181// IEntity requesterEntity = GetGame().GetPlayerManager().GetPlayerControlledEntity(m_iRequesterID);
182// if (!requesterEntity)
183// return;
184//
185// SCR_CharacterControllerComponent characterControllerComponent = SCR_CharacterControllerComponent.Cast(requesterEntity.FindComponent(SCR_CharacterControllerComponent));
186// if (!characterControllerComponent)
187// return;
188//
189// characterControllerComponent.GetOnPlayerDeath().Insert(RequesterDied);
190//
191// SCR_TaskExecutor localTaskExecutor = SCR_TaskExecutor.FromLocalPlayer();
192// //if (localTaskExecutor.IsClonedBy(requester))
193// //SetLocallyRequestedTask(this);
194//
195// FactionAffiliationComponent factionAffiliationComponent = FactionAffiliationComponent.Cast(requesterEntity.FindComponent(FactionAffiliationComponent));
196// //if (factionAffiliationComponent)
197// //m_TargetFaction = factionAffiliationComponent.GetAffiliatedFaction();
198// }
199//
200// //------------------------------------------------------------------------------------------------
201// override void EOnFrame(IEntity owner, float timeSlice)
202// {
203// if (!m_Requester)
204// AutoSetRequester();
205// }
206//
207// //------------------------------------------------------------------------------------------------
208// override protected bool RplLoad(ScriptBitReader reader)
209// {
210// int requesterID;
211// reader.ReadInt(requesterID);
212// SetRequesterID(requesterID);
213//
214// return super.RplLoad(reader);
215// }
216//
217// //------------------------------------------------------------------------------------------------
218// override protected bool RplSave(ScriptBitWriter writer)
219// {
220// writer.WriteInt(m_iRequesterID);
221//
222// return super.RplSave(writer);
223// }
224//
225// //------------------------------------------------------------------------------------------------
226// override void EOnInit(IEntity owner)
227// {
228// super.EOnInit(owner);
229// }
230//
231// //------------------------------------------------------------------------------------------------
232// void SCR_RequestedTask(IEntitySource src, IEntity parent)
233// {
234// if (SCR_Global.IsEditMode(this))
235// return;
236//
237// SetEventMask(EntityEvent.FRAME);
238// }
239//
240// //------------------------------------------------------------------------------------------------
241// void ~SCR_RequestedTask()
242// {
243// }
244//
245//};