dynamic alert sprites (#25452)
* dynamic alert sprite * fix fat cooldowns
This commit is contained in:
@@ -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}");
|
||||
|
||||
@@ -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>))]
|
||||
|
||||
@@ -70,3 +70,11 @@ public enum RevenantVisuals : byte
|
||||
Stunned,
|
||||
Harvesting,
|
||||
}
|
||||
|
||||
[NetSerializable, Serializable]
|
||||
public enum RevenantVisualLayers : byte
|
||||
{
|
||||
Digit1,
|
||||
Digit2,
|
||||
Digit3
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user