Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
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))]
24
25 [Attribute("0", desc: "True will make hint visible across menues. E.g. hint opened in inventory will stay will be reopened in hud once player leave inventory.")]
26 protected bool m_bPersistent;
27
28 [Attribute("0", desc: "Can this hint be set to don't show again?")]
30
31 [Attribute(defvalue: "", uiwidget: UIWidgets.ComboBox, desc: "Factions that should not see this hint", enums: ParamEnumArray.FromEnum(SCR_ECampaignFaction))]
32 protected ref array<SCR_ECampaignFaction> m_aHiddenForFactions;
33
34 protected int m_iSequencePage;
35 protected int m_iSequenceCount;
37
38 //------------------------------------------------------------------------------------------------
42 {
43 if (!m_aHiddenForFactions || m_aHiddenForFactions.Count() == 0)
44 return true;
45
46 SCR_CampaignFaction playerfaction = SCR_CampaignFaction.Cast(SCR_FactionManager.SGetLocalPlayerFaction());
47 if (!playerfaction)
48 return true;
49
50 SCR_GameModeCampaign campaign = SCR_GameModeCampaign.GetInstance();
51 if (!campaign)
52 return true;
53
54 foreach (SCR_ECampaignFaction factionenum : m_aHiddenForFactions)
55 {
56 if (campaign.GetFactionByEnum(factionenum) == playerfaction)
57 return false;
58 }
59
60 return true;
61 }
62
63 //------------------------------------------------------------------------------------------------
68
69 //------------------------------------------------------------------------------------------------
73 {
74 return m_Type;
75 }
76
77 //------------------------------------------------------------------------------------------------
82 {
83 return m_iShowLimit;
84 }
85
86 //------------------------------------------------------------------------------------------------
90 {
91 return m_bIsTimerVisible;
92 }
93
94 //------------------------------------------------------------------------------------------------
95 void SetPriority(int priority)
96 {
97 m_iPriority = priority;
98 }
99
100 //------------------------------------------------------------------------------------------------
104 {
105 return m_iPriority;
106 }
107
108 //------------------------------------------------------------------------------------------------
112 {
113 return m_fDuration;
114 }
115
116 //------------------------------------------------------------------------------------------------
123
124 //------------------------------------------------------------------------------------------------
127 {
128 ChimeraWorld world = GetGame().GetWorld();
129 m_iTimeHintStarted = world.GetServerTimestamp();
130 }
131
132 //------------------------------------------------------------------------------------------------
136 int GetHighlightWidgetNames(out notnull array<string> outWidgetNames)
137 {
139 return outWidgetNames.Copy(m_aHighlightWidgetsNames);
140 else
141 return 0;
142 }
143
144 //------------------------------------------------------------------------------------------------
151
152 //------------------------------------------------------------------------------------------------
156 void InitSequence(int page, int count)
157 {
158 m_iSequencePage = page;
159 m_iSequenceCount = count;
160 }
161
162 //------------------------------------------------------------------------------------------------
165 {
166 return m_iSequencePage;
167 }
168
169 //------------------------------------------------------------------------------------------------
172 {
173 return m_iSequenceCount;
174 }
175
176 //------------------------------------------------------------------------------------------------
179 {
180 return m_iSequenceCount != 0;
181 }
182
183 //------------------------------------------------------------------------------------------------
185 {
186 return m_bPersistent;
187 }
188
189 //------------------------------------------------------------------------------------------------
190 void SetPersistent(bool persistent)
191 {
192 m_bPersistent = persistent;
193 }
194
195 //------------------------------------------------------------------------------------------------
204 static SCR_HintUIInfo CreateInfo(string description, string name, float duration, EHint type, EFieldManualEntryId fieldManualEntry, bool isTimerVisible)
205 {
206 SCR_HintUIInfo info = new SCR_HintUIInfo();
207 info.Name = name;
208 info.Description = description;
209 info.m_fDuration = duration;
210 info.m_Type = type;
211 info.m_FieldManualLink = fieldManualEntry;
212 info.m_bIsTimerVisible = isTimerVisible;
213 return info;
214 }
215
216 //------------------------------------------------------------------------------------------------
217 override bool SetDescriptionTo(TextWidget textWidget)
218 {
219 if (!textWidget)
220 return false;
221
222 Color sRGBA = Color.FromInt(UIColors.CONTRAST_COLOR.PackToInt());
223
225 textWidget.SetTextFormat(GetDescription(), string.Format("color rgba=%1", UIColors.FormatColor(sRGBA)), "/color"); //--- ToDo: Don't hardcode
226 else
227 textWidget.SetText(GetDescription());
228 return true;
229 }
230}
EFieldManualEntryId
used to grab the first id-matching Field Manual entry
EHint
Definition EHint.c:11
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
EDamageType type
void SCR_FactionManager(IEntitySource src, IEntity parent)
void SCR_GameModeCampaign(IEntitySource src, IEntity parent)
SCR_PlayerCommandingConfigActionPair Managed SCR_BaseContainerLocalizedTitleField("m_sCommandName")
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Color.c:13
override LocalizedString GetDescription()
void InitSequence(int page, int count)
EFieldManualEntryId m_FieldManualLink
ref array< string > m_aHighlightWidgetsNames
bool ShouldFactionSeeHint()
override bool SetDescriptionTo(TextWidget textWidget)
bool GetIsDontShowAgainVisible()
void SetTimeStamp()
Set the time stamp of Hint start. Needed for hint timer timekeeping.
static SCR_HintUIInfo CreateInfo(string description, string name, float duration, EHint type, EFieldManualEntryId fieldManualEntry, bool isTimerVisible)
EFieldManualEntryId GetFieldManualLink()
void SetPersistent(bool persistent)
WorldTimestamp GetTimeStarted()
WorldTimestamp m_iTimeHintStarted
void SetPriority(int priority)
int GetHighlightWidgetNames(out notnull array< string > outWidgetNames)
ref array< SCR_ECampaignFaction > m_aHiddenForFactions
bool m_bIsDontShowAgainVisible
SCR_FieldOfViewSettings Attribute