diff --git a/Content.Client/CharacterInfo/CharacterInfoSystem.cs b/Content.Client/CharacterInfo/CharacterInfoSystem.cs index d2f4f64285..2b2694c677 100644 --- a/Content.Client/CharacterInfo/CharacterInfoSystem.cs +++ b/Content.Client/CharacterInfo/CharacterInfoSystem.cs @@ -2,6 +2,7 @@ using Content.Shared.Objectives; using Robust.Client.GameObjects; using Robust.Client.Player; +using Robust.Client.UserInterface; namespace Content.Client.CharacterInfo; @@ -43,10 +44,16 @@ public sealed class CharacterInfoSystem : EntitySystem private void OnCharacterInfoEvent(CharacterInfoEvent msg, EntitySessionEventArgs args) { var data = new CharacterData(msg.EntityUid, msg.JobTitle, msg.Objectives, msg.Briefing, Name(msg.EntityUid)); - OnCharacterUpdate?.Invoke(data); } + public List GetCharacterInfoControls(EntityUid uid) + { + var ev = new GetCharacterInfoControlsEvent(uid); + RaiseLocalEvent(uid, ref ev, true); + return ev.Controls; + } + public readonly record struct CharacterData( EntityUid Entity, string Job, @@ -54,4 +61,15 @@ public sealed class CharacterInfoSystem : EntitySystem string Briefing, string EntityName ); + + /// + /// Event raised to get additional controls to display in the character info menu. + /// + [ByRefEvent] + public readonly record struct GetCharacterInfoControlsEvent(EntityUid Entity) + { + public readonly List Controls = new(); + + public readonly EntityUid Entity = Entity; + } } diff --git a/Content.Client/UserInterface/Systems/Character/CharacterUIController.cs b/Content.Client/UserInterface/Systems/Character/CharacterUIController.cs index 6f245dfc7b..a09b458685 100644 --- a/Content.Client/UserInterface/Systems/Character/CharacterUIController.cs +++ b/Content.Client/UserInterface/Systems/Character/CharacterUIController.cs @@ -1,3 +1,4 @@ +using System.Linq; using Content.Client.CharacterInfo; using Content.Client.Gameplay; using Content.Client.UserInterface.Controls; @@ -6,10 +7,10 @@ using Content.Client.UserInterface.Systems.Character.Windows; using Content.Client.UserInterface.Systems.Objectives.Controls; using Content.Shared.Input; using JetBrains.Annotations; +using Robust.Client.GameObjects; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controllers; using Robust.Client.UserInterface.Controls; -using Robust.Client.Utility; using Robust.Shared.Input.Binding; using Robust.Shared.Utility; using static Content.Client.CharacterInfo.CharacterInfoSystem; @@ -21,6 +22,7 @@ namespace Content.Client.UserInterface.Systems.Character; public sealed class CharacterUIController : UIController, IOnStateEntered, IOnStateExited, IOnSystemChanged { [UISystemDependency] private readonly CharacterInfoSystem _characterInfo = default!; + [UISystemDependency] private readonly SpriteSystem _sprite = default!; private CharacterWindow? _window; private MenuButton? CharacterButton => UIManager.GetActiveUIWidgetOrNull()?.CharacterButton; @@ -103,6 +105,8 @@ public sealed class CharacterUIController : UIController, IOnStateEntered