Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_NotificationAproxNumber.c
Go to the documentation of this file.
1 
8 {
9  [Attribute(desc: "List of all aprox text that will show a specific text. It will check if the value is between the given min and max and if non valid are found will always use the last entry")]
10  protected ref array<ref SCR_NotificationAproxDisplayContainer> m_aApproxDisplayContainers;
11 
12  //------------------------------------------------------------------------------------------------
13  override string GetText(SCR_NotificationData data)
14  {
15  if (m_aApproxDisplayContainers.IsEmpty())
16  {
17  Debug.Error2("SCR_NotificationAproxNumber", string.Format("Trying to display notification '%1' but no 'm_aApproxDisplayContainers' are assigned!", typename.EnumToString(ENotification, m_NotificationKey)));
18  return string.Empty;
19  }
20 
21  int param1, param2, param3, param4, param5, param6;
22  data.GetParams(param1, param2, param3, param4, param5, param6);
23 
24  //~ Check if the first param is already filled in. This means this is a player name from SCR_NotificationPlayerAndAproxNumber
25  LocalizedString display1;
26  data.GetNotificationTextEntries(display1);
27 
28  if (SCR_StringHelper.IsEmptyOrWhiteSpace(display1))
29  display1 = GetAproxText(param1);
30 
31  LocalizedString display2 = GetAproxText(param2);
32  LocalizedString display3 = GetAproxText(param3);
33  LocalizedString display4 = GetAproxText(param4);
34  LocalizedString display5 = GetAproxText(param5);
35  LocalizedString display6 = GetAproxText(param6);
36 
37  data.SetNotificationTextEntries(display1, display2, display3, display4, display5, display6);
38  return super.GetText(data);
39  }
40 
41  //------------------------------------------------------------------------------------------------
42  protected LocalizedString GetAproxText(float value)
43  {
44  for (int i = 0; i < m_aApproxDisplayContainers.Count(); i++)
45  {
46  if (value >= m_aApproxDisplayContainers[i].m_fMin && value < m_aApproxDisplayContainers[i].m_fMax)
47  return m_aApproxDisplayContainers[i].m_sDisplayText;
48  }
49 
50  //~ Non was chosen so grab last in array
51  return m_aApproxDisplayContainers[m_aApproxDisplayContainers.Count() -1].m_sDisplayText;
52  }
53 };
54 
57 {
58  [Attribute(desc: "Text shown in the notification at the param location", uiwidget: UIWidgets.LocaleEditBox)]
59  LocalizedString m_sDisplayText;
60 
61  [Attribute(desc: "(inclusive) if nr is greater or equal than this and less than max",)]
62  float m_fMin;
63 
64  [Attribute(desc: "(inclusive) if nr is smaller than this and greater or equal than min",)]
65  float m_fMax;
66 };
SCR_NotificationDisplayData
Definition: SCR_NotificationDisplayData.c:7
SCR_BaseContainerCustomTitleEnum
class SCR_CampaignHintStorage SCR_BaseContainerCustomTitleEnum(EHint, "m_eHintId")
Definition: SCR_CampaignHintStorage.c:22
SCR_BaseContainerLocalizedTitleField
SCR_TabViewComponent SCR_ScriptedWidgetComponent SCR_BaseContainerLocalizedTitleField("m_sTabButtonContent")
Definition: SCR_TabViewComponent.c:963
SCR_StringHelper
Definition: SCR_StringHelper.c:1
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
m_fMax
protected float m_fMax
Definition: SCR_BaseEditorAttribute.c:520
ENotification
ENotification
Definition: ENotification.c:4
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_NotificationData
Definition: SCR_NotificationData.c:6
SCR_NotificationAproxNumber
Definition: SCR_NotificationAproxNumber.c:7
data
Get all prefabs that have the spawner data
Definition: SCR_EntityCatalogManagerComponent.c:305
SCR_NotificationAproxDisplayContainer
Definition: SCR_NotificationAproxNumber.c:56
LocalizedString
Definition: LocalizedString.c:21
BaseContainerProps
SCR_AIGoalReaction_Follow BaseContainerProps
Handles insects that are supposed to be spawned around selected prefabs defined in prefab names array...
Definition: SCR_AIGoalReaction.c:468
m_fMin
SCR_BaseEditorAttributeEntryUIInfo m_fMin