Files
tbd-station-14/Content.Client/Salvage/UI/SalvageJobBoardMenu.xaml.cs
Nemanja 0d878751fa Salvage Job Board (#37549)
* Salvage Job Board

* More development

* Small boy

* Computer yaml (partial)

* UI

* Rank unlock logic

* Job label printing

* appraisal tool integration

* Jobs

* add board to QM locker

* boom!

* command desc

* mild rewording

* ackh, mein pr ist brohken
2025-05-18 14:02:52 +10:00

39 lines
1.2 KiB
C#

using Content.Client.Message;
using Content.Client.UserInterface.Controls;
using Content.Shared.Salvage.JobBoard;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
namespace Content.Client.Salvage.UI;
[GenerateTypedNameReferences]
public sealed partial class SalvageJobBoardMenu : FancyWindow
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
public Action<string>? OnLabelButtonPressed;
public SalvageJobBoardMenu()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
}
public void Update(SalvageJobBoardConsoleState state)
{
RankLabel.SetMarkup(Loc.GetString(state.Title));
RankProgressBar.Value = state.Progression;
CurrentJobContainer.Children.Clear();
foreach (var job in state.AvailableJobs)
{
var entry = new JobEntry(_prototypeManager.Index(job), _entityManager);
entry.OnLabelButtonPressed += () => OnLabelButtonPressed?.Invoke(job);
CurrentJobContainer.AddChild(entry);
}
}
}