diff --git a/.run/Content Server+Client.run.xml b/.run/Content Server+Client.run.xml
index 191d737ccf..f982a98524 100644
--- a/.run/Content Server+Client.run.xml
+++ b/.run/Content Server+Client.run.xml
@@ -4,4 +4,4 @@
-
+
\ No newline at end of file
diff --git a/Content.Client/Medical/CrewMonitoring/CrewMonitoringBoundUserInterface.cs b/Content.Client/Medical/CrewMonitoring/CrewMonitoringBoundUserInterface.cs
index 550d0fcdfe..a3a03cd14e 100644
--- a/Content.Client/Medical/CrewMonitoring/CrewMonitoringBoundUserInterface.cs
+++ b/Content.Client/Medical/CrewMonitoring/CrewMonitoringBoundUserInterface.cs
@@ -31,6 +31,7 @@ public sealed class CrewMonitoringBoundUserInterface : BoundUserInterface
_menu = this.CreateWindow();
_menu.Set(stationName, gridUid);
+ _menu.SetBoundUserInterface(this);
}
protected override void UpdateState(BoundUserInterfaceState state)
@@ -42,6 +43,7 @@ public sealed class CrewMonitoringBoundUserInterface : BoundUserInterface
case CrewMonitoringState st:
EntMan.TryGetComponent(Owner, out var xform);
_menu?.ShowSensors(st.Sensors, Owner, xform?.Coordinates);
+ _menu?.UpdateCorpseAlertToggle(st.CorpseAlertEnabled);
break;
}
}
diff --git a/Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml b/Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml
index dd40749d33..fa32aff610 100644
--- a/Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml
+++ b/Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml
@@ -11,7 +11,13 @@
-
+
+
+
+
+
+
diff --git a/Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml.cs b/Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml.cs
index b3b3508169..ff8265a779 100644
--- a/Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml.cs
+++ b/Content.Client/Medical/CrewMonitoring/CrewMonitoringWindow.xaml.cs
@@ -4,6 +4,7 @@ using System.Numerics;
using Content.Client.Pinpointer.UI;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Controls;
+using Content.Shared.Medical.CrewMonitoring;
using Content.Shared.Medical.SuitSensor;
using Content.Shared.StatusIcon;
using Robust.Client.AutoGenerated;
@@ -12,6 +13,7 @@ using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
+using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
@@ -31,6 +33,7 @@ public sealed partial class CrewMonitoringWindow : FancyWindow
private NetEntity? _trackedEntity;
private bool _tryToScrollToListFocus;
private Texture? _blipTexture;
+ private CrewMonitoringBoundUserInterface? _boundUserInterface;
public CrewMonitoringWindow()
{
@@ -41,6 +44,11 @@ public sealed partial class CrewMonitoringWindow : FancyWindow
_spriteSystem = _entManager.System();
NavMap.TrackedEntitySelectedAction += SetTrackedEntityFromNavMap;
+ CorpseAlertToggle.OnPressed += OnCorpseAlertTogglePressed;
+
+ // Initialize corpse alert toggle to "off" state
+ UpdateCorpseAlertToggle(false);
+ CorpseAlertToggle.Disabled = false;
}
public void Set(string stationName, EntityUid? mapUid)
@@ -58,6 +66,11 @@ public sealed partial class CrewMonitoringWindow : FancyWindow
NavMap.ForceNavMapUpdate();
}
+ public void SetBoundUserInterface(CrewMonitoringBoundUserInterface boundUserInterface)
+ {
+ _boundUserInterface = boundUserInterface;
+ }
+
protected override void FrameUpdate(FrameEventArgs args)
{
base.FrameUpdate(args);
@@ -448,6 +461,41 @@ public sealed partial class CrewMonitoringWindow : FancyWindow
NavMap.TrackedEntities.Clear();
NavMap.LocalizedNames.Clear();
}
+
+ public void UpdateCorpseAlertToggle(bool enabled)
+ {
+ if (enabled)
+ {
+ CorpseAlertToggle.Text = Loc.GetString("crew-monitoring-corpse-alert-on");
+ CorpseAlertToggle.AddStyleClass(StyleNano.StyleClassButtonColorGreen);
+ }
+ else
+ {
+ CorpseAlertToggle.Text = Loc.GetString("crew-monitoring-corpse-alert-off");
+ CorpseAlertToggle.RemoveStyleClass(StyleNano.StyleClassButtonColorGreen);
+ }
+
+ // Re-enable the button when server state is received
+ CorpseAlertToggle.Disabled = false;
+ }
+
+ private void OnCorpseAlertTogglePressed(BaseButton.ButtonEventArgs args)
+ {
+ // Disable button to prevent spam clicks
+ CorpseAlertToggle.Disabled = true;
+
+ // Send message to server
+ _boundUserInterface?.SendMessage(new CrewMonitoringToggleCorpseAlertMessage());
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ base.Dispose(disposing);
+ if (disposing)
+ {
+ _boundUserInterface = null;
+ }
+ }
}
public sealed class CrewMonitoringButton : Button
diff --git a/Content.Server/Medical/CrewMonitoring/CrewMonitoringConsoleComponent.cs b/Content.Server/Medical/CrewMonitoring/CrewMonitoringConsoleComponent.cs
index 2e139fa3ce..cdbe9c05d2 100644
--- a/Content.Server/Medical/CrewMonitoring/CrewMonitoringConsoleComponent.cs
+++ b/Content.Server/Medical/CrewMonitoring/CrewMonitoringConsoleComponent.cs
@@ -23,7 +23,7 @@ public sealed partial class CrewMonitoringConsoleComponent : Component
/// Whether the console should beep when corpses with sensors are detected outside morgues.
///
[DataField("doCorpseAlert"), ViewVariables(VVAccess.ReadWrite)]
- public bool DoCorpseAlert = true;
+ public bool DoCorpseAlert = false;
///
/// Next time to check for corpses and potentially play alert sound.
diff --git a/Content.Server/Medical/CrewMonitoring/CrewMonitoringConsoleSystem.cs b/Content.Server/Medical/CrewMonitoring/CrewMonitoringConsoleSystem.cs
index f0ca49ed73..118f9690eb 100644
--- a/Content.Server/Medical/CrewMonitoring/CrewMonitoringConsoleSystem.cs
+++ b/Content.Server/Medical/CrewMonitoring/CrewMonitoringConsoleSystem.cs
@@ -31,6 +31,7 @@ public sealed class CrewMonitoringConsoleSystem : EntitySystem
SubscribeLocalEvent(OnRemove);
SubscribeLocalEvent(OnPacketReceived);
SubscribeLocalEvent(OnUIOpened);
+ SubscribeLocalEvent(OnToggleCorpseAlert);
}
public override void Update(float frameTime)
@@ -112,7 +113,7 @@ public sealed class CrewMonitoringConsoleSystem : EntitySystem
// Update all sensors info
var allSensors = component.ConnectedSensors.Values.ToList();
- _uiSystem.SetUiState(uid, CrewMonitoringUIKey.Key, new CrewMonitoringState(allSensors));
+ _uiSystem.SetUiState(uid, CrewMonitoringUIKey.Key, new CrewMonitoringState(allSensors, component.DoCorpseAlert));
}
///
@@ -158,4 +159,10 @@ public sealed class CrewMonitoringConsoleSystem : EntitySystem
return false;
}
+
+ private void OnToggleCorpseAlert(EntityUid uid, CrewMonitoringConsoleComponent component, CrewMonitoringToggleCorpseAlertMessage args)
+ {
+ component.DoCorpseAlert = !component.DoCorpseAlert;
+ UpdateUserInterface(uid, component);
+ }
}
diff --git a/Content.Shared/Medical/CrewMonitoring/CrewMonitoringShared.cs b/Content.Shared/Medical/CrewMonitoring/CrewMonitoringShared.cs
index 5b78839678..8752a9ba18 100644
--- a/Content.Shared/Medical/CrewMonitoring/CrewMonitoringShared.cs
+++ b/Content.Shared/Medical/CrewMonitoring/CrewMonitoringShared.cs
@@ -13,9 +13,16 @@ public enum CrewMonitoringUIKey
public sealed class CrewMonitoringState : BoundUserInterfaceState
{
public List Sensors;
+ public bool CorpseAlertEnabled;
- public CrewMonitoringState(List sensors)
+ public CrewMonitoringState(List sensors, bool corpseAlertEnabled = false)
{
Sensors = sensors;
+ CorpseAlertEnabled = corpseAlertEnabled;
}
}
+
+[Serializable, NetSerializable]
+public sealed class CrewMonitoringToggleCorpseAlertMessage : BoundUserInterfaceMessage
+{
+}
diff --git a/Resources/Locale/en-US/_strings/medical/components/crew-monitoring-component.ftl b/Resources/Locale/en-US/_strings/medical/components/crew-monitoring-component.ftl
index 1f5fd0aa85..eb0e144232 100644
--- a/Resources/Locale/en-US/_strings/medical/components/crew-monitoring-component.ftl
+++ b/Resources/Locale/en-US/_strings/medical/components/crew-monitoring-component.ftl
@@ -19,3 +19,6 @@ crew-monitoring-user-interface-no-department = Unknown
crew-monitoring-user-interface-flavor-left = In case of an emergency, contact station medical staff immediately
crew-monitoring-user-interface-flavor-right = v1.7
+
+crew-monitoring-corpse-alert-on = Corpse Alert: ON
+crew-monitoring-corpse-alert-off = Corpse Alert: OFF
\ No newline at end of file
diff --git a/Resources/Locale/ru-RU/_strings/_sunrise/mentor-help/mentor-help-ui.ftl b/Resources/Locale/ru-RU/_strings/_sunrise/mentor-help/mentor-help-ui.ftl
index 7d19651fad..882d2a8acf 100644
--- a/Resources/Locale/ru-RU/_strings/_sunrise/mentor-help/mentor-help-ui.ftl
+++ b/Resources/Locale/ru-RU/_strings/_sunrise/mentor-help/mentor-help-ui.ftl
@@ -1,4 +1,4 @@
-ui-lobby-mhelp-button = MHelp
+ui-lobby-mhelp-button = Ментор-помощь
ui-options-function-open-mentor-help = Открыть ментор помощь
ui-options-function-open-help-choice = Открыть выбор помощи
diff --git a/Resources/Locale/ru-RU/_strings/medical/components/crew-monitoring-component.ftl b/Resources/Locale/ru-RU/_strings/medical/components/crew-monitoring-component.ftl
index ca1d0fc98e..fde2e6b9e4 100644
--- a/Resources/Locale/ru-RU/_strings/medical/components/crew-monitoring-component.ftl
+++ b/Resources/Locale/ru-RU/_strings/medical/components/crew-monitoring-component.ftl
@@ -13,3 +13,6 @@ crew-monitoring-user-interface-no-server = Сервер не найден
crew-monitoring-user-interface-no-department = Неизвестно
crew-monitoring-user-interface-flavor-left = В случае экстренной ситуации, немедленно свяжитесь с мед. персоналом станции.
crew-monitoring-user-interface-flavor-right = v1.7
+
+crew-monitoring-corpse-alert-on = Оповещение о трупах: ВКЛ
+crew-monitoring-corpse-alert-off = Оповещение о трупах: ВЫКЛ
\ No newline at end of file