From 92a9136eab032f7108d09c9d895d4ef01e2a9b1c Mon Sep 17 00:00:00 2001 From: Kmc2000 Date: Wed, 22 Jul 2020 08:55:09 +0100 Subject: [PATCH] Examine text feedback for when things are powered (#1441) --- .../ApcNetComponents/PowerReceiverComponent.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverComponent.cs b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverComponent.cs index 54e0cba98d..7a7cd5311f 100644 --- a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverComponent.cs +++ b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverComponent.cs @@ -8,7 +8,10 @@ using Robust.Shared.IoC; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; using System; +using Content.Server.GameObjects.EntitySystems.Click; using Robust.Shared.GameObjects.Components; +using Robust.Shared.Localization; +using Robust.Shared.Utility; namespace Content.Server.GameObjects.Components.Power.ApcNetComponents { @@ -16,7 +19,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents /// Attempts to link with a nearby s so that it can receive power from a . /// [RegisterComponent] - public class PowerReceiverComponent : Component + public class PowerReceiverComponent : Component, IExamine { public override string Name => "PowerReceiver"; @@ -216,6 +219,14 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents ClearProvider(); } } + /// + ///Adds some markup to the examine text of whatever object is using this component to tell you if it's powered or not, even if it doesn't have an icon state to do this for you. + /// + + public void Examine(FormattedMessage message, bool inDetailsRange) + { + message.AddMarkup(Loc.GetString("It appears to be {0}.", this.Powered ? "[color=darkgreen]powered[/color]" : "[color=darkred]un-powered[/color]")); + } } public class PowerStateEventArgs : EventArgs