Респрайты алертов (#526)
* bleed alert respire + remove hardcoded shit from bloodstreamSystem * resprite thirst icons * ensnared alert meme resprite
@@ -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
|
/// 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.
|
/// client side sprites, and localization uses each key to dictate the alert level name.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("levels")] public Dictionary<string, AlertLevelDetail> Levels = new();
|
[DataField] public Dictionary<string, AlertLevelDetail> Levels = new();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default level that the station is on upon initialization.
|
/// Default level that the station is on upon initialization.
|
||||||
/// If this isn't in the dictionary, this will default to whatever .First() gives.
|
/// If this isn't in the dictionary, this will default to whatever .First() gives.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("defaultLevel")] public string DefaultLevel { get; private set; } = default!;
|
[DataField] public string DefaultLevel { get; private set; } = default!;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ namespace Content.Server.Body.Components
|
|||||||
public static string DefaultChemicalsSolutionName = "chemicals";
|
public static string DefaultChemicalsSolutionName = "chemicals";
|
||||||
public static string DefaultBloodSolutionName = "bloodstream";
|
public static string DefaultBloodSolutionName = "bloodstream";
|
||||||
public static string DefaultBloodTemporarySolutionName = "bloodstreamTemporary";
|
public static string DefaultBloodTemporarySolutionName = "bloodstreamTemporary";
|
||||||
|
public readonly string BloodAlertPrototypeID = "Bleed";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The next time that blood level will be updated and bloodloss damage dealt.
|
/// The next time that blood level will be updated and bloodloss damage dealt.
|
||||||
|
|||||||
@@ -413,7 +413,13 @@ public sealed class BloodstreamSystem : EntitySystem
|
|||||||
_alertsSystem.ClearAlert(uid, AlertType.Bleed);
|
_alertsSystem.ClearAlert(uid, AlertType.Bleed);
|
||||||
else
|
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);
|
_alertsSystem.ShowAlert(uid, AlertType.Bleed, severity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Robust.Shared.Network;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
@@ -6,7 +7,7 @@ namespace Content.Shared.Alert
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// An alert popup with associated icon, tooltip, and other data.
|
/// An alert popup with associated icon, tooltip, and other data.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Prototype("alert")]
|
[Prototype]
|
||||||
public sealed partial class AlertPrototype : IPrototype
|
public sealed partial class AlertPrototype : IPrototype
|
||||||
{
|
{
|
||||||
[ViewVariables]
|
[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
|
/// 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.
|
/// minimum and incrementing upwards. If severities are not supported, the first entry is used.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("icons", required: true)]
|
[DataField(required: true)]
|
||||||
public List<SpriteSpecifier> Icons = new();
|
public List<SpriteSpecifier> Icons = new();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -34,13 +35,13 @@ namespace Content.Shared.Alert
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Name to show in tooltip window. Accepts formatting.
|
/// Name to show in tooltip window. Accepts formatting.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("name")]
|
[DataField]
|
||||||
public string Name { get; private set; } = "";
|
public string Name { get; private set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Description to show in tooltip window. Accepts formatting.
|
/// Description to show in tooltip window. Accepts formatting.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("description")]
|
[DataField]
|
||||||
public string Description { get; private set; } = "";
|
public string Description { get; private set; } = "";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -50,7 +51,7 @@ namespace Content.Shared.Alert
|
|||||||
/// replace each other and are mutually exclusive, for example lowpressure / highpressure,
|
/// 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.
|
/// hot / cold. If left unspecified, the alert will not replace or be replaced by any other alerts.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("category")]
|
[DataField]
|
||||||
public AlertCategory? Category { get; private set; }
|
public AlertCategory? Category { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -70,7 +71,7 @@ namespace Content.Shared.Alert
|
|||||||
/// Maximum severity level supported by this state. -1 (default) indicates
|
/// Maximum severity level supported by this state. -1 (default) indicates
|
||||||
/// no severity levels are supported by the state.
|
/// no severity levels are supported by the state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("maxSeverity")]
|
[DataField]
|
||||||
public short MaxSeverity = -1;
|
public short MaxSeverity = -1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -82,7 +83,7 @@ namespace Content.Shared.Alert
|
|||||||
/// Defines what to do when the alert is clicked.
|
/// Defines what to do when the alert is clicked.
|
||||||
/// This will always be null on clientside.
|
/// This will always be null on clientside.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField("onClick", serverOnly: true)]
|
[DataField(serverOnly: true)]
|
||||||
public IAlertClick? OnClick { get; private set; }
|
public IAlertClick? OnClick { get; private set; }
|
||||||
|
|
||||||
/// <param name="severity">severity level, if supported by this alert</param>
|
/// <param name="severity">severity level, if supported by this alert</param>
|
||||||
|
|||||||
@@ -149,7 +149,7 @@
|
|||||||
id: Ensnared
|
id: Ensnared
|
||||||
onClick: !type:RemoveEnsnare { }
|
onClick: !type:RemoveEnsnare { }
|
||||||
icons:
|
icons:
|
||||||
- sprite: /Textures/Interface/Alerts/ensnared.rsi
|
- sprite: /Textures/White/Interface/Alerts/ensnared.rsi
|
||||||
state: ensnared
|
state: ensnared
|
||||||
name: alerts-ensnared-name
|
name: alerts-ensnared-name
|
||||||
description: alerts-ensnared-desc
|
description: alerts-ensnared-desc
|
||||||
@@ -345,7 +345,7 @@
|
|||||||
id: Thirsty
|
id: Thirsty
|
||||||
category: Thirst
|
category: Thirst
|
||||||
icons:
|
icons:
|
||||||
- sprite: /Textures/Interface/Alerts/thirst.rsi
|
- sprite: /Textures/White/Interface/Alerts/thirst.rsi
|
||||||
state: thirsty
|
state: thirsty
|
||||||
name: alerts-thirsty-name
|
name: alerts-thirsty-name
|
||||||
description: alerts-thirsty-desc
|
description: alerts-thirsty-desc
|
||||||
@@ -354,7 +354,7 @@
|
|||||||
id: Parched
|
id: Parched
|
||||||
category: Thirst
|
category: Thirst
|
||||||
icons:
|
icons:
|
||||||
- sprite: /Textures/Interface/Alerts/thirst.rsi
|
- sprite: /Textures/White/Interface/Alerts/thirst.rsi
|
||||||
state: parched
|
state: parched
|
||||||
name: alerts-parched-name
|
name: alerts-parched-name
|
||||||
description: alerts-parched-desc
|
description: alerts-parched-desc
|
||||||
@@ -396,27 +396,27 @@
|
|||||||
- type: alert
|
- type: alert
|
||||||
id: Bleed
|
id: Bleed
|
||||||
icons:
|
icons:
|
||||||
- sprite: /Textures/Interface/Alerts/bleed.rsi
|
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
|
||||||
state: bleed0
|
state: bleed0
|
||||||
- sprite: /Textures/Interface/Alerts/bleed.rsi
|
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
|
||||||
state: bleed1
|
state: bleed1
|
||||||
- sprite: /Textures/Interface/Alerts/bleed.rsi
|
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
|
||||||
state: bleed2
|
state: bleed2
|
||||||
- sprite: /Textures/Interface/Alerts/bleed.rsi
|
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
|
||||||
state: bleed3
|
state: bleed3
|
||||||
- sprite: /Textures/Interface/Alerts/bleed.rsi
|
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
|
||||||
state: bleed4
|
state: bleed4
|
||||||
- sprite: /Textures/Interface/Alerts/bleed.rsi
|
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
|
||||||
state: bleed5
|
state: bleed5
|
||||||
- sprite: /Textures/Interface/Alerts/bleed.rsi
|
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
|
||||||
state: bleed6
|
state: bleed6
|
||||||
- sprite: /Textures/Interface/Alerts/bleed.rsi
|
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
|
||||||
state: bleed7
|
state: bleed7
|
||||||
- sprite: /Textures/Interface/Alerts/bleed.rsi
|
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
|
||||||
state: bleed8
|
state: bleed8
|
||||||
- sprite: /Textures/Interface/Alerts/bleed.rsi
|
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
|
||||||
state: bleed9
|
state: bleed9
|
||||||
- sprite: /Textures/Interface/Alerts/bleed.rsi
|
- sprite: /Textures/White/Interface/Alerts/bleed.rsi
|
||||||
state: bleed10
|
state: bleed10
|
||||||
name: alerts-bleed-name
|
name: alerts-bleed-name
|
||||||
description: alerts-bleed-desc
|
description: alerts-bleed-desc
|
||||||
|
|||||||
BIN
Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed0.png
Normal file
|
After Width: | Height: | Size: 379 B |
BIN
Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed1.png
Normal file
|
After Width: | Height: | Size: 446 B |
BIN
Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed10.png
Normal file
|
After Width: | Height: | Size: 656 B |
BIN
Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed2.png
Normal file
|
After Width: | Height: | Size: 467 B |
BIN
Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed3.png
Normal file
|
After Width: | Height: | Size: 488 B |
BIN
Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed4.png
Normal file
|
After Width: | Height: | Size: 518 B |
BIN
Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed5.png
Normal file
|
After Width: | Height: | Size: 522 B |
BIN
Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed6.png
Normal file
|
After Width: | Height: | Size: 556 B |
BIN
Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed7.png
Normal file
|
After Width: | Height: | Size: 592 B |
BIN
Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed8.png
Normal file
|
After Width: | Height: | Size: 639 B |
BIN
Resources/Textures/White/Interface/Alerts/bleed.rsi/bleed9.png
Normal file
|
After Width: | Height: | Size: 648 B |
@@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 772 B |
@@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -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]] }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 549 B |
BIN
Resources/Textures/White/Interface/Alerts/thirst.rsi/parched.png
Normal file
|
After Width: | Height: | Size: 817 B |
BIN
Resources/Textures/White/Interface/Alerts/thirst.rsi/thirsty.png
Normal file
|
After Width: | Height: | Size: 470 B |
|
After Width: | Height: | Size: 397 B |
|
After Width: | Height: | Size: 464 B |
|
After Width: | Height: | Size: 557 B |
|
After Width: | Height: | Size: 485 B |