9 [
Attribute(
SCR_Enum.GetDefault(ETaskTextType.NONE), UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(ETaskTextType))]
10 protected ETaskTextType m_TextType;
13 protected int m_iTextIndex;
33 string GetLocationName()
41 ETaskTextType GetTextType()
57 void SetTextIndex(
int index)
67 return m_iTaskCompletionType;
75 if (m_iTaskCompletionType == newTaskCompletionType)
78 m_iTaskCompletionType = newTaskCompletionType;
86 SCR_TextsTaskManagerComponent textsComponent = SCR_TextsTaskManagerComponent.GetInstance();
92 override string GetTitle()
96 return info.GetName();
100 override void SetTitleWidgetText(notnull TextWidget textWidget,
string taskText)
108 override void SetDescriptionWidgetText(notnull TextWidget textWidget,
string taskText)
114 textWidget.SetTextFormat(taskText);
117 protected void PopUpNotification(
string prefix,
bool alwaysInEditor)
123 playerFaction = factionManager.GetLocalPlayerFaction();
129 if (IsAssignedToLocalPlayer() || playerFaction == GetTargetFaction() || (alwaysInEditor && !
SCR_EditorManagerEntity.IsLimitedInstance()))
135 override protected void ShowPopUpNotification(
string subtitle)
144 void ShowTaskNotification(
ENotification taskNotification,
bool SendOverNetwork =
false)
150 int taskID = Replication.FindId(editableTask);
152 Faction faction = GetTargetFaction();
156 FactionManager factionManager =
GetGame().GetFactionManager();
163 int factionIndex = factionManager.GetFactionIndex(faction);
166 if (!SendOverNetwork)
169 GetGame().GetCallqueue().CallLater(DelayedPlacedNotification, 1,
false,
position, taskID, factionIndex);
171 SCR_NotificationsComponent.SendLocalUnlimitedEditor(taskNotification,
position, taskID, factionIndex);
175 SCR_NotificationsComponent.SendToUnlimitedEditorPlayers(taskNotification,
position, taskID, factionIndex);
182 RplComponent rplComponent = RplComponent.Cast(FindComponent(RplComponent));
183 if ((!rplComponent || rplComponent.Role() == RplRole.Authority) && (newState ==
SCR_TaskState.FINISHED || newState ==
SCR_TaskState.CANCELLED))
190 protected void DelayedPlacedNotification(vector
position,
int taskID,
int factionIndex)
192 SCR_NotificationsComponent.SendLocalUnlimitedEditor(
ENotification.EDITOR_TASK_PLACED,
position, taskID, factionIndex);
196 override void Create(
bool showMsg =
true)
198 super.Create(showMsg);
201 PopUpNotification(TASK_AVAILABLE_TEXT,
false);
205 override void Finish(
bool showMsg =
true)
207 super.Finish(showMsg);
210 PopUpNotification(TASK_COMPLETED_TEXT,
true);
215 override void Fail(
bool showMsg =
true)
220 PopUpNotification(TASK_FAILED_TEXT,
true);
225 override void Cancel(
bool showMsg =
true)
227 super.Cancel(showMsg);
230 PopUpNotification(TASK_CANCELLED_TEXT,
true);
236 protected override bool RplLoad(ScriptBitReader reader)
243 protected override bool RplSave(ScriptBitWriter writer)