Kill UserInterfaceHelpers (#20912)

This commit is contained in:
Kara
2023-10-11 02:17:59 -07:00
committed by GitHub
parent 756fd6f309
commit 14dac914ce
12 changed files with 104 additions and 98 deletions

View File

@@ -1,5 +1,4 @@
using Content.Server.Actions;
using Content.Shared.Actions;
using Content.Shared.UserInterface;
using Robust.Server.GameObjects;
@@ -36,19 +35,19 @@ public sealed class IntrinsicUISystem : EntitySystem
if (key is null)
{
Logger.ErrorS("bui", $"Entity {ToPrettyString(uid)} has an invalid intrinsic UI.");
Log.Error($"Entity {ToPrettyString(uid)} has an invalid intrinsic UI.");
}
var ui = GetUIOrNull(uid, key, iui);
if (ui is null)
{
Logger.ErrorS("bui", $"Couldn't get UI {key} on {ToPrettyString(uid)}");
Log.Error($"Couldn't get UI {key} on {ToPrettyString(uid)}");
return false;
}
var attempt = new IntrinsicUIOpenAttemptEvent(uid, key);
RaiseLocalEvent(uid, attempt, false);
RaiseLocalEvent(uid, attempt);
if (attempt.Cancelled)
return false;
@@ -61,7 +60,7 @@ public sealed class IntrinsicUISystem : EntitySystem
if (!Resolve(uid, ref component))
return null;
return key is null ? null : uid.GetUIOrNull(key);
return key is null ? null : _uiSystem.GetUiOrNull(uid, key);
}
}