dynamic alert sprites (#25452)

* dynamic alert sprite

* fix fat cooldowns
This commit is contained in:
Nemanja
2024-03-28 02:32:56 -04:00
committed by GitHub
parent 6863a7cc26
commit d576f5cbbb
38 changed files with 154 additions and 84 deletions

View File

@@ -25,6 +25,12 @@ namespace Content.Shared.Alert
[DataField("icons", required: true)]
public List<SpriteSpecifier> Icons = new();
/// <summary>
/// An entity used for displaying the <see cref="Icons"/> in the UI control.
/// </summary>
[DataField]
public EntProtoId AlertViewEntity = "AlertSpriteView";
/// <summary>
/// Name to show in tooltip window. Accepts formatting.
/// </summary>
@@ -83,13 +89,9 @@ namespace Content.Shared.Alert
/// <returns>the icon path to the texture for the provided severity level</returns>
public SpriteSpecifier GetIcon(short? severity = null)
{
if (!SupportsSeverity && severity != null)
{
throw new InvalidOperationException($"This alert ({AlertKey}) does not support severity");
}
var minIcons = SupportsSeverity
? MaxSeverity - MinSeverity : 1;
? MaxSeverity - MinSeverity
: 1;
if (Icons.Count < minIcons)
throw new InvalidOperationException($"Insufficient number of icons given for alert {AlertType}");

View File

@@ -9,13 +9,15 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
namespace Content.Shared.Revenant.Components;
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
public sealed partial class RevenantComponent : Component
{
/// <summary>
/// The total amount of Essence the revenant has. Functions
/// as health and is regenerated.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField, ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public FixedPoint2 Essence = 75;
[DataField("stolenEssenceCurrencyPrototype", customTypeSerializer: typeof(PrototypeIdSerializer<CurrencyPrototype>))]

View File

@@ -70,3 +70,11 @@ public enum RevenantVisuals : byte
Stunned,
Harvesting,
}
[NetSerializable, Serializable]
public enum RevenantVisualLayers : byte
{
Digit1,
Digit2,
Digit3
}