Refactor UserInterface properties to use a helper (#1896)
This commit is contained in:
@@ -4,6 +4,7 @@ using Content.Server.GameObjects.Components.Damage;
|
||||
using Content.Server.GameObjects.Components.Interactable;
|
||||
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Server.Utility;
|
||||
using Content.Shared.GameObjects.Components.Gravity;
|
||||
using Content.Shared.GameObjects.Components.Interactable;
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
@@ -16,6 +17,7 @@ using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Gravity
|
||||
{
|
||||
@@ -59,11 +61,7 @@ namespace Content.Server.GameObjects.Components.Gravity
|
||||
|
||||
public override string Name => "GravityGenerator";
|
||||
|
||||
private BoundUserInterface? UserInterface =>
|
||||
Owner.TryGetComponent(out ServerUserInterfaceComponent? ui) &&
|
||||
ui.TryGetBoundUserInterface(GravityGeneratorUiKey.Key, out var boundUi)
|
||||
? boundUi
|
||||
: null;
|
||||
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(GravityGeneratorUiKey.Key);
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user