Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_TaskNotificationConfigs.c
Go to the documentation of this file.
1[BaseContainerProps(configRoot: true)]
3{
4 [Attribute(desc:"Root config data list with notification settings")]
5 ref array<ref SCR_TaskNotificationConfig> m_aTaskNotificationList;
6}
8[BaseContainerProps(), SCR_BaseContainerCustomTitleEnum(SCR_ETaskNotification, "m_eTaskNotification", "Notification: %1")]
9class SCR_TaskNotificationConfig
11 [Attribute(desc:"Task notification type", uiwidget: UIWidgets.ComboBox, enumType: SCR_ETaskNotification)]
12 SCR_ETaskNotification m_eTaskNotification;
13
14 [Attribute(desc:"Task name", uiwidget: UIWidgets.LocaleEditBox)]
15 LocalizedString m_sTaskName;
16
17 [Attribute(desc:"If checked, notifications will be shown only after the interval; before the interval, they will be ignored.")]
18 bool m_bAllowedNotificationInterval;
20 [Attribute(desc:"Notification interval", params:"0 inf")]
21 float m_fNotificationInterval;
22
23 [Attribute(desc:"Data list with notification settings")]
24 ref array<ref SCR_BaseTaskNotificationData> m_aTaskNotificationDataList;
25}
26
29{
30 [Attribute(desc:"Task notification msg type", uiwidget: UIWidgets.ComboBox, enumType: SCR_ETaskNotificationMsg)]
31 SCR_ETaskNotificationMsg m_eTaskNotificationMsg;
32
33 [Attribute("-1", desc:"Allowed roles for which notifications are sent", uiwidget: UIWidgets.Flags, enumType: SCR_ETaskNotificationAllowedRole)]
35
36 [Attribute(desc: "Skip sending message to the commander frequency")]
38
39 [Attribute(desc: "If checked, notifications within the defined distance from the task will be send, the rest will be ignored.")]
40 protected bool m_bAllowedDistance;
41
42 [Attribute(desc: "Distance[m] from task", params: "0 inf")]
43 protected float m_fDistance;
44
45 //------------------------------------------------------------------------------------------------
49 bool CanSendNotification(notnull SCR_AIGroup receiverGroup)
50 {
51 if (m_bSkipCommandFrequency && receiverGroup.GetGroupRole() == SCR_EGroupRole.COMMANDER)
52 return false;
53
54 return true;
55 }
56
57 //------------------------------------------------------------------------------------------------
63 bool CanSendToPlayer(notnull SCR_Faction faction, int playerId, vector taskPosition)
64 {
65 if (faction.IsPlayerCommander(playerId))
66 {
68 return false;
69 }
70 else
71 {
72 SCR_PlayerControllerGroupComponent groupController = SCR_PlayerControllerGroupComponent.GetPlayerControllerComponent(playerId);
73 if (groupController)
74 {
75 bool isPlayerSquadLeader = groupController.IsPlayerLeaderOwnGroup();
76 if (isPlayerSquadLeader && !SCR_Enum.HasFlag(m_eAllowedCharacterRole, SCR_ETaskNotificationAllowedRole.SQUAD_LEADER))
77 return false;
78
79 if (!isPlayerSquadLeader && !SCR_Enum.HasFlag(m_eAllowedCharacterRole, SCR_ETaskNotificationAllowedRole.SQUAD_MEMBER))
80 return false;
81 }
82 }
83
85 {
86 // distance check - player and task
87 SCR_PlayerController playerController = SCR_PlayerController.Cast(GetGame().GetPlayerManager().GetPlayerController(playerId));
88 if (!playerController)
89 return false;
90
91 IEntity player = playerController.GetMainEntity();
92 if (!player || vector.DistanceSqXZ(player.GetOrigin(), taskPosition) > m_fDistance * m_fDistance)
93 return false;
94 }
95
96 return true;
97 }
98}
99
101class SCR_MajorTaskNotificationData : SCR_BaseTaskNotificationData
102{
103 [Attribute(desc:"Notification text", uiwidget: UIWidgets.LocaleEditBox)]
105
106 [Attribute(desc:"Sound event name for voiceover or other sound")]
107 string m_sSoundEventName;
108
109 //------------------------------------------------------------------------------------------------
111 string GetCreationText()
112 {
113 return m_sText;
114 }
115}
116
118class SCR_MajorBaseTaskNotificationData : SCR_MajorTaskNotificationData
119{
120 //------------------------------------------------------------------------------------------------
124 string GetCreationText(notnull Faction faction, notnull SCR_CampaignMilitaryBaseComponent base)
125 {
126 return WidgetManager.Translate(m_sText, base.GetFormattedBaseNameWithCallsign(faction));
127 }
128}
129
131class SCR_MajorRequestedTaskNotificationData : SCR_MajorTaskNotificationData
132{
133 //------------------------------------------------------------------------------------------------
136 string GetCreationText(int groupId)
137 {
138 SCR_GroupsManagerComponent groupsManager = SCR_GroupsManagerComponent.GetInstance();
139 if (!groupsManager)
140 return string.Empty;
141
142 SCR_AIGroup aiGroup = groupsManager.FindGroup(groupId);
143 if (!aiGroup)
144 return string.Empty;
145
147 }
148}
149
152{
153 [Attribute(ENotification.GROUP_TASK_GROUP_ASSIGNED_TO_SAME_TASK.ToString(), desc:"Minor notification type", uiwidget: UIWidgets.ComboBox, enumType: ENotification)]
154 ENotification m_eNotification;
155
156 [Attribute(desc:"Text required by some minor notifications", uiwidget: UIWidgets.LocaleEditBox)]
157 LocalizedString m_sText;
158}
159
161class SCR_MinorRequestedTaskNotificationData : SCR_MinorTaskNotificationData
162{
163 //------------------------------------------------------------------------------------------------
166 string GetCreationText(int groupId)
167 {
168 SCR_GroupsManagerComponent groupsManager = SCR_GroupsManagerComponent.GetInstance();
169 if (!groupsManager)
170 return string.Empty;
171
172 SCR_AIGroup aiGroup = groupsManager.FindGroup(groupId);
173 if (!aiGroup)
174 return string.Empty;
175
177 }
178}
ENotification
ArmaReforgerScripted GetGame()
Definition game.c:1398
float m_fDistance
string m_sSoundEventName
Sound event name.
SCR_EGroupRole
Group roles.
SCR_ETaskNotification
Objective and request notifications types.
SCR_ETaskNotificationAllowedRole
Allowed roles for which notifications are shown or sent.
SCR_ETaskNotificationMsg
Various types of task notifications for different events and states.
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
class SCR_TaskNotificationsRootConfig SCR_BaseContainerCustomTitleEnum(SCR_ETaskNotification, "m_eTaskNotification", "Notification: %1")
ref array< ref SCR_TaskNotificationConfig > m_aTaskNotificationList
string GetCreationText(notnull Faction faction, notnull SCR_CampaignMilitaryBaseComponent base)
class SCR_TaskNotificationsRootConfig BaseContainerProps()
LocalizedString m_sText
proto external vector GetOrigin()
bool CanSendToPlayer(notnull SCR_Faction faction, int playerId, vector taskPosition)
bool CanSendNotification(notnull SCR_AIGroup receiverGroup)
SCR_ETaskNotificationAllowedRole m_eAllowedCharacterRole
static string GetTranslatedGroupName(notnull SCR_AIGroup group)
SCR_FieldOfViewSettings Attribute
proto external PlayerController GetPlayerController()
string m_sText
Definition EnWidgets.c:82