Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_HintUIInfo.c
Go to the documentation of this file.
3 {
4  [Attribute(SCR_Enum.GetDefault(EHint.UNDEFINED), UIWidgets.SearchComboBox, "When defined, the hint can be shown only certain amount of times (defined by Show Limit attribute).\nAfter that, calls to show the hint will be ignored.", enums: ParamEnumArray.FromEnum(EHint))]
5  protected EHint m_Type;
6 
7  [Attribute("1", desc: "How many times can the hint be shown. Valid only if Type is defined!")]
8  protected int m_iShowLimit;
9 
10  [Attribute()]
11  protected int m_iPriority;
12 
13  [Attribute("0", desc: "For how long should the hint be shown.\nWhen 0, default duration from hint manager will be used.\nWhen -1, the hint will be shown until cleared manually.")]
14  protected float m_fDuration;
15 
16  [Attribute(desc: "Widgets to be highlighted when this hint is displayed")]
17  protected ref array<string> m_aHighlightWidgetsNames;
18 
19  [Attribute("0", desc: "Should the hint duration be animated.\nWhen false, the duration will not be visualised.")]
20  protected bool m_bIsTimerVisible;
21 
22  [Attribute(SCR_Enum.GetDefault(EFieldManualEntryId.NONE), UIWidgets.SearchComboBox, enums: ParamEnumArray.FromEnum(EFieldManualEntryId))]
23  protected EFieldManualEntryId m_FieldManualLink;
24 
25  protected int m_iSequencePage;
26  protected int m_iSequenceCount;
27  protected WorldTimestamp m_iTimeHintStarted;
28 
29  //------------------------------------------------------------------------------------------------
32  EHint GetType()
33  {
34  return m_Type;
35  }
36 
37  //------------------------------------------------------------------------------------------------
41  int GetShowLimit()
42  {
43  return m_iShowLimit;
44  }
45 
46  //------------------------------------------------------------------------------------------------
49  bool IsTimerVisible()
50  {
51  return m_bIsTimerVisible;
52  }
53 
54  //------------------------------------------------------------------------------------------------
57  int GetPriority()
58  {
59  return m_iPriority;
60  }
61 
62  //------------------------------------------------------------------------------------------------
65  float GetDuration()
66  {
67  return m_fDuration;
68  }
69 
70  //------------------------------------------------------------------------------------------------
73  WorldTimestamp GetTimeStarted()
74  {
75  return m_iTimeHintStarted;
76  }
77 
78  //------------------------------------------------------------------------------------------------
80  void SetTimeStamp()
81  {
82  ChimeraWorld world = GetGame().GetWorld();
83  m_iTimeHintStarted = world.GetServerTimestamp();
84  }
85 
86  //------------------------------------------------------------------------------------------------
90  int GetHighlightWidgetNames(out notnull array<string> outWidgetNames)
91  {
92  if (m_aHighlightWidgetsNames)
93  return outWidgetNames.Copy(m_aHighlightWidgetsNames);
94  else
95  return 0;
96  }
97 
98  //------------------------------------------------------------------------------------------------
101  EFieldManualEntryId GetFieldManualLink()
102  {
103  return m_FieldManualLink;
104  }
105 
106  //------------------------------------------------------------------------------------------------
110  void InitSequence(int page, int count)
111  {
112  m_iSequencePage = page;
113  m_iSequenceCount = count;
114  }
115 
116  //------------------------------------------------------------------------------------------------
118  int GetSequencePage()
119  {
120  return m_iSequencePage;
121  }
122 
123  //------------------------------------------------------------------------------------------------
125  int GetSequenceCount()
126  {
127  return m_iSequenceCount;
128  }
129 
130  //------------------------------------------------------------------------------------------------
132  bool IsInSequence()
133  {
134  return m_iSequenceCount != 0;
135  }
136 
137  //------------------------------------------------------------------------------------------------
146  static SCR_HintUIInfo CreateInfo(string description, string name, float duration, EHint type, EFieldManualEntryId fieldManualEntry, bool isTimerVisible)
147  {
148  SCR_HintUIInfo info = new SCR_HintUIInfo();
149  info.Name = name;
150  info.Description = description;
151  info.m_fDuration = duration;
152  info.m_Type = type;
153  info.m_FieldManualLink = fieldManualEntry;
154  info.m_bIsTimerVisible = isTimerVisible;
155  return info;
156  }
157 
158  //------------------------------------------------------------------------------------------------
159  override bool SetDescriptionTo(TextWidget textWidget)
160  {
161  if (!textWidget)
162  return false;
163 
164  Color sRGBA = Color.FromInt(UIColors.CONTRAST_COLOR.PackToInt());
165 
166  if (m_aHighlightWidgetsNames && !m_aHighlightWidgetsNames.IsEmpty())
167  textWidget.SetTextFormat(GetDescription(), string.Format("color rgba=%1", UIColors.SRGBAFloatToInt(sRGBA)), "/color"); //--- ToDo: Don't hardcode
168  else
169  textWidget.SetText(GetDescription());
170  return true;
171  }
172 }
ChimeraWorld
Definition: ChimeraWorld.c:12
SCR_Enum
Definition: SCR_Enum.c:1
m_fDuration
float m_fDuration
Definition: SendGoalMessage.c:437
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_BaseContainerLocalizedTitleField
SCR_TabViewComponent SCR_ScriptedWidgetComponent SCR_BaseContainerLocalizedTitleField("m_sTabButtonContent")
Definition: SCR_TabViewComponent.c:963
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
SCR_BlockUIInfo
Definition: SCR_BlockUIInfo.c:2
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_HintUIInfo
Definition: SCR_HintUIInfo.c:2
UIColors
Definition: Constants.c:16
m_Type
protected EEditableEntityType m_Type
Definition: SCR_EntitiesToolbarEditorUIComponent.c:3
type
EDamageType type
Definition: SCR_DestructibleTreeV2.c:32
m_iPriority
int m_iPriority
Definition: SCR_AITalkRequest.c:28
EHint
EHint
Definition: EHint.c:10
EFieldManualEntryId
EFieldManualEntryId
used to grab the first id-matching Field Manual entry
Definition: EFieldManualEntryId.c:2
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