41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using Content.Client.Guidebook.Controls;
|
|
using Content.Client.UserInterface.ControlExtensions;
|
|
using Content.Shared.Damage.Prototypes;
|
|
using Content.Shared.FixedPoint;
|
|
using JetBrains.Annotations;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
|
|
namespace Content.Client._NF.Guidebook.Controls;
|
|
|
|
[UsedImplicitly, GenerateTypedNameReferences]
|
|
public sealed partial class GuideMedicalDamage : BoxContainer, ISearchableControl
|
|
{
|
|
public GuideMedicalDamage(DamageTypePrototype proto, FixedPoint2 quantity)
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
|
|
DamageLabel.Text = proto.LocalizedName;
|
|
AmountLabel.Text = quantity.ToString();
|
|
}
|
|
|
|
public GuideMedicalDamage(DamageGroupPrototype proto, FixedPoint2 quantity)
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
|
|
DamageLabel.Text = Loc.GetString("guidebook-medical-damage-group", ("name", proto.LocalizedName));
|
|
AmountLabel.Text = quantity.ToString();
|
|
}
|
|
|
|
public bool CheckMatchesSearch(string query)
|
|
{
|
|
return this.ChildrenContainText(query);
|
|
}
|
|
|
|
public void SetHiddenState(bool state, string query)
|
|
{
|
|
Visible = CheckMatchesSearch(query) ? state : !state;
|
|
}
|
|
}
|