Stop admin verb pop-in (#27450)

This commit is contained in:
Leon Friedrich
2024-04-29 15:24:10 +12:00
committed by GitHub
parent a466b35b27
commit 1eb81427d3
6 changed files with 68 additions and 33 deletions

View File

@@ -165,29 +165,23 @@ namespace Content.Client.Verbs
return true;
}
/// <summary>
/// Asks the server to send back a list of server-side verbs, for the given verb type.
/// </summary>
public SortedSet<Verb> GetVerbs(EntityUid target, EntityUid user, Type type, bool force = false)
{
return GetVerbs(GetNetEntity(target), user, new List<Type>() { type }, force);
}
/// <summary>
/// Ask the server to send back a list of server-side verbs, and for now return an incomplete list of verbs
/// (only those defined locally).
/// </summary>
public SortedSet<Verb> GetVerbs(NetEntity target, EntityUid user, List<Type> verbTypes,
bool force = false)
public SortedSet<Verb> GetVerbs(NetEntity target, EntityUid user, List<Type> verbTypes, out List<VerbCategory> extraCategories, bool force = false)
{
if (!target.IsClientSide())
RaiseNetworkEvent(new RequestServerVerbsEvent(target, verbTypes, adminRequest: force));
// Some admin menu interactions will try get verbs for entities that have not yet been sent to the player.
if (!TryGetEntity(target, out var local))
{
extraCategories = new();
return new();
}
return GetLocalVerbs(local.Value, user, verbTypes, force);
return GetLocalVerbs(local.Value, user, verbTypes, out extraCategories, force);
}