Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_JournalConfig.c
Go to the documentation of this file.
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")]
16
17 [Attribute("")]
18 protected ref array<ref SCR_JournalConfig> m_aJournals;
19
21 {
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 //------------------------------------------------------------------------------------------------
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
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))]
72
73 [Attribute("{3EAF5389D3D89EE5}UI/layouts/Menus/DeployMenu/JournalButton.layout")]
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("")]
87
88 protected ResourceName m_sEntryLayoutDefault = "{2EA47B4CAB62482C}UI/layouts/Menus/DeployMenu/JournalEntryDefault.layout";
89
90 protected string m_sEntryTextParam1;
91 protected Widget m_Widget;
92
93 //------------------------------------------------------------------------------------------------
95 {
96 return m_iEntryID;
97 }
98
99 //------------------------------------------------------------------------------------------------
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 //------------------------------------------------------------------------------------------------
140 {
141 return m_sCustomEntryName;
142 }
143
144 //------------------------------------------------------------------------------------------------
145 void SetEntryText(string text)
146 {
147 m_sEntryText = text;
148 }
149
150 //------------------------------------------------------------------------------------------------
152 {
153 return m_sEntryText;
154 }
155
156 //------------------------------------------------------------------------------------------------
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 //------------------------------------------------------------------------------------------------
170 {
171 return m_sEntryTextParam1;
172 }
173
174 //------------------------------------------------------------------------------------------------
176 {
177 return m_Widget;
178 }
179
180 //------------------------------------------------------------------------------------------------
183 Widget SetEntryLayoutTo(out notnull Widget parent)
184 {
185 if (!m_Widget)
186 {
188 m_Widget = GetGame().GetWorkspace().CreateWidgets(m_sEntryLayoutCustom, parent);
189 else
190 m_Widget = GetGame().GetWorkspace().CreateWidgets(m_sEntryLayoutDefault, parent);
191 }
192
193 TextWidget text = TextWidget.Cast(m_Widget.FindAnyWidget("Text"));
194 if (text)
195 {
196 string hack = WidgetManager.Translate(m_sEntryText, "H4CK_STR");//it seems like any form of translation fails when it needs to replace %X with long already localized string
197
198 hack.Replace("H4CK_STR", m_sEntryTextParam1);//thus more of a manual replacement is required
199 text.SetTextFormat(hack);
200 }
201
202 TextWidget title = TextWidget.Cast(m_Widget.FindAnyWidget("Title"));
203 if (title)
204 title.SetTextFormat(GetEntryName());
205
206 return m_Widget;
207 }
208
209 //------------------------------------------------------------------------------------------------
214}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_EJournalEntryType
@ Mission
@ Intel
@ Execution
@ Situation
@ Signal
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
array< ref SCR_JournalEntry > GetEntries()
ref array< ref SCR_JournalEntry > m_aEntries
FactionKey GetFactionKey()
string GetEntryTextParam1()
ResourceName m_sEntryLayoutCustom
string m_sEntryText
string GetCustomEntryName()
string GetEntryTextWithParam1()
void SetEntryText(string text)
bool m_bUseCustomLayout
int m_iEntryID
ResourceName m_sEntryButtonLayout
void SetEntryTextParam1(string text)
Widget m_Widget
string GetEntryText()
Widget GetWidget()
ResourceName GetEntryButtonLayout()
SCR_EJournalEntryType m_eJournalEntryType
string GetEntryName()
string m_sEntryTextParam1
string m_sCustomEntryName
Widget SetEntryLayoutTo(out notnull Widget parent)
ResourceName m_sEntryLayoutDefault
int GetEntryID()
ref array< ref SCR_JournalConfig > m_aJournals
SCR_JournalConfig GetJournalConfig(FactionKey factionKey=FactionKey.Empty)
SCR_FieldOfViewSettings Attribute
@ Custom
Sent to everybody who fulfills the custom condition.