Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_TaskNotificationConfigs.c
Go to the documentation of this file.
1
[
BaseContainerProps
(configRoot:
true
)]
2
class
SCR_TaskNotificationsRootConfig
3
{
4
[
Attribute
(
desc
:
"Root config data list with notification settings"
)]
5
ref array<ref SCR_TaskNotificationConfig>
m_aTaskNotificationList
;
6
}
7
8
[
BaseContainerProps
(),
SCR_BaseContainerCustomTitleEnum
(
SCR_ETaskNotification
,
"m_eTaskNotification"
,
"Notification: %1"
)]
9
class
SCR_TaskNotificationConfig
10
{
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;
19
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
27
[
BaseContainerProps
(),
SCR_BaseContainerCustomTitleEnum
(
SCR_ETaskNotificationMsg
,
"m_eTaskNotificationMsg"
)]
28
class
SCR_BaseTaskNotificationData
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
)]
34
protected
SCR_ETaskNotificationAllowedRole
m_eAllowedCharacterRole
;
35
36
[
Attribute
(
desc
:
"Skip sending message to the commander frequency"
)]
37
protected
bool
m_bSkipCommandFrequency
;
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
{
67
if
(!
SCR_Enum
.HasFlag(
m_eAllowedCharacterRole
,
SCR_ETaskNotificationAllowedRole
.COMMANDER))
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
84
if
(
m_bAllowedDistance
)
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
100
[
BaseContainerProps
(),
SCR_BaseContainerCustomTitleEnum
(
SCR_ETaskNotificationMsg
,
"m_eTaskNotificationMsg"
)]
101
class
SCR_MajorTaskNotificationData :
SCR_BaseTaskNotificationData
102
{
103
[
Attribute
(
desc
:
"Notification text"
, uiwidget:
UIWidgets
.LocaleEditBox)]
104
LocalizedString
m_sText
;
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
117
[
BaseContainerProps
(),
SCR_BaseContainerCustomTitleEnum
(
SCR_ETaskNotificationMsg
,
"m_eTaskNotificationMsg"
)]
118
class
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
130
[
BaseContainerProps
(),
SCR_BaseContainerCustomTitleEnum
(
SCR_ETaskNotificationMsg
,
"m_eTaskNotificationMsg"
)]
131
class
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
146
return
WidgetManager
.Translate(
m_sText
,
SCR_GroupHelperUI
.
GetTranslatedGroupName
(aiGroup));
147
}
148
}
149
150
[
BaseContainerProps
(),
SCR_BaseContainerCustomTitleEnum
(
SCR_ETaskNotificationMsg
,
"m_eTaskNotificationMsg"
)]
151
class
SCR_MinorTaskNotificationData
:
SCR_BaseTaskNotificationData
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
160
[
BaseContainerProps
(),
SCR_BaseContainerCustomTitleEnum
(
SCR_ETaskNotificationMsg
,
"m_eTaskNotificationMsg"
)]
161
class
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
176
return
WidgetManager
.Translate(
m_sText
,
SCR_GroupHelperUI
.
GetTranslatedGroupName
(aiGroup));
177
}
178
}
ENotification
ENotification
Definition
ENotification.c:5
GetGame
ArmaReforgerScripted GetGame()
Definition
game.c:1398
m_fDistance
float m_fDistance
Definition
SCR_AIGroupTargetCluster.c:38
m_sSoundEventName
string m_sSoundEventName
Sound event name.
Definition
SCR_AudioSource.c:25
SCR_EGroupRole
SCR_EGroupRole
Group roles.
Definition
SCR_EGroupRole.c:3
SCR_ETaskNotification
SCR_ETaskNotification
Objective and request notifications types.
Definition
SCR_ETaskNotification.c:3
SCR_ETaskNotificationAllowedRole
SCR_ETaskNotificationAllowedRole
Allowed roles for which notifications are shown or sent.
Definition
SCR_ETaskNotificationAllowedRole.c:4
SCR_ETaskNotificationMsg
SCR_ETaskNotificationMsg
Various types of task notifications for different events and states.
Definition
SCR_ETaskNotificationMsg.c:3
SCR_GroupsManagerComponent
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition
SCR_GroupsManagerComponent.c:1747
base
around base
Definition
SCR_HoldCampaignMilitaryBaseTaskEntity.c:9
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition
SCR_RespawnBriefingComponent.c:17
params
category params
Definition
SCR_SpherePointGeneratorPreviewComponent.c:21
SCR_BaseContainerCustomTitleEnum
class SCR_TaskNotificationsRootConfig SCR_BaseContainerCustomTitleEnum(SCR_ETaskNotification, "m_eTaskNotification", "Notification: %1")
Definition
SCR_TaskNotificationConfigs.c:8
m_aTaskNotificationList
ref array< ref SCR_TaskNotificationConfig > m_aTaskNotificationList
Definition
SCR_TaskNotificationConfigs.c:1
GetCreationText
string GetCreationText(notnull Faction faction, notnull SCR_CampaignMilitaryBaseComponent base)
Definition
SCR_TaskNotificationConfigs.c:4
BaseContainerProps
class SCR_TaskNotificationsRootConfig BaseContainerProps()
m_sText
LocalizedString m_sText
Definition
SCR_TaskNotificationConfigs.c:4
Faction
Definition
Faction.c:13
IEntity
Definition
IEntity.c:13
IEntity::GetOrigin
proto external vector GetOrigin()
LocalizedString
Definition
LocalizedString.c:22
SCR_AIGroup
Definition
SCR_AIGroup.c:75
SCR_BaseTaskNotificationData
Definition
SCR_TaskNotificationConfigs.c:29
SCR_BaseTaskNotificationData::CanSendToPlayer
bool CanSendToPlayer(notnull SCR_Faction faction, int playerId, vector taskPosition)
Definition
SCR_TaskNotificationConfigs.c:63
SCR_BaseTaskNotificationData::CanSendNotification
bool CanSendNotification(notnull SCR_AIGroup receiverGroup)
Definition
SCR_TaskNotificationConfigs.c:49
SCR_BaseTaskNotificationData::m_bSkipCommandFrequency
bool m_bSkipCommandFrequency
Definition
SCR_TaskNotificationConfigs.c:37
SCR_BaseTaskNotificationData::params
from params
Definition
SCR_TaskNotificationConfigs.c:43
SCR_BaseTaskNotificationData::m_bAllowedDistance
bool m_bAllowedDistance
Definition
SCR_TaskNotificationConfigs.c:40
SCR_BaseTaskNotificationData::m_eAllowedCharacterRole
SCR_ETaskNotificationAllowedRole m_eAllowedCharacterRole
Definition
SCR_TaskNotificationConfigs.c:34
SCR_CampaignMilitaryBaseComponent
Definition
SCR_CampaignMilitaryBaseComponent.c:38
SCR_Enum
Definition
SCR_Enum.c:2
SCR_Faction
Definition
SCR_Faction.c:6
SCR_GroupHelperUI
Definition
SCR_GroupHelperUI.c:2
SCR_GroupHelperUI::GetTranslatedGroupName
static string GetTranslatedGroupName(notnull SCR_AIGroup group)
Definition
SCR_GroupHelperUI.c:9
SCR_MajorBaseTaskNotificationData
Definition
SCR_TaskNotificationConfigs.c:119
SCR_MinorTaskNotificationData
Definition
SCR_TaskNotificationConfigs.c:152
SCR_PlayerController
Definition
SCR_PlayerController.c:31
SCR_PlayerController::GetMainEntity
IEntity GetMainEntity()
Definition
SCR_PlayerController.c:446
SCR_TaskNotificationsRootConfig
Definition
SCR_TaskNotificationConfigs.c:3
UIWidgets
Definition
attributes.c:40
WidgetManager
Definition
WidgetManager.c:16
vector
Definition
vector.c:13
Attribute
SCR_FieldOfViewSettings Attribute
Definition
SendGoalMessage.c:170
GetPlayerController
proto external PlayerController GetPlayerController()
Definition
SCR_PlayerDeployMenuHandlerComponent.c:307
m_sText
string m_sText
Definition
EnWidgets.c:82
scripts
Game
Tasks
Notifications
SCR_TaskNotificationConfigs.c
Generated by
1.17.0