Server LuaCsForBarotrauma
UIHighlightAction.cs
1 namespace Barotrauma;
2 
6 partial class UIHighlightAction : EventAction
7 {
8  public enum ElementId
9  {
10  None,
11  RepairButton,
12  PumpSpeedSlider,
13  PassiveSonarIndicator,
14  ActiveSonarIndicator,
15  SonarModeSwitch,
16  DirectionalSonarFrame,
17  SteeringModeSwitch,
18  MaintainPosTickBox,
19  AutoTempSwitch,
20  PowerButton,
21  FissionRateSlider,
22  TurbineOutputSlider,
23  DeconstructButton,
24  RechargeSpeedSlider,
25  CPRButton,
26  CloseButton,
27  MessageBoxCloseButton
28  }
29 
30  [Serialize(ElementId.None, IsPropertySaveable.Yes, description: "An arbitrary identifier that must match the userdata of the UI element. The userdatas of the element are hard-coded, so this option is generally intended for the developers' use.")]
31  public ElementId Id { get; set; }
32 
33  [Serialize("", IsPropertySaveable.Yes, description: "If the element's userdata is an entity or an entity prefab, it's identifier must match this value.")]
34  public Identifier EntityIdentifier { get; set; }
35 
36  [Serialize(OrderCategory.Emergency, IsPropertySaveable.Yes, description: "If the element's userdata is an order category, it must match this.")]
37  public OrderCategory OrderCategory { get; set; }
38 
39  [Serialize("", IsPropertySaveable.Yes, description: "If the element's userdata is an order, it must match this identifier.")]
40  public Identifier OrderIdentifier { get; set; }
41 
42  [Serialize("", IsPropertySaveable.Yes, description: "If the element's userdata is an order with options, it must match this.")]
43  public Identifier OrderOption { get; set; }
44 
45  [Serialize("", IsPropertySaveable.Yes, description: "If the element's userdata is an order, the order must target an entity with this tag.")]
46  public Identifier OrderTargetTag { get; set; }
47 
48  [Serialize(true, IsPropertySaveable.Yes, description: "Should the element bounce up an down in addition to being highlighted.")]
49  public bool Bounce { get; set; }
50 
51  [Serialize(false, IsPropertySaveable.Yes, description: "Should the action highlight the first matching element it finds, or all of them?")]
52  public bool HighlightMultiple { get; set; }
53 
54  private bool isFinished;
55 
56  public UIHighlightAction(ScriptedEvent parentEvent, ContentXElement element) : base(parentEvent, element) { }
57 
58  public override void Update(float deltaTime)
59  {
60  if (isFinished) { return; }
61  UpdateProjSpecific();
62  isFinished = true;
63  }
64 
65  partial void UpdateProjSpecific();
66 
67  public override bool IsFinished(ref string goToLabel) => isFinished;
68 
69  public override void Reset() => isFinished = false;
70 }
Highlights an UI element of some kind. Generally used in tutorials.
OrderCategory OrderCategory
Identifier OrderIdentifier
Identifier OrderTargetTag
Identifier EntityIdentifier
override void Update(float deltaTime)
UIHighlightAction(ScriptedEvent parentEvent, ContentXElement element)
override bool IsFinished(ref string goToLabel)
override void Reset()