Job icons are stored on ID cards (#18233)

This commit is contained in:
PrPleGoo
2023-07-29 10:25:27 +02:00
committed by GitHub
parent 7c9d7423d2
commit 7c088ac1de
65 changed files with 685 additions and 96 deletions

View File

@@ -13,6 +13,7 @@ using Content.Shared.Humanoid.Markings;
using Content.Shared.Humanoid.Prototypes;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using Content.Shared.StatusIcon;
using Content.Shared.Traits;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
@@ -574,7 +575,7 @@ namespace Content.Client.Preferences.UI
foreach (var job in jobs)
{
var selector = new JobPrioritySelector(job);
var selector = new JobPrioritySelector(job, _prototypeManager);
if (!_requirements.IsAllowed(job, out var reason))
{
@@ -1192,7 +1193,7 @@ namespace Content.Client.Preferences.UI
private Label _requirementsLabel;
private Label _jobTitle;
public JobPrioritySelector(JobPrototype job)
public JobPrioritySelector(JobPrototype job, IPrototypeManager prototypeManager)
{
Job = job;
@@ -1222,12 +1223,8 @@ namespace Content.Client.Preferences.UI
Stretch = TextureRect.StretchMode.KeepCentered
};
if (job.Icon != null)
{
var specifier = new SpriteSpecifier.Rsi(new ("/Textures/Interface/Misc/job_icons.rsi"),
job.Icon);
icon.Texture = specifier.Frame0();
}
var jobIcon = prototypeManager.Index<StatusIconPrototype>(job.Icon);
icon.Texture = jobIcon.Icon.Frame0();
_requirementsLabel = new Label()
{