10 public enum ActionType { Add, Remove, RemoveTarget, RemoveIcon, Clear };
12 [Serialize(
ActionType.Add, IsPropertySaveable.Yes, description:
"What to do with the icon. Add = add an icon, Remove = remove the icon that has the specific target and style, RemoveTarget = remove all icons assigned to the specific target, RemoveIcon = remove all icons with the specific style, Remove = remove all icons.")]
15 [Serialize(
"", IsPropertySaveable.Yes, description:
"Tag of the target to assign the icon to.")]
18 [Serialize(
"", IsPropertySaveable.Yes, description:
"Style of the icon.")]
21 private bool isFinished;
23 public TutorialIconAction(ScriptedEvent parentEvent, ContentXElement element) : base(parentEvent, element) { }
25 public override void Update(
float deltaTime)
27 if (isFinished) {
return; }
29 if (GameMain.GameSession?.GameMode is TutorialMode tutorialMode)
31 if (ParentEvent.GetTargets(
TargetTag).FirstOrDefault() is Entity target)
35 tutorialMode.Tutorial?.Icons.Add((target,
IconStyle));
39 tutorialMode.Tutorial?.Icons.RemoveAll(i => i.entity == target && i.iconStyle ==
IconStyle);
43 tutorialMode.Tutorial?.Icons.RemoveAll(i => i.entity == target);
47 tutorialMode.Tutorial?.Icons.RemoveAll(i => i.iconStyle ==
IconStyle);
51 tutorialMode.Tutorial?.Icons.Clear();
Displays a tutorial icon next to a specific target.
override bool IsFinished(ref string goToLabel)
TutorialIconAction(ScriptedEvent parentEvent, ContentXElement element)
override void Update(float deltaTime)