Респрайты алертов (#526)

* bleed alert respire + remove hardcoded shit from bloodstreamSystem

* resprite thirst icons

* ensnared alert meme resprite
This commit is contained in:
ThereDrD0
2024-08-01 06:57:26 +03:00
committed by GitHub
parent 3140e7b9e9
commit 567afd55c1
27 changed files with 101 additions and 24 deletions

View File

@@ -13,13 +13,13 @@ public sealed partial class AlertLevelPrototype : IPrototype
/// part here. Visualizers will use this in order to dictate what alert level to show on
/// client side sprites, and localization uses each key to dictate the alert level name.
/// </summary>
[DataField("levels")] public Dictionary<string, AlertLevelDetail> Levels = new();
[DataField] public Dictionary<string, AlertLevelDetail> Levels = new();
/// <summary>
/// Default level that the station is on upon initialization.
/// If this isn't in the dictionary, this will default to whatever .First() gives.
/// </summary>
[DataField("defaultLevel")] public string DefaultLevel { get; private set; } = default!;
[DataField] public string DefaultLevel { get; private set; } = default!;
}
/// <summary>

View File

@@ -18,6 +18,7 @@ namespace Content.Server.Body.Components
public static string DefaultChemicalsSolutionName = "chemicals";
public static string DefaultBloodSolutionName = "bloodstream";
public static string DefaultBloodTemporarySolutionName = "bloodstreamTemporary";
public readonly string BloodAlertPrototypeID = "Bleed";
/// <summary>
/// The next time that blood level will be updated and bloodloss damage dealt.

View File

@@ -413,7 +413,13 @@ public sealed class BloodstreamSystem : EntitySystem
_alertsSystem.ClearAlert(uid, AlertType.Bleed);
else
{
var severity = (short) Math.Clamp(Math.Round(component.BleedAmount, MidpointRounding.ToZero), 0, 10);
if (!_prototypeManager.TryIndex<AlertPrototype>(component.BloodAlertPrototypeID, out var alertPrototype))
return false;
var severity = (short) Math.Clamp(Math.Round(component.BleedAmount, MidpointRounding.ToZero),
alertPrototype.MinSeverity,
alertPrototype.MaxSeverity);
_alertsSystem.ShowAlert(uid, AlertType.Bleed, severity);
}

View File

