Server LuaCsForBarotrauma
InventoryHighlightAction.cs
1 namespace Barotrauma;
2 
6 partial class InventoryHighlightAction : EventAction
7 {
8  [Serialize("", IsPropertySaveable.Yes, description: "Tag of the entity or entities whose inventory the item should be highlighted in. Must be a character or an item with an inventory.")]
9  public Identifier TargetTag { get; set; }
10 
11  [Serialize("", IsPropertySaveable.Yes, description: "Identifier of the item(s) to highlight.")]
12  public Identifier ItemIdentifier { get; set; }
13 
14  [Serialize(-1, IsPropertySaveable.Yes, description: "If the target is an item with multiple ItemContainer components (i.e. multiple inventories), such as a fabricator, this determines which inventory to highlight the item in (0 = first, 1 = second). If negative, it doesn't matter which inventory the item is in.")]
15  public int ItemContainerIndex { get; set; }
16 
17  [Serialize(false, IsPropertySaveable.Yes, description: "If enabled, the action will go look through all the containers in the target inventory (e.g. highlighting a tank in a welding tool in the target inventory).")]
18  public bool Recursive { get; set; }
19 
20  private bool isFinished;
21 
22  public InventoryHighlightAction(ScriptedEvent parentEvent, ContentXElement element) : base(parentEvent, element) { }
23 
24  public override void Update(float deltaTime)
25  {
26  if (isFinished) { return; }
27  UpdateProjSpecific();
28  isFinished = true;
29  }
30 
31  partial void UpdateProjSpecific();
32 
33  public override bool IsFinished(ref string goToLabel) => isFinished;
34 
35  public override void Reset() => isFinished = false;
36 }
Highlights specific items in a specific inventory.
override bool IsFinished(ref string goToLabel)
InventoryHighlightAction(ScriptedEvent parentEvent, ContentXElement element)
override void Update(float deltaTime)
override void Reset()