diff --git a/Content.Client/Options/UI/Tabs/MiscTab.xaml b/Content.Client/Options/UI/Tabs/MiscTab.xaml
index 012c29ceb8..1aebaebd86 100644
--- a/Content.Client/Options/UI/Tabs/MiscTab.xaml
+++ b/Content.Client/Options/UI/Tabs/MiscTab.xaml
@@ -14,6 +14,9 @@
StyleClasses="LabelKeyText"/>
+
+
diff --git a/Content.Client/Options/UI/Tabs/MiscTab.xaml.cs b/Content.Client/Options/UI/Tabs/MiscTab.xaml.cs
index 2b8ad3e93b..261264f19d 100644
--- a/Content.Client/Options/UI/Tabs/MiscTab.xaml.cs
+++ b/Content.Client/Options/UI/Tabs/MiscTab.xaml.cs
@@ -52,6 +52,7 @@ public sealed partial class MiscTab : Control
}
Control.AddOptionDropDown(SunriseCCVars.LobbyBackground, DropDownLobbyBackground, lobbyBackgroundEntries);
Control.AddOptionPercentSlider(SunriseCCVars.LobbyOpacity, LobbyOpacitySlider);
+ Control.AddOptionCheckBox(SunriseCCVars.DamageOverlay, DamageOverlayCheckBox);
// Sunrise-End
Control.AddOptionCheckBox(CVars.DiscordEnabled, DiscordRich);
diff --git a/Content.Client/Popups/PopupUIController.cs b/Content.Client/Popups/PopupUIController.cs
index 8ce8ae21e1..05c3f79345 100644
--- a/Content.Client/Popups/PopupUIController.cs
+++ b/Content.Client/Popups/PopupUIController.cs
@@ -79,6 +79,12 @@ public sealed class PopupUIController : UIController, IOnStateEntered _disabledSessions = new();
+
+ public override void Initialize()
+ {
+ base.Initialize();
+ SubscribeLocalEvent(OnDamageChange);
+ SubscribeNetworkEvent(OnDamageOverlayOption);
+ }
+
+ private async void OnDamageOverlayOption(DamageOverlayOptionEvent ev, EntitySessionEventArgs args)
+ {
+ if (ev.Enabled)
+ _disabledSessions.Remove(args.SenderSession);
+ else
+ _disabledSessions.Add(args.SenderSession);
+ }
+
+ private void OnDamageChange(EntityUid uid, DamageOverlayComponent component, DamageChangedEvent args)
+ {
+ if (args.DamageDelta == null)
+ return;
+
+ var damageDelta = args.DamageDelta.GetTotal();
+
+ if (_mindSystem.TryGetMind(uid, out _, out var mindTarget) && mindTarget.Session != null)
+ {
+ if (_disabledSessions.Contains(mindTarget.Session))
+ return;
+
+ if (damageDelta > 0)
+ {
+ _popupSystem.PopupEntity($"-{damageDelta}", uid, mindTarget.Session, PopupType.LargeCaution);
+ }
+ }
+
+ if (args.Origin == null)
+ return;
+
+ if (_mindSystem.TryGetMind(args.Origin.Value, out _, out var mindOrigin) && mindOrigin.Session != null)
+ {
+ if (_disabledSessions.Contains(mindOrigin.Session))
+ return;
+
+ if (damageDelta > 0)
+ {
+ if (args.Origin == uid)
+ return;
+
+ _popupSystem.PopupEntity($"-{damageDelta}", uid, mindOrigin.Session, PopupType.LargeCaution);
+ }
+ else
+ {
+ _popupSystem.PopupEntity($"+{FixedPoint2.Abs(damageDelta)}", uid, mindOrigin.Session, PopupType.LargeGreen);
+ }
+ }
+ }
+}
diff --git a/Content.Shared/Popups/SharedPopupSystem.cs b/Content.Shared/Popups/SharedPopupSystem.cs
index 38d2030cd5..9c093ba13b 100644
--- a/Content.Shared/Popups/SharedPopupSystem.cs
+++ b/Content.Shared/Popups/SharedPopupSystem.cs
@@ -196,6 +196,7 @@ namespace Content.Shared.Popups
/// but is not life-threatening.
///
Large,
- LargeCaution
+ LargeCaution,
+ LargeGreen
}
}
diff --git a/Content.Shared/_Sunrise/DamageOverlay/DamageOverlayOptionEvent.cs b/Content.Shared/_Sunrise/DamageOverlay/DamageOverlayOptionEvent.cs
new file mode 100644
index 0000000000..5b2149f582
--- /dev/null
+++ b/Content.Shared/_Sunrise/DamageOverlay/DamageOverlayOptionEvent.cs
@@ -0,0 +1,13 @@
+using Robust.Shared.Serialization;
+
+namespace Content.Shared._Sunrise.DamageOverlay;
+
+[Serializable, NetSerializable]
+public sealed class DamageOverlayOptionEvent : EntityEventArgs
+{
+ public bool Enabled { get; }
+ public DamageOverlayOptionEvent(bool enabled)
+ {
+ Enabled = enabled;
+ }
+}
diff --git a/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs b/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs
index 81cd4a5bc2..5ba9c7a091 100644
--- a/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs
+++ b/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs
@@ -204,9 +204,12 @@ public sealed class SunriseCCVars
CVarDef.Create("cryo_teleport.enable", false, CVar.SERVERONLY);
/*
- * Damage variance
+ * Damage
*/
+ public static readonly CVarDef DamageOverlay =
+ CVarDef.Create("damage.overlay", true, CVar.CLIENTONLY | CVar.ARCHIVE);
+
public static readonly CVarDef DamageVariance =
CVarDef.Create("damage.variance", 0.15f, CVar.SERVER | CVar.REPLICATED);
diff --git a/Resources/Changelog/ChangelogSunrise.yml b/Resources/Changelog/ChangelogSunrise.yml
index e5aa3f81a4..e161883965 100644
--- a/Resources/Changelog/ChangelogSunrise.yml
+++ b/Resources/Changelog/ChangelogSunrise.yml
@@ -2328,3 +2328,14 @@
type: Tweak
id: 170
time: '2024-08-07T20:10:55.993503+00:00'
+- author: VigersRay
+ changes:
+ - message: "\u041E\u0444\u0438\u0446\u0435\u0440\u044B \u0421\u0411 \u0442\u0435\
+ \u043F\u0435\u0440\u044C \u043C\u043E\u0433\u0443\u0442 \u0438\u0441\u043F\u043E\
+ \u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u043A\u043B\u043E\u0443\u043D\
+ \u0430 \u043A\u0430\u043A \u043C\u0438\u0448\u0435\u043D\u044C - \u0434\u043E\
+ \u0431\u0430\u0432\u043B\u0435\u043D \u043E\u0432\u0435\u0440\u043B\u0435\u0439\
+ \ \u0443\u0440\u043E\u043D\u0430."
+ type: Tweak
+ id: 171
+ time: '2024-08-08T05:08:32.401551+00:00'
diff --git a/Resources/Locale/ru-RU/escape-menu/ui/options-menu.ftl b/Resources/Locale/ru-RU/escape-menu/ui/options-menu.ftl
index 81f3dcf9f6..fd0eaab9ea 100644
--- a/Resources/Locale/ru-RU/escape-menu/ui/options-menu.ftl
+++ b/Resources/Locale/ru-RU/escape-menu/ui/options-menu.ftl
@@ -22,6 +22,7 @@ ui-options-general-speech = Речь
ui-options-general-storage = Инвентарь
ui-options-general-accessibility = Доступность
ui-options-general-lobby = Лобби
+ui-options-general-figth = Бой
## Audio menu
@@ -48,8 +49,7 @@ ui-options-interface-label = Интерфейс
ui-options-lobby-opacity = Прозрачность лобби
ui-options-lobby-background = Фон лобби
-ui-options-show-lobby-changelog = Показывать чейнжлог в лобби
-ui-options-show-lobby-servers-hub = Показывать хаб серверов в лобби
+ui-options-damage-overlay = Оверлей урона
ui-options-show-held-item = Показать удерживаемый элемент рядом с курсором
ui-options-show-combat-mode-indicators = Показать индикатор боевого режима рядом с курсором
ui-options-opaque-storage-window = Непрозрачность окна хранилища
diff --git a/Resources/Prototypes/Entities/Mobs/Species/base.yml b/Resources/Prototypes/Entities/Mobs/Species/base.yml
index 8907e8d7f7..794f8bba1d 100644
--- a/Resources/Prototypes/Entities/Mobs/Species/base.yml
+++ b/Resources/Prototypes/Entities/Mobs/Species/base.yml
@@ -216,10 +216,12 @@
- CanPilot
- FootstepSound
- DoorBumpOpener
+ # Sunrise-Start
- type: Paws
screamInterval: 3
thresholdDamage: 5
coughInterval: 5
+ # Sunrise-End
- type: entity
save: false
@@ -232,8 +234,10 @@
id: BaseMobSpeciesOrganic
abstract: true
components:
- - type: Carriable # Sunrise-edit
- - type: CanEscapeInventory # Sunrise-edit
+ # Sunrise-Start
+ - type: Carriable
+ - type: CanEscapeInventory
+ # Sunrise-End
- type: Barotrauma
damage:
types:
diff --git a/Resources/Prototypes/Entities/Mobs/base.yml b/Resources/Prototypes/Entities/Mobs/base.yml
index 9de747bd53..393cb0562c 100644
--- a/Resources/Prototypes/Entities/Mobs/base.yml
+++ b/Resources/Prototypes/Entities/Mobs/base.yml
@@ -45,7 +45,10 @@
- type: StatusIcon
- type: RequireProjectileTarget
active: False
- - type: TTS # Sunrise-TTS
+ # Sunrise-Start
+ - type: TTS
+ - type: DamageOverlay
+ # Sunrise-End
# Used for mobs that have health and can take damage.
- type: entity