From cfa31be8d43fa0dd86b4aef404518272b6358ebf Mon Sep 17 00:00:00 2001 From: rhailrake <49613070+rhailrake@users.noreply.github.com> Date: Tue, 25 Apr 2023 01:24:58 +0600 Subject: [PATCH] [feat] bleeding alert, separated chat is default # Conflicts: # Content.Server/Body/Components/BloodstreamComponent.cs # Content.Server/Body/Systems/BloodstreamSystem.cs # Content.Shared/Alert/AlertType.cs --- .../Body/Components/BloodstreamComponent.cs | 9 +++++++++ Content.Server/Body/Systems/BloodstreamSystem.cs | 6 ++++++ Content.Shared/CCVar/CCVars.cs | 2 +- Resources/Prototypes/Alerts/alerts.yml | 8 ++++++++ Resources/Textures/Interface/Alerts/bleeding.png | Bin 0 -> 394 bytes 5 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Resources/Textures/Interface/Alerts/bleeding.png diff --git a/Content.Server/Body/Components/BloodstreamComponent.cs b/Content.Server/Body/Components/BloodstreamComponent.cs index 3ee8fe4d17..e99c955b6d 100644 --- a/Content.Server/Body/Components/BloodstreamComponent.cs +++ b/Content.Server/Body/Components/BloodstreamComponent.cs @@ -165,5 +165,14 @@ namespace Content.Server.Body.Components /// [ViewVariables(VVAccess.ReadWrite)] public float StatusTime; + + //WD-EDIT + + /// + /// Bool for bleeding alert. + /// + public bool IsBleeding => BleedAmount > 0; + + //WD-EDIT } } diff --git a/Content.Server/Body/Systems/BloodstreamSystem.cs b/Content.Server/Body/Systems/BloodstreamSystem.cs index 21dc2f4526..345915cb27 100644 --- a/Content.Server/Body/Systems/BloodstreamSystem.cs +++ b/Content.Server/Body/Systems/BloodstreamSystem.cs @@ -104,6 +104,12 @@ public sealed class BloodstreamSystem : EntitySystem if (!_solutionContainerSystem.ResolveSolution(uid, bloodstream.BloodSolutionName, ref bloodstream.BloodSolution, out var bloodSolution)) continue; + //WD-EDIT + if (bloodstream.IsBleeding) + _alertsSystem.ShowAlert(uid, AlertType.Bleed); + else + _alertsSystem.ClearAlert(uid, AlertType.Bleed); + //WD-EDIT // Adds blood to their blood level if it is below the maximum; Blood regeneration. Must be alive. if (bloodSolution.Volume < bloodSolution.MaxVolume && !_mobStateSystem.IsDead(uid)) diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 5a315f7055..6a01bcf2f7 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -1513,7 +1513,7 @@ namespace Content.Shared.CCVar */ public static readonly CVarDef UILayout = - CVarDef.Create("ui.layout", "Default", CVar.CLIENTONLY | CVar.ARCHIVE); + CVarDef.Create("ui.layout", "Separated", CVar.CLIENTONLY | CVar.ARCHIVE); public static readonly CVarDef DefaultScreenChatSize = CVarDef.Create("ui.default_chat_size", "", CVar.CLIENTONLY | CVar.ARCHIVE); diff --git a/Resources/Prototypes/Alerts/alerts.yml b/Resources/Prototypes/Alerts/alerts.yml index bc3137b07f..1e72376048 100644 --- a/Resources/Prototypes/Alerts/alerts.yml +++ b/Resources/Prototypes/Alerts/alerts.yml @@ -5,6 +5,7 @@ id: BaseAlertOrder order: - category: Health + - alertType: Bleeding - category: Stamina - alertType: SuitPower - category: Internals @@ -457,3 +458,10 @@ state: critical name: Debug6 description: Debug + +# WD-EDIT +- type: alert + id: Bleeding + icons: [ /Textures/Interface/Alerts/bleeding.png ] + name: alerts-bleeding-name + description: alerts-bleeding-desc diff --git a/Resources/Textures/Interface/Alerts/bleeding.png b/Resources/Textures/Interface/Alerts/bleeding.png new file mode 100644 index 0000000000000000000000000000000000000000..4472183d445194a9b28251ee1d38956bd8eca26a GIT binary patch literal 394 zcmV;50d@X~P)Px$L`g(JR9J=Wmc4DmFc5{G3=hBn8bA#T?T`Ts7;daGRSLOrm389UB`d>#2FMIy zp+*B32sdCFQ=k+{zDq7K0_atue)t~0I~)Yen)Tmg0ADKYrS@A$ZS zrOLo2kY}lc@Am@)NtJ;dAjTgk43&Xf8WsU*{QLmxO=sONg8}^O(<6%lDL{( zdp=RU0RT(tixm6?kd*GhA6%VK_q|CVoW74gXyxh-1&%o>Kwq}Ga6gd^AT4qa^qXsn zgaLe|G^rdc0z;-hoekswv3Yzw)tn*$3SboDcK?js@vVc}0Dfvzvjc<>mD24x&r;-B z`o+9`zTS{aLvF%@s}o#LRJrJ0r1pF07*qoM6N<$f)t>ik^lez literal 0 HcmV?d00001