Refactor UserInterface properties to use a helper (#1896)
This commit is contained in:
@@ -9,6 +9,7 @@ using Content.Server.GameObjects.Components.GUI;
|
||||
using Content.Server.GameObjects.Components.Items.Storage;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Server.Interfaces.PDA;
|
||||
using Content.Server.Utility;
|
||||
using Content.Shared.GameObjects.Components.PDA;
|
||||
using Content.Shared.GameObjects.EntitySystems;
|
||||
using Content.Shared.GameObjects.Verbs;
|
||||
@@ -48,12 +49,7 @@ namespace Content.Server.GameObjects.Components.PDA
|
||||
|
||||
[ViewVariables] private readonly PdaAccessSet _accessSet;
|
||||
|
||||
[ViewVariables]
|
||||
private BoundUserInterface? UserInterface =>
|
||||
Owner.TryGetComponent(out ServerUserInterfaceComponent? ui) &&
|
||||
ui.TryGetBoundUserInterface(PDAUiKey.Key, out var boundUi)
|
||||
? boundUi
|
||||
: null;
|
||||
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(PDAUiKey.Key);
|
||||
|
||||
public PDAComponent()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user