Unstable 1.2.4.0

This commit is contained in:
Markus Isberg
2023-11-30 13:53:00 +02:00
parent 8a2e2ea0ae
commit fb5ea537bf
210 changed files with 4201 additions and 1283 deletions
@@ -0,0 +1,43 @@
#nullable enable
using Microsoft.Xna.Framework;
using System.Collections.Generic;
using System.Linq;
namespace Barotrauma;
partial class HighlightAction : EventAction
{
private static readonly Color highlightColor = Color.Orange;
[Serialize("", IsPropertySaveable.Yes)]
public Identifier TargetTag { get; set; }
[Serialize("", IsPropertySaveable.Yes, description: "Only the player controlling this character will see the highlight. If empty, all players will see it.")]
public Identifier TargetCharacter { get; set; }
[Serialize(true, IsPropertySaveable.Yes)]
public bool State { get; set; }
private bool isFinished;
public HighlightAction(ScriptedEvent parentEvent, ContentXElement element) : base(parentEvent, element)
{
}
public override void Update(float deltaTime)
{
if (isFinished) { return; }
var targetCharacters = TargetCharacter.IsEmpty ? null : ParentEvent.GetTargets(TargetCharacter).OfType<Character>();
foreach (var target in ParentEvent.GetTargets(TargetTag))
{
SetHighlightProjSpecific(target, targetCharacters);
}
isFinished = true;
}
partial void SetHighlightProjSpecific(Entity entity, IEnumerable<Character>? targetCharacters);
public override bool IsFinished(ref string goToLabel) => isFinished;
public override void Reset() => isFinished = false;
}