Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkActionAppendBriefingEntryText.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Faction key that corresponds with the SCR_Faction set in FactionManager")]
5 FactionKey m_sFactionKey;
6
7 [Attribute()]
8 int m_iEntryID;
9
10 [Attribute()]
11 string m_sTargetText;
12
13 //------------------------------------------------------------------------------------------------
14 override void OnActivate(IEntity object)
15 {
16 if (!CanActivate())
17 return;
18
20 if (!gamemode)
21 return;
22
23 SCR_RespawnBriefingComponent respawnBriefing = SCR_RespawnBriefingComponent.Cast(gamemode.FindComponent(SCR_RespawnBriefingComponent));
24 if (!respawnBriefing)
25 return;
26
27 SCR_JournalSetupConfig journalSetupConfig = respawnBriefing.GetJournalSetup();
28 if (!journalSetupConfig)
29 return;
30
31 // Resolve Alias
32 SCR_FactionAliasComponent factionAliasComponent = SCR_FactionAliasComponent.Cast(GetGame().GetFactionManager().FindComponent(SCR_FactionAliasComponent));
33 if (factionAliasComponent)
34 m_sFactionKey = factionAliasComponent.ResolveFactionAlias(m_sFactionKey);
35
36 SCR_JournalConfig journalConfig = journalSetupConfig.GetJournalConfig(m_sFactionKey);
37 if (!journalConfig)
38 return;
39
40 array<ref SCR_JournalEntry> journalEntries = {};
41 journalEntries = journalConfig.GetEntries();
42 if (journalEntries.IsEmpty())
43 return;
44
45 SCR_JournalEntry targetJournalEntry;
46 foreach (SCR_JournalEntry journalEntry : journalEntries)
47 {
48 if (journalEntry.GetEntryID() != m_iEntryID)
49 continue;
50
51 targetJournalEntry = journalEntry;
52 break;
53 }
54
55 if (!targetJournalEntry)
56 return;
57
58 string finalText = targetJournalEntry.GetEntryText() + "<br/>" + "<br/>" + m_sTargetText;
59 targetJournalEntry.SetEntryText(finalText);
60 }
61}
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
SCR_BaseGameMode GetGameMode()
override void OnActivate()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
array< ref SCR_JournalEntry > GetEntries()
void SetEntryText(string text)
string GetEntryText()
SCR_JournalConfig GetJournalConfig(FactionKey factionKey=FactionKey.Empty)
SCR_FieldOfViewSettings Attribute