RND Rework [Death to Techweb] (#16370)
* Techweb rework * more ui work * finishing ui * Finish all the C# logic * the techs + lathes * remove old-tech * mirror-review
This commit is contained in:
36
Content.Client/Research/UI/TechnologyCardControl.xaml.cs
Normal file
36
Content.Client/Research/UI/TechnologyCardControl.xaml.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Content.Shared.Research.Prototypes;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.Research.UI;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class TechnologyCardControl : Control
|
||||
{
|
||||
public Action? OnPressed;
|
||||
|
||||
public TechnologyCardControl(TechnologyPrototype technology, IPrototypeManager prototypeManager, SpriteSystem spriteSys, FormattedMessage description, int points)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
var discipline = prototypeManager.Index<TechDisciplinePrototype>(technology.Discipline);
|
||||
Background.ModulateSelfOverride = discipline.Color;
|
||||
|
||||
DisciplineTexture.Texture = spriteSys.Frame0(discipline.Icon);
|
||||
TechnologyNameLabel.Text = Loc.GetString(technology.Name);
|
||||
var message = new FormattedMessage();
|
||||
message.AddMarkup(Loc.GetString("research-console-tier-discipline-info",
|
||||
("tier", technology.Tier), ("color", discipline.Color), ("discipline", Loc.GetString(discipline.Name))));
|
||||
TierLabel.SetMessage(message);
|
||||
UnlocksLabel.SetMessage(description);
|
||||
|
||||
TechnologyTexture.Texture = spriteSys.Frame0(technology.Icon);
|
||||
|
||||
ResearchButton.Disabled = points < technology.Cost;
|
||||
ResearchButton.OnPressed += _ => OnPressed?.Invoke();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user