10 protected float m_fNotificationTimeLeft = -1;
11 protected int m_iPrevPositionUpdated = -1;
12 protected string notificationEntry1, notificationEntry2, notificationEntry3, notificationEntry4, notificationEntry5, notificationEntry6;
13 protected bool m_bIsSplitNotification;
21 protected int m_iParam1;
22 protected int m_iParam2;
23 protected int m_iParam3;
24 protected int m_iParam4;
25 protected int m_iParam5;
26 protected int m_iParam6;
27 protected vector m_vPosition = vector.Zero;
42 m_fNotificationTimeLeft = SCR_NotificationsComponent.NOTIFICATION_DELETE_TIME;
44 m_DisplayData = displayData;
48 if (!m_DisplayData.m_info)
50 Print(
"(" +
typename.EnumToString(
ENotification, GetID()) +
") SCR_NotificationDisplayData has no UIInfo assigned! This will cause errors!", LogLevel.ERROR);
55 m_DisplayData.SetInitialDisplayData(
this);
74 return m_iNotificationReceiverType;
81 float GetNotificationTimeLeft()
83 return m_fNotificationTimeLeft;
91 bool UpdateNotificationData(
float timeSlice)
93 m_fNotificationTimeLeft -= timeSlice;
96 if (m_DisplayData && m_DisplayData.GetNotificationUIInfo().GetEditorSetPositionData() ==
ENotificationSetPositionData.AUTO_SET_AND_UPDATE_POSITION)
98 if (m_iPrevPositionUpdated != (
int)m_fNotificationTimeLeft)
100 m_iPrevPositionUpdated = m_fNotificationTimeLeft;
101 m_DisplayData.SetPosition(
this);
106 return (m_fNotificationTimeLeft <= 0);
117 return m_DisplayData.GetText(
this);
121 Print(
"(" +
typename.EnumToString(
ENotification, GetID()) +
") SCR_NotificationDisplayData has no m_DisplayData assigned!", LogLevel.ERROR);
135 void SetNotificationTextEntries(
string entry1 =
string.Empty,
string entry2 =
string.Empty,
string entry3 =
string.Empty,
string entry4 =
string.Empty,
string entry5 =
string.Empty,
string entry6 =
string.Empty)
137 if (entry1 !=
string.Empty)
138 notificationEntry1 = entry1;
139 if (entry2 !=
string.Empty)
140 notificationEntry2 = entry2;
141 if (entry3 !=
string.Empty)
142 notificationEntry3 = entry3;
143 if (entry4 !=
string.Empty)
144 notificationEntry4 = entry4;
145 if (entry5 !=
string.Empty)
146 notificationEntry5 = entry5;
147 if (entry6 !=
string.Empty)
148 notificationEntry6 = entry6;
160 void GetNotificationTextEntries(out
string entry1 =
string.Empty, out
string entry2 =
string.Empty, out
string entry3 =
string.Empty, out
string entry4 =
string.Empty, out
string entry5 =
string.Empty, out
string entry6 =
string.Empty)
162 entry1 = notificationEntry1;
163 entry2 = notificationEntry2;
164 entry3 = notificationEntry3;
165 entry4 = notificationEntry4;
166 entry5 = notificationEntry5;
167 entry6 = notificationEntry6;
178 m_FactionRelatedColor = factionRelatedColor;
189 m_FactionRelatedTextColor = factionRelatedColor;
201 m_FactionRelatedTextLeftColor = factionRelatedColorLeft;
202 m_FactionRelatedTextRightColor = factionRelatedColorRight;
213 return m_FactionRelatedColor;
224 return m_FactionRelatedTextColor;
236 leftTextColor = m_FactionRelatedTextLeftColor;
237 rightTextColor = m_FactionRelatedTextRightColor;
246 return m_DisplayData;
253 void GetPosition(out vector
position)
268 void GetParams(out
int param1, out
int param2 = 0, out
int param3 = 0, out
int param4 = 0, out
int param5 = 0, out
int param6 = 0)
283 PrintFormat(
"%1\nID: %2\nParams: %3, %4, %5, %6, %7, %8",
this,
typename.EnumToString(
ENotification,
m_iID), m_iParam1, m_iParam2, m_iParam3, m_iParam4, m_iParam5, m_iParam6);
286 static void Encode(SSnapSerializerBase snapshot, ScriptCtx hint, ScriptBitSerializer packet)
288 snapshot.Serialize(packet, 40);
290 static bool Decode(ScriptBitSerializer packet, ScriptCtx hint, SSnapSerializerBase snapshot)
292 return snapshot.Serialize(packet, 40);
294 static bool SnapCompare(SSnapSerializerBase lhs, SSnapSerializerBase rhs, ScriptCtx hint)
296 return lhs.CompareSnapshots(rhs, 40);
298 static bool PropCompare(
SCR_NotificationData prop, SSnapSerializerBase snapshot, ScriptCtx hint)
300 return snapshot.Compare(prop.m_iParam1, 4)
301 && snapshot.Compare(prop.m_iParam2, 4)
302 && snapshot.Compare(prop.m_iParam3, 4)
303 && snapshot.Compare(prop.m_iParam4, 4)
304 && snapshot.Compare(prop.m_iParam5, 4)
305 && snapshot.Compare(prop.m_iParam6, 4)
306 && snapshot.Compare(prop.m_vPosition, 12)
307 && snapshot.Compare(prop.m_iNotificationReceiverType, 4);
311 snapshot.SerializeBytes(prop.m_iParam1, 4);
312 snapshot.SerializeBytes(prop.m_iParam2, 4);
313 snapshot.SerializeBytes(prop.m_iParam3, 4);
314 snapshot.SerializeBytes(prop.m_iParam4, 4);
315 snapshot.SerializeBytes(prop.m_iParam5, 4);
316 snapshot.SerializeBytes(prop.m_iParam6, 4);
317 snapshot.SerializeBytes(prop.m_vPosition, 12);
318 snapshot.SerializeBytes(prop.m_iNotificationReceiverType, 4);
323 snapshot.SerializeBytes(prop.m_iParam1, 4);
324 snapshot.SerializeBytes(prop.m_iParam2, 4);
325 snapshot.SerializeBytes(prop.m_iParam3, 4);
326 snapshot.SerializeBytes(prop.m_iParam4, 4);
327 snapshot.SerializeBytes(prop.m_iParam5, 4);
328 snapshot.SerializeBytes(prop.m_iParam6, 4);
329 snapshot.SerializeBytes(prop.m_vPosition, 12);
330 snapshot.SerializeBytes(prop.m_iNotificationReceiverType, 4);
354 void SetParameters(
ENotificationReceiver receiverType,
int param1 = 0,
int param2 = 0,
int param3 = 0,
int param4 = 0,
int param5 = 0,
int param6 = 0)
356 m_iNotificationReceiverType = receiverType;