Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_JournalConfig.c
Go to the documentation of this file.
2 {
9 };
10 
11 [BaseContainerProps(configRoot: true)]
13 {
14  [Attribute(defvalue: "-1", desc: "Which entry should be shown when the journal is opened (0 to number of entries)", params: "-1 inf")]
15  protected int m_iJournalEntryToShowOnStart;
16 
17  [Attribute("")]
18  protected ref array<ref SCR_JournalConfig> m_aJournals;
19 
20  SCR_JournalConfig GetJournalConfig(FactionKey factionKey = FactionKey.Empty)
21  {
22  SCR_JournalConfig empty;
23 
24  foreach (SCR_JournalConfig config : m_aJournals)
25  {
26  if (config.GetFactionKey() == FactionKey.Empty)
27  empty = config;
28 
29  if (config.GetFactionKey() == factionKey)
30  return config;
31  }
32 
33  return empty;
34  }
35 
36  //------------------------------------------------------------------------------------------------
38  int GetJournalEntryToBeShown()
39  {
40  return m_iJournalEntryToShowOnStart;
41  }
42 };
43 
44 [BaseContainerProps(configRoot: true)]
46 {
47  [Attribute("")]
48  FactionKey m_FactionKey;
49 
50  [Attribute("")]
51  protected ref array<ref SCR_JournalEntry> m_aEntries;
52 
53  array<ref SCR_JournalEntry> GetEntries()
54  {
55  return m_aEntries;
56  }
57 
58  FactionKey GetFactionKey()
59  {
60  return m_FactionKey;
61  }
62 };
63 
66 {
67  [Attribute(defvalue: "-1", params: "-1 inf")]
68  protected int m_iEntryID;
69 
70  [Attribute("0", uiwidget: UIWidgets.ComboBox, enums: ParamEnumArray.FromEnum(SCR_EJournalEntryType))]
71  protected SCR_EJournalEntryType m_eJournalEntryType;
72 
73  [Attribute("{1AB2FA99C5CD3919}UI/layouts/Menus/DeployMenu/JournalButton.layout")]
74  protected ResourceName m_sEntryButtonLayout;
75 
76  [Attribute("Custom", desc: "Custom name when using SCR_EJournalEntryType.Custom")]
77  protected string m_sCustomEntryName;
78 
79  [Attribute("")]
80  protected string m_sEntryText;
81 
82  [Attribute("0")]
83  protected bool m_bUseCustomLayout;
84 
85  [Attribute("")]
86  protected ResourceName m_sEntryLayoutCustom;
87 
88  protected ResourceName m_sEntryLayoutDefault = "{9BA70BE88082F251}UI/layouts/Menus/DeployMenu/JournalEntryDefault.layout";
89 
90  protected string m_sEntryTextParam1;
91  protected Widget m_Widget;
92 
93  //------------------------------------------------------------------------------------------------
94  int GetEntryID()
95  {
96  return m_iEntryID;
97  }
98 
99  //------------------------------------------------------------------------------------------------
100  string GetEntryName()
101  {
102  switch (m_eJournalEntryType)
103  {
104  case SCR_EJournalEntryType.Situation:
105  {
106  return "#AR-RespawnMap_FRAGO_SituationTitle";
107  }
108 
109  case SCR_EJournalEntryType.Mission:
110  {
111  return "#AR-RespawnMap_FRAGO_MissionTitle";
112  }
113 
114  case SCR_EJournalEntryType.Execution:
115  {
116  return "#AR-RespawnMap_FRAGO_ExecutionTitle";
117  }
118 
119  case SCR_EJournalEntryType.Signal:
120  {
121  return "#AR-RespawnMap_FRAGO_SignalTitle";
122  }
123 
124  case SCR_EJournalEntryType.Intel:
125  {
126  return "#AR-RespawnMap_FRAGO_IntelTitle";
127  }
128 
129  case SCR_EJournalEntryType.Custom:
130  {
131  return m_sCustomEntryName;
132  }
133  }
134 
135  return string.Empty;
136  }
137 
138  //------------------------------------------------------------------------------------------------
139  string GetCustomEntryName()
140  {
141  return m_sCustomEntryName;
142  }
143 
144  //------------------------------------------------------------------------------------------------
145  void SetEntryText(string text)
146  {
147  m_sEntryText = text;
148  }
149 
150  //------------------------------------------------------------------------------------------------
151  string GetEntryText()
152  {
153  return m_sEntryText;
154  }
155 
156  //------------------------------------------------------------------------------------------------
157  string GetEntryTextWithParam1()
158  {
159  return string.Format(m_sEntryText, m_sEntryTextParam1);
160  }
161 
162  //------------------------------------------------------------------------------------------------
163  void SetEntryTextParam1(string text)
164  {
165  m_sEntryTextParam1 = text;
166  }
167 
168  //------------------------------------------------------------------------------------------------
169  string GetEntryTextParam1()
170  {
171  return m_sEntryTextParam1;
172  }
173 
174  //------------------------------------------------------------------------------------------------
175  Widget GetWidget()
176  {
177  return m_Widget;
178  }
179 
180  //------------------------------------------------------------------------------------------------
181  Widget SetEntryLayoutTo(out notnull Widget target)
182  {
183  if (m_bUseCustomLayout)
184  {
185  if (!m_Widget)
186  m_Widget = GetGame().GetWorkspace().CreateWidgets(m_sEntryLayoutCustom, target);
187 
188  TextWidget text = TextWidget.Cast(m_Widget.FindAnyWidget("Text"));
189  if (text)
190  text.SetTextFormat(m_sEntryText, m_sEntryTextParam1);
191  }
192  else
193  {
194  if (!m_Widget)
195  m_Widget = GetGame().GetWorkspace().CreateWidgets(m_sEntryLayoutDefault, target);
196 
197  TextWidget text = TextWidget.Cast(m_Widget.FindAnyWidget("Text"));
198  if (text)
199  text.SetTextFormat(m_sEntryText, m_sEntryTextParam1);
200  }
201 
202  return m_Widget;
203  }
204 
205  //------------------------------------------------------------------------------------------------
206  ResourceName GetEntryButtonLayout()
207  {
208  return m_sEntryButtonLayout;
209  }
210 
211 };
SCR_JournalSetupConfig
Definition: SCR_JournalConfig.c:12
Situation
@ Situation
Definition: SCR_JournalConfig.c:3
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
Intel
@ Intel
Definition: SCR_JournalConfig.c:7
Signal
@ Signal
Definition: SCR_JournalConfig.c:6
SCR_JournalConfig
Definition: SCR_JournalConfig.c:45
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Execution
@ Execution
Definition: SCR_JournalConfig.c:5
m_aEntries
protected ref array< ref SCR_TextsTaskManagerEntry > m_aEntries
Definition: SCR_TextsTaskManagerComponent.c:3
Attribute
typedef Attribute
Post-process effect of scripted camera.
Custom
@ Custom
Definition: SCR_JournalConfig.c:8
Mission
@ Mission
Definition: SCR_JournalConfig.c:4
SCR_JournalEntry
Definition: SCR_JournalConfig.c:65
m_FactionKey
protected FactionKey m_FactionKey
Definition: SCR_BaseDeployableSpawnPointComponent.c:20
params
Configs ServerBrowser KickDialogs params
Definition: SCR_NotificationSenderComponent.c:24
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
SCR_EJournalEntryType
SCR_EJournalEntryType
Definition: SCR_JournalConfig.c:1