14 [
Serialize(
"",
IsPropertySaveable.Yes, description:
"Identifier of the entry. If there's already an entry with the same id, it gets overwritten.")]
15 public Identifier
Id {
get;
set; }
17 [
Serialize(
"",
IsPropertySaveable.Yes, description:
"Text to add to the event log. Can be the text as-is, or a tag referring to a line in a text file.")]
18 public string Text {
get;
set; }
20 [
Serialize(
"",
IsPropertySaveable.Yes, description:
"Tag of the character(s) who should see the entry. If empty, the entry is shown to everyone.")]
25 private readonly XElement? textElement;
29 if (
Id == Identifier.Empty)
31 DebugConsole.ThrowError($
"Error in event \"{parentEvent.Prefab.Identifier}\". {nameof(EventLogAction)} with no id.",
37 foreach (var elem
in element.Elements())
39 if (elem.Name.LocalName.Equals(
"text", StringComparison.OrdinalIgnoreCase))
45 Text ??=
string.Empty;
46 if (textElement ==
null)
48 if (
Text.IsNullOrEmpty())
50 DebugConsole.ThrowError($
"Error in event \"{parentEvent.Prefab.Identifier}\". {nameof(EventLogAction)} with no text set ({element}).",
51 contentPackage: element.ContentPackage);
61 private bool isFinished;
77 if (textElement !=
null)
81 text = tempDescription.
Value;
86 public override void Update(
float deltaTime)
88 if (isFinished) {
return; }
93 partial
void AddEntryProjSpecific(
EventLog? eventLog,
string displayText);
97 return $
"{ToolBox.GetDebugSymbol(isFinished)} {nameof(EventLogAction)} -> (Id: {Id})";
ContentPackage? ContentPackage
readonly ScriptedEvent ParentEvent
Adds an entry to the "event log" displayed in the mission tab of the tab menu.
override void Update(float deltaTime)
LocalizedString GetDisplayText()
override bool IsFinished(ref string goTo)
Has the action finished.
EventLogAction(ScriptedEvent parentEvent, ContentXElement element)
override string ToDebugString()
Rich test to display in debugdraw
Used to store logs of scripted events (a sort of "quest log")
readonly EventLog EventLog
static GameSession?? GameSession
readonly EventManager EventManager
virtual LocalizedString ReplaceVariablesInEventText(LocalizedString str)
virtual string GetTextForReplacementElement(string tag)