From ddd2da367da47ce64da7d829bb4708b2d4771f5d Mon Sep 17 00:00:00 2001 From: DEATHB4DEFEAT Date: Sun, 28 Jan 2024 02:03:49 -0800 Subject: [PATCH 1/5] port character info UI and use identity instead of ID for name --- .../Systems/CharacterInformationSystem.cs | 152 ++++++++++++++++ .../UI/CharacterInformationWindow.xaml | 35 ++++ .../UI/CharacterInformationWindow.xaml.cs | 163 ++++++++++++++++++ .../DetailExaminableComponent.cs | 21 ++- .../DetailExaminable/DetailExaminableystem.cs | 88 +++++----- .../Station/Systems/StationSpawningSystem.cs | 5 - .../DetailExaminableComponent.cs | 15 ++ .../SharedHumanoidAppearanceSystem.cs | 14 ++ .../CharacterInformationComponent.cs | 9 + .../characterInformationUi.ftl | 1 + .../Prototypes/Entities/Mobs/Species/base.yml | 5 +- 11 files changed, 448 insertions(+), 60 deletions(-) create mode 100644 Content.Client/SimpleStation14/Examine/CharacterInformation/Systems/CharacterInformationSystem.cs create mode 100644 Content.Client/SimpleStation14/Examine/CharacterInformation/UI/CharacterInformationWindow.xaml create mode 100644 Content.Client/SimpleStation14/Examine/CharacterInformation/UI/CharacterInformationWindow.xaml.cs create mode 100644 Content.Shared/DetailExaminable/DetailExaminableComponent.cs create mode 100644 Content.Shared/SimpleStation14/Examine/CharacterInformation/Components/CharacterInformationComponent.cs create mode 100644 Resources/Locale/en-US/simplestation14/Content/CharacterInformation/characterInformationUi.ftl diff --git a/Content.Client/SimpleStation14/Examine/CharacterInformation/Systems/CharacterInformationSystem.cs b/Content.Client/SimpleStation14/Examine/CharacterInformation/Systems/CharacterInformationSystem.cs new file mode 100644 index 0000000000..893def80a7 --- /dev/null +++ b/Content.Client/SimpleStation14/Examine/CharacterInformation/Systems/CharacterInformationSystem.cs @@ -0,0 +1,152 @@ +using System.Linq; +using Content.Client.Examine; +using Content.Client.Inventory; +using Content.Shared.SimpleStation14.Examine.CharacterInformation.Components; +using Content.Client.SimpleStation14.Examine.CharacterInformation.UI; +using Content.Shared.Access.Components; +using Content.Shared.CCVar; +using Content.Shared.DetailExaminable; +using Content.Shared.IdentityManagement.Components; +using Content.Shared.PDA; +using Content.Shared.Roles; +using Content.Shared.Verbs; +using Robust.Shared.Configuration; +using Robust.Shared.Prototypes; +using Robust.Shared.Utility; + +namespace Content.Client.SimpleStation14.Examine.CharacterInformation.Systems; + +public sealed class CharacterInformationSystem : EntitySystem +{ + [Dependency] private readonly ExamineSystem _examine = default!; + [Dependency] private readonly ClientInventorySystem _inventory = default!; + [Dependency] private readonly IEntityManager _entity = default!; + [Dependency] private readonly IPrototypeManager _prototype = default!; + [Dependency] private readonly IConfigurationManager _config = default!; + + private CharacterInformationWindow? _window; + + + public override void Initialize() + { + base.Initialize(); + + _window = new CharacterInformationWindow(); + + SubscribeLocalEvent>(OnGetExamineVerbs); + } + + + private void OnGetExamineVerbs(EntityUid uid, CharacterInformationComponent component, GetVerbsEvent args) + { + var verb = new ExamineVerb + { + Act = () => + { + ShowInfoWindow(args.Target); + }, + Text = Loc.GetString("character-information-verb-text"), + Message = Loc.GetString("character-information-verb-message"), + Category = VerbCategory.Examine, + Disabled = !_examine.IsInDetailsRange(args.User, uid), + Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/information.svg.192dpi.png")), + ClientExclusive = true, + }; + + args.Verbs.Add(verb); + } + + + private void ShowInfoWindow(EntityUid uid) + { + if (_window == null) + return; + + string? name = null; + string? job = null; + string? flavorText = null; + + // Get ID from inventory, get name and job from ID + var info = GetNameAndJob(uid); + + name = info.Item1; + job = info.Item2; + + // Fancy job title + if (!string.IsNullOrEmpty(job)) + { + var test = job.Replace(" ", ""); + // Command will be last in the list + // TODO: Make this not revolve around this fact ^ + var departments = _prototype.EnumeratePrototypes().OrderBy(d => d.ID).Reverse(); + var department = departments.FirstOrDefault(d => d.Roles.Contains(test)); + + if (department is not null) + { + // Department (ex: Command or Security) + var dept = string.Join(" ", Loc.GetString($"department-{department.ID}").Split(' ').Select(s => s[0].ToString().ToUpper() + s[1..].ToLower())); + // Redo the job title with the department color and department (ex: Captain (Command) or Security Officer (Security)) + job = $"[color={department.Color.ToHex()}]{job} ({dept})[/color]"; + } + } + + // Get and set flavor text + if (_config.GetCVar(CCVars.FlavorText) && + _entity.TryGetComponent(uid, out var detail)) + flavorText = detail.Content; + + _window.UpdateUi(uid, name, job, flavorText); + _window.Open(); + } + + /// + /// Gets the ID card component from either a PDA or an ID card if the entity has one + /// + /// Entity to check + /// ID card component if they have one on the entity + private IdCardComponent? GetId(EntityUid? idUid) + { + // PDA + if (_entity.TryGetComponent(idUid, out PdaComponent? pda) && pda.ContainedId is not null) + return _entity.GetComponent(pda.ContainedId.Value); + // ID Card + if (_entity.TryGetComponent(idUid, out IdCardComponent? id)) + return id; + + return null; + } + + /// + /// Gets the name and job title from an ID card component + /// + /// The entity to attempt information retrieval from + /// Name, Job Title + private (string, string) GetNameAndJob(EntityUid uid) + { + string? name = null; + + if (_entity.TryGetComponent(uid, out var identity) && + identity.IdentityEntitySlot.ContainedEntity != null) + name = _entity.GetComponent(identity.IdentityEntitySlot.ContainedEntity.Value).EntityName; + + if (_inventory.TryGetSlotEntity(uid, "id", out var idUid)) + { + var id = GetId(idUid); + if (id is not null) + { + name ??= id.FullName; + if (string.IsNullOrEmpty(name)) + name = "Unknown"; + + var jobTitle = id.JobTitle; + if (string.IsNullOrEmpty(jobTitle)) + jobTitle = "Unknown"; + jobTitle = string.Join(" ", jobTitle.Split(' ').Select(s => s[0].ToString().ToUpper() + s[1..].ToLower())); + + return (name, jobTitle); + } + } + + return (name ?? "Unknown", "Unknown"); + } +} diff --git a/Content.Client/SimpleStation14/Examine/CharacterInformation/UI/CharacterInformationWindow.xaml b/Content.Client/SimpleStation14/Examine/CharacterInformation/UI/CharacterInformationWindow.xaml new file mode 100644 index 0000000000..029893be5a --- /dev/null +++ b/Content.Client/SimpleStation14/Examine/CharacterInformation/UI/CharacterInformationWindow.xaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Content.Client/SimpleStation14/Examine/CharacterInformation/UI/CharacterInformationWindow.xaml.cs b/Content.Client/SimpleStation14/Examine/CharacterInformation/UI/CharacterInformationWindow.xaml.cs new file mode 100644 index 0000000000..bc269ddc24 --- /dev/null +++ b/Content.Client/SimpleStation14/Examine/CharacterInformation/UI/CharacterInformationWindow.xaml.cs @@ -0,0 +1,163 @@ +using System.Linq; +using System.Numerics; +using Content.Client.Message; +using Content.Client.UserInterface.Controls; +using Content.Shared.Humanoid; +using Content.Shared.Inventory; +using Microsoft.CodeAnalysis; +using Robust.Client.AutoGenerated; +using Robust.Client.GameObjects; +using Robust.Client.UserInterface.Controls; +using Robust.Client.UserInterface.XAML; +using Robust.Shared.Containers; +using Robust.Shared.Map; + +namespace Content.Client.SimpleStation14.Examine.CharacterInformation.UI; + +[GenerateTypedNameReferences] +public sealed partial class CharacterInformationWindow : FancyWindow +{ + private readonly IEntityManager _entity; + private readonly InventorySystem _inventory; + + private EntityUid _dummy = EntityUid.Invalid; + + // ReSharper disable once InconsistentNaming + private FancyWindow _rootWindow => RootWindow; + // ReSharper disable once InconsistentNaming + private GridContainer _sprites => SpriteContainer; + // ReSharper disable once InconsistentNaming + private RichTextLabel _name => Name; + // ReSharper disable once InconsistentNaming + private RichTextLabel _job => Job; + // ReSharper disable once InconsistentNaming + private PanelContainer _separator => Separator; + // ReSharper disable once InconsistentNaming + private ScrollContainer _flavorTextScroll => FlavorTextScroll; + // ReSharper disable once InconsistentNaming + private RichTextLabel _flavor => FlavorText; + + public CharacterInformationWindow() + { + RobustXamlLoader.Load(this); + + _entity = IoCManager.Resolve(); + _inventory = EntitySystem.Get(); + + ResetUi(); + } + + + /// + /// Placeholder entries + /// + private void ResetUi() + { + _entity.DeleteEntity(_dummy); + _sprites.RemoveAllChildren(); + + var unknown = Loc.GetString("generic-unknown"); + // Capitalize the first letter of each word (Title Case) + unknown = string.Join(" ", unknown.Split(' ').Select(s => char.ToUpper(s[0]) + s[1..])); + + _name.SetMarkup(unknown); + _job.SetMarkup(unknown); + + _flavor.SetMarkup("Placeholder flavor text."); + } + + /// + /// Updates the UI to show all relevant information about the entity + /// + /// The entity to become informed about + /// The name of the examined entity, taken from their ID + /// The job of the examined entity, taken from their ID + /// The flavor text of the examined entity + public void UpdateUi(EntityUid examined, string? name = null, string? job = null, string? flavorText = null) + { + ResetUi(); + + // Fill in the omnidirectional sprite views + if (_entity.TryGetComponent(examined, out var sprite)) + FillSprites(sprite, examined); + + // Fill in the name and job + if (!string.IsNullOrEmpty(name)) + _name.SetMarkup(name); + if (!string.IsNullOrEmpty(job)) + _job.SetMarkup(job); + + // Fill in the flavor text + if (!string.IsNullOrEmpty(flavorText)) + { + _flavor.SetMessage(flavorText); + _rootWindow.MinSize = new Vector2(675, 384); + _rootWindow.SetSize = new Vector2(675, 384); + _separator.Visible = true; + _flavorTextScroll.Visible = true; + } + else + { + _rootWindow.MinSize = new Vector2(292, 384); + _rootWindow.SetSize = new Vector2(292, 384); + _separator.Visible = false; + _flavorTextScroll.Visible = false; + } + } + + + /// + /// Fills the sprite views with the sprite from the sprite component + /// + /// Sprite component to use + /// The entity belongs to + private void FillSprites(SpriteComponent sprite, EntityUid entity) + { + // This all should "freeze" the sprite views + // Spawn a dummy entity to get a copy of the sprite component from + _dummy = _entity.SpawnEntity(_entity.GetComponent(entity).EntityPrototype!.ID, MapCoordinates.Nullspace); + + // Ensures the dummy has the same sex as the entity so masks are applied correctly + if (_entity.TryGetComponent(entity, out HumanoidAppearanceComponent? humanoidAppearance)) + { + var newHumanoidAppearance = _entity.EnsureComponent(_dummy); + newHumanoidAppearance.Sex = humanoidAppearance.Sex; + } + + // Spawn and equip a fake jumpsuit (it won't be shown) so the appearance system doesn't destroy reality when applying masks + var clothing = _entity.SpawnEntity("ClothingUniformJumpsuitColorGrey", MapCoordinates.Nullspace); + _inventory.TryEquip(_dummy, _dummy, clothing, "jumpsuit", true, true); + + // Copy the sprite component from the original entity to the dummy + var newSprite = _entity.EnsureComponent(_dummy); + newSprite.CopyFrom(sprite); + newSprite.Scale = Vector2.One; + + + // Create the SpriteViews + // From lists because redefining everything except direction and margin is annoying and hard to edit in the future + var directions = new List {Direction.South, Direction.North, Direction.West, Direction.East}; + var margins = new List + { + new(0, 0, 8, 8), // South + new(8, 0, 0, 8), // North + new(0, 8, 8, 0), // West + new(8, 8, 0, 0), // East + }; + + for (var i = 0; i < directions.Count; i++) + { + var view = new SpriteView + { + Scale = new Vector2(4, 4), + Stretch = SpriteView.StretchMode.None, + MaxSize = new Vector2(128, 128), + OverrideDirection = directions[i], + Margin = margins[i] + }; + view.SetEntity(_dummy); + + _sprites.AddChild(view); + } + } +} diff --git a/Content.Server/DetailExaminable/DetailExaminableComponent.cs b/Content.Server/DetailExaminable/DetailExaminableComponent.cs index 3cefb75869..c3120cce65 100644 --- a/Content.Server/DetailExaminable/DetailExaminableComponent.cs +++ b/Content.Server/DetailExaminable/DetailExaminableComponent.cs @@ -1,9 +1,12 @@ -namespace Content.Server.DetailExaminable -{ - [RegisterComponent] - public sealed partial class DetailExaminableComponent : Component - { - [DataField("content", required: true)] [ViewVariables(VVAccess.ReadWrite)] - public string Content = ""; - } -} +// Parkstation-CharacterInformation-Start +// namespace Content.Server.DetailExaminable +// { +// [RegisterComponent] +// public sealed class DetailExaminableComponent : Component +// { +// [DataField("content", required: true)] [ViewVariables(VVAccess.ReadWrite)] +// public string Content = ""; +// } +// } +// Parkstation-CharacterInformation-End +// (This was moved to shared) diff --git a/Content.Server/DetailExaminable/DetailExaminableystem.cs b/Content.Server/DetailExaminable/DetailExaminableystem.cs index c0acd87ca4..5675ba8dba 100644 --- a/Content.Server/DetailExaminable/DetailExaminableystem.cs +++ b/Content.Server/DetailExaminable/DetailExaminableystem.cs @@ -1,44 +1,44 @@ -using Content.Shared.Examine; -using Content.Shared.IdentityManagement; -using Content.Shared.Verbs; -using Robust.Shared.Utility; - -namespace Content.Server.DetailExaminable -{ - public sealed class DetailExaminableSystem : EntitySystem - { - [Dependency] private readonly ExamineSystemShared _examineSystem = default!; - - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent>(OnGetExamineVerbs); - } - - private void OnGetExamineVerbs(EntityUid uid, DetailExaminableComponent component, GetVerbsEvent args) - { - if (Identity.Name(args.Target, EntityManager) != MetaData(args.Target).EntityName) - return; - - var detailsRange = _examineSystem.IsInDetailsRange(args.User, uid); - - var verb = new ExamineVerb() - { - Act = () => - { - var markup = new FormattedMessage(); - markup.AddMarkup(component.Content); - _examineSystem.SendExamineTooltip(args.User, uid, markup, false, false); - }, - Text = Loc.GetString("detail-examinable-verb-text"), - Category = VerbCategory.Examine, - Disabled = !detailsRange, - Message = detailsRange ? null : Loc.GetString("detail-examinable-verb-disabled"), - Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/examine.svg.192dpi.png")) - }; - - args.Verbs.Add(verb); - } - } -} +// Parkstation-CharacterInformation-Start +// using Content.Shared.Examine; +// using Content.Shared.Verbs; +// using Robust.Shared.Utility; +// +// namespace Content.Server.DetailExaminable +// { +// public sealed class DetailExaminableSystem : EntitySystem +// { +// [Dependency] private readonly ExamineSystemShared _examineSystem = default!; +// +// public override void Initialize() +// { +// base.Initialize(); +// +// SubscribeLocalEvent>(OnGetExamineVerbs); +// } +// +// private void OnGetExamineVerbs(EntityUid uid, DetailExaminableComponent component, GetVerbsEvent args) +// { +// // TODO: Hide if identity isn't visible (when identity is merged) +// var detailsRange = _examineSystem.IsInDetailsRange(args.User, uid); +// +// var verb = new ExamineVerb() +// { +// Act = () => +// { +// var markup = new FormattedMessage(); +// markup.AddMarkup(component.Content); +// _examineSystem.SendExamineTooltip(args.User, uid, markup, false, false); +// }, +// Text = Loc.GetString("detail-examinable-verb-text"), +// Category = VerbCategory.Examine, +// Disabled = !detailsRange, +// Message = Loc.GetString("detail-examinable-verb-disabled"), +// Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/examine.svg.192dpi.png")) +// }; +// +// args.Verbs.Add(verb); +// } +// } +// } +// Parkstation-CharacterInformation-End +// (This was moved to shared) diff --git a/Content.Server/Station/Systems/StationSpawningSystem.cs b/Content.Server/Station/Systems/StationSpawningSystem.cs index 1822c243dc..55e4651705 100644 --- a/Content.Server/Station/Systems/StationSpawningSystem.cs +++ b/Content.Server/Station/Systems/StationSpawningSystem.cs @@ -1,5 +1,4 @@ using Content.Server.Access.Systems; -using Content.Server.DetailExaminable; using Content.Server.Humanoid; using Content.Server.IdentityManagement; using Content.Server.Mind.Commands; @@ -151,10 +150,6 @@ public EntityUid SpawnPlayerMob( { _humanoidSystem.LoadProfile(entity.Value, profile); _metaSystem.SetEntityName(entity.Value, profile.Name); - if (profile.FlavorText != "" && _configurationManager.GetCVar(CCVars.FlavorText)) - { - AddComp(entity.Value).Content = profile.FlavorText; - } } DoJobSpecials(job, entity.Value); diff --git a/Content.Shared/DetailExaminable/DetailExaminableComponent.cs b/Content.Shared/DetailExaminable/DetailExaminableComponent.cs new file mode 100644 index 0000000000..e02084addc --- /dev/null +++ b/Content.Shared/DetailExaminable/DetailExaminableComponent.cs @@ -0,0 +1,15 @@ +// Parkstation-CharacterInformation-Start +using Robust.Shared.GameStates; + +namespace Content.Shared.DetailExaminable +{ + [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] + public sealed partial class DetailExaminableComponent : Component + { + [DataField("content", required: true)] + [ViewVariables(VVAccess.ReadWrite)] + [AutoNetworkedField] + public string Content = ""; + } +} +// Parkstation-CharacterInformation-End diff --git a/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs b/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs index 597afcbda2..2c7434a9e4 100644 --- a/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs +++ b/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs @@ -1,8 +1,11 @@ using System.Linq; +using Content.Shared.CCVar; using Content.Shared.Decals; +using Content.Shared.DetailExaminable; using Content.Shared.Humanoid.Markings; using Content.Shared.Humanoid.Prototypes; using Content.Shared.Preferences; +using Robust.Shared.Configuration; using Robust.Shared.GameObjects.Components.Localization; using Robust.Shared.Network; using Robust.Shared.Prototypes; @@ -23,6 +26,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem [Dependency] private readonly INetManager _netManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly MarkingManager _markingManager = default!; + [Dependency] private readonly IConfigurationManager _configurationManager = default!; [ValidatePrototypeId] public const string DefaultSpecies = "Human"; @@ -329,6 +333,16 @@ public virtual void LoadProfile(EntityUid uid, HumanoidCharacterProfile profile, humanoid.Age = profile.Age; + + // Parkstation-CharacterInformation-Start + if (profile.FlavorText != "" && _configurationManager.GetCVar(CCVars.FlavorText)) + { + var detail = EnsureComp(uid); + detail.Content = profile.FlavorText; + Dirty(detail); + } + // Parkstation-CharacterInformation-End + Dirty(humanoid); } diff --git a/Content.Shared/SimpleStation14/Examine/CharacterInformation/Components/CharacterInformationComponent.cs b/Content.Shared/SimpleStation14/Examine/CharacterInformation/Components/CharacterInformationComponent.cs new file mode 100644 index 0000000000..0adbd04a55 --- /dev/null +++ b/Content.Shared/SimpleStation14/Examine/CharacterInformation/Components/CharacterInformationComponent.cs @@ -0,0 +1,9 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.SimpleStation14.Examine.CharacterInformation.Components; + +[RegisterComponent, NetworkedComponent] +public sealed partial class CharacterInformationComponent : Component +{ + +} diff --git a/Resources/Locale/en-US/simplestation14/Content/CharacterInformation/characterInformationUi.ftl b/Resources/Locale/en-US/simplestation14/Content/CharacterInformation/characterInformationUi.ftl new file mode 100644 index 0000000000..046419224c --- /dev/null +++ b/Resources/Locale/en-US/simplestation14/Content/CharacterInformation/characterInformationUi.ftl @@ -0,0 +1 @@ +character-information-ui-title = Character Information diff --git a/Resources/Prototypes/Entities/Mobs/Species/base.yml b/Resources/Prototypes/Entities/Mobs/Species/base.yml index b94b36a266..008d34e808 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/base.yml @@ -141,7 +141,7 @@ - Pacified - StaminaModifier - PsionicsDisabled #Nyano - Summary: PCs can have psionics disabled. - - PsionicallyInsulated #Nyano - Summary: PCs can be made insulated from psionic powers. + - PsionicallyInsulated #Nyano - Summary: PCs can be made insulated from psionic powers. - type: Reflect enabled: false reflectProb: 0 @@ -218,7 +218,7 @@ - type: MobPrice price: 1500 # Kidnapping a living person and selling them for cred is a good move. deathPenalty: 0.01 # However they really ought to be living and intact, otherwise they're worth 100x less. - - type: CanEscapeInventory # Carrying system from nyanotrasen. + - type: CanEscapeInventory # Carrying system from nyanotrasen. - type: Tag tags: - CanPilot @@ -304,6 +304,7 @@ Asphyxiation: -1.0 - type: FireVisuals alternateState: Standing + - type: CharacterInformation # Parkstation-CharacterInformation - type: entity save: false From cb6f67ce3aaf95113bba3557f905d882ad64c9cf Mon Sep 17 00:00:00 2001 From: DEATHB4DEFEAT Date: Sun, 28 Jan 2024 02:07:43 -0800 Subject: [PATCH 2/5] update the commented detailExaminableSystem --- .../DetailExaminable/DetailExaminableystem.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Content.Server/DetailExaminable/DetailExaminableystem.cs b/Content.Server/DetailExaminable/DetailExaminableystem.cs index 5675ba8dba..aca3cb7659 100644 --- a/Content.Server/DetailExaminable/DetailExaminableystem.cs +++ b/Content.Server/DetailExaminable/DetailExaminableystem.cs @@ -1,26 +1,29 @@ // Parkstation-CharacterInformation-Start // using Content.Shared.Examine; +// using Content.Shared.IdentityManagement; // using Content.Shared.Verbs; // using Robust.Shared.Utility; -// + // namespace Content.Server.DetailExaminable // { // public sealed class DetailExaminableSystem : EntitySystem // { // [Dependency] private readonly ExamineSystemShared _examineSystem = default!; -// + // public override void Initialize() // { // base.Initialize(); -// + // SubscribeLocalEvent>(OnGetExamineVerbs); // } -// + // private void OnGetExamineVerbs(EntityUid uid, DetailExaminableComponent component, GetVerbsEvent args) // { -// // TODO: Hide if identity isn't visible (when identity is merged) +// if (Identity.Name(args.Target, EntityManager) != MetaData(args.Target).EntityName) +// return; + // var detailsRange = _examineSystem.IsInDetailsRange(args.User, uid); -// + // var verb = new ExamineVerb() // { // Act = () => @@ -32,10 +35,10 @@ // Text = Loc.GetString("detail-examinable-verb-text"), // Category = VerbCategory.Examine, // Disabled = !detailsRange, -// Message = Loc.GetString("detail-examinable-verb-disabled"), +// Message = detailsRange ? null : Loc.GetString("detail-examinable-verb-disabled"), // Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/examine.svg.192dpi.png")) // }; -// + // args.Verbs.Add(verb); // } // } From 813a341392f9084226839819aa480e54966b54fe Mon Sep 17 00:00:00 2001 From: DEATHB4DEFEAT Date: Sun, 4 Feb 2024 19:06:42 -0800 Subject: [PATCH 3/5] review changes --- .../Systems/CharacterInformationSystem.cs | 2 ++ Content.Server/DetailExaminable/DetailExaminableComponent.cs | 3 +-- Content.Server/DetailExaminable/DetailExaminableystem.cs | 3 +-- Resources/Prototypes/Entities/Mobs/Species/base.yml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Content.Client/SimpleStation14/Examine/CharacterInformation/Systems/CharacterInformationSystem.cs b/Content.Client/SimpleStation14/Examine/CharacterInformation/Systems/CharacterInformationSystem.cs index 893def80a7..14a6eb7264 100644 --- a/Content.Client/SimpleStation14/Examine/CharacterInformation/Systems/CharacterInformationSystem.cs +++ b/Content.Client/SimpleStation14/Examine/CharacterInformation/Systems/CharacterInformationSystem.cs @@ -104,6 +104,7 @@ private void ShowInfoWindow(EntityUid uid) /// /// Entity to check /// ID card component if they have one on the entity + /// This function should not exist private IdCardComponent? GetId(EntityUid? idUid) { // PDA @@ -121,6 +122,7 @@ private void ShowInfoWindow(EntityUid uid) /// /// The entity to attempt information retrieval from /// Name, Job Title + /// This function should not exist private (string, string) GetNameAndJob(EntityUid uid) { string? name = null; diff --git a/Content.Server/DetailExaminable/DetailExaminableComponent.cs b/Content.Server/DetailExaminable/DetailExaminableComponent.cs index c3120cce65..367ca1be6f 100644 --- a/Content.Server/DetailExaminable/DetailExaminableComponent.cs +++ b/Content.Server/DetailExaminable/DetailExaminableComponent.cs @@ -1,4 +1,4 @@ -// Parkstation-CharacterInformation-Start +// Parkstation-CharacterInformation-Start - This was moved to the Shared namespace // namespace Content.Server.DetailExaminable // { // [RegisterComponent] @@ -9,4 +9,3 @@ // } // } // Parkstation-CharacterInformation-End -// (This was moved to shared) diff --git a/Content.Server/DetailExaminable/DetailExaminableystem.cs b/Content.Server/DetailExaminable/DetailExaminableystem.cs index aca3cb7659..2725815589 100644 --- a/Content.Server/DetailExaminable/DetailExaminableystem.cs +++ b/Content.Server/DetailExaminable/DetailExaminableystem.cs @@ -1,4 +1,4 @@ -// Parkstation-CharacterInformation-Start +// Parkstation-CharacterInformation-Start - This was moved to the Shared namespace // using Content.Shared.Examine; // using Content.Shared.IdentityManagement; // using Content.Shared.Verbs; @@ -44,4 +44,3 @@ // } // } // Parkstation-CharacterInformation-End -// (This was moved to shared) diff --git a/Resources/Prototypes/Entities/Mobs/Species/base.yml b/Resources/Prototypes/Entities/Mobs/Species/base.yml index 008d34e808..34d0dca4a2 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/base.yml @@ -141,7 +141,7 @@ - Pacified - StaminaModifier - PsionicsDisabled #Nyano - Summary: PCs can have psionics disabled. - - PsionicallyInsulated #Nyano - Summary: PCs can be made insulated from psionic powers. + - PsionicallyInsulated #Nyano - Summary: PCs can be made insulated from psionic powers. - type: Reflect enabled: false reflectProb: 0 @@ -218,7 +218,7 @@ - type: MobPrice price: 1500 # Kidnapping a living person and selling them for cred is a good move. deathPenalty: 0.01 # However they really ought to be living and intact, otherwise they're worth 100x less. - - type: CanEscapeInventory # Carrying system from nyanotrasen. + - type: CanEscapeInventory # Carrying system from nyanotrasen. - type: Tag tags: - CanPilot From ea72d82dc153deebc6a088c5f843cd26a829eaad Mon Sep 17 00:00:00 2001 From: DEATHB4DEFEAT Date: Sun, 11 Feb 2024 18:14:58 -0800 Subject: [PATCH 4/5] review changes --- .../Systems/CharacterInformationSystem.cs | 4 ++-- Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs | 2 +- .../DetailExaminable/DetailExaminableComponent.cs | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) rename Content.Shared/{ => SimpleStation14}/DetailExaminable/DetailExaminableComponent.cs (73%) diff --git a/Content.Client/SimpleStation14/Examine/CharacterInformation/Systems/CharacterInformationSystem.cs b/Content.Client/SimpleStation14/Examine/CharacterInformation/Systems/CharacterInformationSystem.cs index 14a6eb7264..bf10c4c5c6 100644 --- a/Content.Client/SimpleStation14/Examine/CharacterInformation/Systems/CharacterInformationSystem.cs +++ b/Content.Client/SimpleStation14/Examine/CharacterInformation/Systems/CharacterInformationSystem.cs @@ -5,7 +5,7 @@ using Content.Client.SimpleStation14.Examine.CharacterInformation.UI; using Content.Shared.Access.Components; using Content.Shared.CCVar; -using Content.Shared.DetailExaminable; +using Content.Shared.SimpleStation14.DetailExaminable; using Content.Shared.IdentityManagement.Components; using Content.Shared.PDA; using Content.Shared.Roles; @@ -104,7 +104,7 @@ private void ShowInfoWindow(EntityUid uid) /// /// Entity to check /// ID card component if they have one on the entity - /// This function should not exist + /// This function should not exist // TODO Remove this function private IdCardComponent? GetId(EntityUid? idUid) { // PDA diff --git a/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs b/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs index 2c7434a9e4..531cc5d907 100644 --- a/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs +++ b/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs @@ -1,7 +1,7 @@ using System.Linq; using Content.Shared.CCVar; using Content.Shared.Decals; -using Content.Shared.DetailExaminable; +using Content.Shared.SimpleStation14.DetailExaminable; using Content.Shared.Humanoid.Markings; using Content.Shared.Humanoid.Prototypes; using Content.Shared.Preferences; diff --git a/Content.Shared/DetailExaminable/DetailExaminableComponent.cs b/Content.Shared/SimpleStation14/DetailExaminable/DetailExaminableComponent.cs similarity index 73% rename from Content.Shared/DetailExaminable/DetailExaminableComponent.cs rename to Content.Shared/SimpleStation14/DetailExaminable/DetailExaminableComponent.cs index e02084addc..f72754cb46 100644 --- a/Content.Shared/DetailExaminable/DetailExaminableComponent.cs +++ b/Content.Shared/SimpleStation14/DetailExaminable/DetailExaminableComponent.cs @@ -1,7 +1,6 @@ -// Parkstation-CharacterInformation-Start using Robust.Shared.GameStates; -namespace Content.Shared.DetailExaminable +namespace Content.Shared.SimpleStation14.DetailExaminable { [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class DetailExaminableComponent : Component @@ -12,4 +11,3 @@ public sealed partial class DetailExaminableComponent : Component public string Content = ""; } } -// Parkstation-CharacterInformation-End From 9543da70830426be2e041f992a3cdf4d1a08bbfc Mon Sep 17 00:00:00 2001 From: DEATHB4DEFEAT Date: Thu, 2 May 2024 17:18:45 -0700 Subject: [PATCH 5/5] move characterinformationcomp to base species good thing that exists now --- Resources/Prototypes/Entities/Mobs/Species/base.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Resources/Prototypes/Entities/Mobs/Species/base.yml b/Resources/Prototypes/Entities/Mobs/Species/base.yml index 34d0dca4a2..9431f54735 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/base.yml @@ -141,7 +141,7 @@ - Pacified - StaminaModifier - PsionicsDisabled #Nyano - Summary: PCs can have psionics disabled. - - PsionicallyInsulated #Nyano - Summary: PCs can be made insulated from psionic powers. + - PsionicallyInsulated #Nyano - Summary: PCs can be made insulated from psionic powers. - type: Reflect enabled: false reflectProb: 0 @@ -218,12 +218,13 @@ - type: MobPrice price: 1500 # Kidnapping a living person and selling them for cred is a good move. deathPenalty: 0.01 # However they really ought to be living and intact, otherwise they're worth 100x less. - - type: CanEscapeInventory # Carrying system from nyanotrasen. + - type: CanEscapeInventory # Carrying system from nyanotrasen. - type: Tag tags: - CanPilot - FootstepSound - DoorBumpOpener + - type: CharacterInformation # Parkstation-CharacterInformation - type: entity save: false @@ -304,7 +305,6 @@ Asphyxiation: -1.0 - type: FireVisuals alternateState: Standing - - type: CharacterInformation # Parkstation-CharacterInformation - type: entity save: false