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
This commit is contained in:
38
Content.Client/Salvage/UI/SalvageJobBoardMenu.xaml.cs
Normal file
38
Content.Client/Salvage/UI/SalvageJobBoardMenu.xaml.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user