]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Morgue system refactor remove unused VVs and into Entity (#31835)
authorToken <esil.bektay@yandex.com>
Wed, 4 Sep 2024 15:30:21 +0000 (20:30 +0500)
committerGitHub <noreply@github.com>
Wed, 4 Sep 2024 15:30:21 +0000 (17:30 +0200)
* Remove unused VVs params and usings
from entityUid, MorgueComponent into Entity<MorgueComponent> ent

* remove unnecesary VVs cuz datafields add em

Content.Server/Morgue/MorgueSystem.cs
Content.Shared/Morgue/Components/MorgueComponent.cs

index b05c4414bcc060cce6575186f661bd8ddafd1e93..a07accf7772305b43b5c98e3d1e7a088d70baac5 100644 (file)
@@ -3,8 +3,6 @@ using Content.Shared.Body.Components;
 using Content.Shared.Examine;
 using Content.Shared.Morgue;
 using Content.Shared.Morgue.Components;
-using Robust.Server.GameObjects;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Player;
 
@@ -25,12 +23,12 @@ public sealed class MorgueSystem : EntitySystem
     /// <summary>
     ///     Handles the examination text for looking at a morgue.
     /// </summary>
-    private void OnExamine(EntityUid uid, MorgueComponent component, ExaminedEvent args)
+    private void OnExamine(Entity<MorgueComponent> ent, ref ExaminedEvent args)
     {
         if (!args.IsInDetailsRange)
             return;
 
-        _appearance.TryGetData<MorgueContents>(uid, MorgueVisuals.Contents, out var contents);
+        _appearance.TryGetData<MorgueContents>(ent.Owner, MorgueVisuals.Contents, out var contents);
 
         var text = contents switch
         {
index d4761d1ce4de3b6572abf668522238e19759f9e8..5d3fa451612f5958a2e37f60751e6488296e7679 100644 (file)
@@ -9,19 +9,18 @@ public sealed partial class MorgueComponent : Component
     /// <summary>
     ///     Whether or not the morgue beeps if a living player is inside.
     /// </summary>
-    [ViewVariables(VVAccess.ReadWrite)]
-    [DataField("doSoulBeep")]
+    [DataField]
     public bool DoSoulBeep = true;
 
-    [ViewVariables]
+    [DataField]
     public float AccumulatedFrameTime = 0f;
 
     /// <summary>
     ///     The amount of time between each beep.
     /// </summary>
-    [ViewVariables]
+    [DataField]
     public float BeepTime = 10f;
 
-    [DataField("occupantHasSoulAlarmSound")]
+    [DataField]
     public SoundSpecifier OccupantHasSoulAlarmSound = new SoundPathSpecifier("/Audio/Weapons/Guns/EmptyAlarm/smg_empty_alarm.ogg");
 }