@@ -1,3 +1,4 @@
using Robust.Shared.Network;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
@@ -6,7 +7,7 @@ namespace Content.Shared.Alert
/// <summary>
/// An alert popup with associated icon, tooltip, and other data.
/// </summary>
[Prototype("alert")]
[Prototype]
public sealed partial class AlertPrototype : IPrototype
{
[ViewVariables]
@@ -22,7 +23,7 @@ namespace Content.Shared.Alert
/// List of icons to use for this alert. Each entry corresponds to a different severity level, starting from the
/// minimum and incrementing upwards. If severities are not supported, the first entry is used.
/// </summary>
[DataField("icons", required: true)]
[DataField(required: true)]
public List<SpriteSpecifier> Icons = new();
/// <summary>
@@ -34,13 +35,13 @@ namespace Content.Shared.Alert
/// <summary>
/// Name to show in tooltip window. Accepts formatting.
/// </summary>
[DataField("name")]
[DataField]
public string Name { get; private set; } = "";
/// <summary>
/// Description to show in tooltip window. Accepts formatting.
/// </summary>
[DataField("description")]
[DataField]
public string Description { get; private set; } = "";
/// <summary>
@@ -50,7 +51,7 @@ namespace Content.Shared.Alert
/// replace each other and are mutually exclusive, for example lowpressure / highpressure,
/// hot / cold. If left unspecified, the alert will not replace or be replaced by any other alerts.
/// </summary>
[DataField("category")]
[DataField]
public AlertCategory? Category { get; private set; }
/// <summary>
@@ -70,7 +71,7 @@ namespace Content.Shared.Alert
/// Maximum severity level supported by this state. -1 (default) indicates
/// no severity levels are supported by the state.
/// </summary>
[DataField("maxSeverity")]
[DataField]
public short MaxSeverity = -1;
/// <summary>
@@ -82,7 +83,7 @@ namespace Content.Shared.Alert
/// Defines what to do when the alert is clicked.
/// This will always be null on clientside.
/// </summary>
[DataField("onClick", serverOnly: true)]
[DataField(serverOnly: true)]
public IAlertClick? OnClick { get; private set; }
/// <param name="severity">severity level, if supported by this alert</param>

View File

@@ -149,7 +149,7 @@
id: Ensnared
onClick: !type:RemoveEnsnare { }
icons:
- sprite: /Textures/Interface/Alerts/ensnared.rsi
- sprite: /Textures/White/Interface/Alerts/ensnared.rsi
state: ensnared
name: alerts-ensnared-name
description: alerts-ensnared-desc
@@ -345,7 +345,7 @@
id: Thirsty
category: Thirst
icons:
- sprite: /Textures/Interface/Alerts/thirst.rsi
- sprite: /Textures/White/Interface/Alerts/thirst.rsi
state: thirsty
name: alerts-thirsty-name
description: alerts-thirsty-desc
@@ -354,7 +354,7 @@
id: Parched
category: Thirst
icons:
- sprite: /Textures/Interface/Alerts/thirst.rsi
- sprite: /Textures/White/Interface/Alerts/thirst.rsi
state: parched
name: alerts-parched-name
description: alerts-parched-desc
@@ -396,27 +396,27 @@
- type: alert
id: Bleed
icons:
- sprite: /Textures/Interface/Alerts/bleed.rsi
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
state: bleed0
- sprite: /Textures/Interface/Alerts/bleed.rsi
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
state: bleed1
- sprite: /Textures/Interface/Alerts/bleed.rsi
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
state: bleed2
- sprite: /Textures/Interface/Alerts/bleed.rsi
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
state: bleed3
- sprite: /Textures/Interface/Alerts/bleed.rsi
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
state: bleed4
- sprite: /Textures/Interface/Alerts/bleed.rsi
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
state: bleed5
- sprite: /Textures/Interface/Alerts/bleed.rsi
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
state: bleed6
- sprite: /Textures/Interface/Alerts/bleed.rsi
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
state: bleed7
- sprite: /Textures/Interface/Alerts/bleed.rsi
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
state: bleed8
- sprite: /Textures/Interface/Alerts/bleed.rsi
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
state: bleed9
- sprite: /Textures/Interface/Alerts/bleed.rsi
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
state: bleed10
name: alerts-bleed-name
description: alerts-bleed-desc

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

View File

@@ -0,0 +1,44 @@
{
"version": 1,
"size": {
"x": 32,
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "Edited by Flareguy for Space Station 14, original sprite taken from https://github.com/tgstation/tgstation/blob/master/icons/effects/bleed.dmi",
"states": [
{
"name": "bleed0"
},
{
"name": "bleed1"
},
{
"name": "bleed2"
},
{
"name": "bleed3"
},
{
"name": "bleed4"
},
{
"name": "bleed5"
},
{
"name": "bleed6"
},
{
"name": "bleed7"
},
{
"name": "bleed8"
},
{
"name": "bleed9"
},
{
"name": "bleed10"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 B

View File

@@ -0,0 +1,14 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Ensnared alert created by Hyenh. Bear Trap sprite taken from Citadel Station at https://github.com/Citadel-Station-13/Citadel-Station-13/commit/3cfea7eb92246d311de8b531347795bc76d6dab6",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "ensnared"
}
]
}

View File

@@ -0,0 +1,11 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "GitHub @Keikiru, iceglass.rsi originally from https://github.com/discordia-space/CEV-Eris/raw/f7aa28fd4b4d0386c3393d829681ebca526f1d2d/icons/obj/drinks.dmi, parched.png big waterbottle derived from https://github.com/discordia-space/CEV-Eris/raw/9c980cb9bc84d07b1c210c5447798af525185f80/icons/obj/food.dmi, toilet.rsi originally from https://github.com/discordia-space/CEV-Eris/commit/2cb66bae0e253e13d37f8939e0983bb94fee243e",
"size": { "x": 32, "y": 32 },
"states": [
{ "name": "thirsty", "directions": 1, "delays": [[1.0]] },
{ "name": "parched", "directions": 1, "delays": [[0.5, 0.5]] },
{ "name": "overhydrated", "directions": 1, "delays": [[1.0]] }
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B