9 protected ResourceName m_sJournalConfigPath;
16 [
Attribute(
"{324E923535DCACF8}UI/Textures/DeployMenu/Briefing/conflict_HintBanner_1_UI.edds",
desc:
"background shown when briefing has no hints")]
17 protected ResourceName m_SimpleBriefingBackground;
26 protected ref map<int, ref array<string>>
m_BriefingInfo =
new map<int, ref array<string>>();
29 override bool RplSave(ScriptBitWriter writer)
32 array<string> temporaryInfo = {};
35 temporaryInfo.Copy(info);
37 writer.WriteString(temporaryInfo[0]);
38 writer.WriteInt(entryID);
39 writer.WriteString(temporaryInfo[1]);
42 temporaryInfo.RemoveOrdered(0);
43 temporaryInfo.RemoveOrdered(0);
45 writer.WriteInt(temporaryInfo.Count());
46 foreach (
string briefingStringParam : temporaryInfo)
48 writer.WriteString(briefingStringParam);
56 override bool RplLoad(ScriptBitReader reader)
59 FactionKey factionKey;
65 reader.ReadInt(count);
66 for (
int i = 0; i < count; i++)
69 reader.ReadString(factionKey);
70 reader.ReadInt(entryID);
71 reader.ReadString(newText);
72 reader.ReadInt(paramCount);
73 for (
int j = 0; j < paramCount; j++)
75 reader.ReadString(paramTemp);
76 param1.Insert(paramTemp);
91 void RewriteEntry_SA(FactionKey factionKey,
int entryID,
string newText, array<string> param1)
103 [
RplRpc(RplChannel.Reliable, RplRcver.Broadcast)]
115 void RewriteEntryMain(FactionKey factionKey,
int entryID,
string newText, array<string> param1)
118 array<string> infoStrings = {};
119 infoStrings.Insert(factionKey);
120 infoStrings.Insert(newText);
121 infoStrings.InsertAll(param1);
136 void RewriteEntry(FactionKey factionKey,
int entryID,
string newText, array<string> param1)
138 if (!m_JournalConfig)
141 if (!m_JournalConfig)
148 array<ref SCR_JournalEntry> journalEntries = {};
149 journalEntries = journalConfig.GetEntries();
150 if (journalEntries.IsEmpty())
157 if (journalEntry.GetEntryID() != entryID)
160 targetJournalEntry = journalEntry;
164 if (!targetJournalEntry)
167 targetJournalEntry.SetEntryText(newText);
170 for (
int i = 0, count = param1.Count() * 2; i < count; i += 2)
172 if (!param1.IsIndexValid(i))
175 stringParam1 = stringParam1 +
"<br/><br/>" +
LocalizedString.Format(WidgetManager.Translate(param1[i], param1[i + 1]));
179 targetJournalEntry.SetEntryTextParam1(stringParam1);
181 Widget widgetToRefresh;
182 widgetToRefresh = targetJournalEntry.GetWidget();
184 targetJournalEntry.SetEntryLayoutTo(widgetToRefresh);
190 array<string> temporaryInfo = {};
193 temporaryInfo.Copy(info);
194 FactionKey factionKey = temporaryInfo[0];
195 string newText = temporaryInfo[1];
198 temporaryInfo.RemoveOrdered(0);
199 temporaryInfo.RemoveOrdered(0);
201 RewriteEntry(factionKey, entryID, newText, temporaryInfo);
211 array<string> strings = {};
213 if (!strings || strings.IsEmpty())
216 array<string> stringsCopy = {};
217 stringsCopy.Copy(strings);
220 stringsCopy.RemoveOrdered(0);
221 stringsCopy.RemoveOrdered(0);
230 if (!m_JournalConfig)
233 return m_JournalConfig;
240 m_JournalConfig =
null;
251 if (m_sJournalConfigPath.GetPath().IsEmpty())
253 Print(
"Journal config path is empty!", LogLevel.WARNING);
257 Resource holder = BaseContainerTools.LoadContainer(m_sJournalConfigPath);
258 if (!holder || !holder.IsValid())
261 BaseContainer container = holder.GetResource().ToBaseContainer();
266 if (!m_JournalConfig)
268 Print(
"Journal config couldn't be created!", LogLevel.WARNING);
280 return SCR_RespawnBriefingComponent.Cast(
GetGame().
GetGameMode().FindComponent(SCR_RespawnBriefingComponent));
296 return m_SimpleBriefingBackground;
303 return m_sJournalConfigPath;
344 [
Attribute(
"1", UIWidgets.ComboBox,
"Type of victory condition",
"", ParamEnumArray.FromEnum(
ETaskIconType))]
348 protected string name;
351 protected string description;
362 string GetDescription()
371 return victoryCondition;