* Printable Empty Magazines * Adjust values of ammo boxes, adjust material costs, add empty lethal/non-lethal mags, swap secfab shotgun shells with shotgun ammo boxes, add recipe for shotgun ammo boxes * Adds fully loaded pistol mags at secfab, removes printing respective cartridges at secfab * Adds fully loaded rifle mags at secfab, removes respective cartridges * Adds fully loaded light rifle mags at secfab, removes respective cartridges from secfab * Adds fully loaded speedloader to secfab, removes respective cartridges from secfab * small id mismatch fix * another wrong ID fix * capitalize Ls in speedloader * Add missing SpeedLoader recipe * Adds fully loaded shotgun drums to secfab, removes respective shells from secfab * add rifle ammo unlocks back in, forgot ammo unlocks affect other fabs as well * Moves tranquilizer shells to the non-lethal ammunition research * Account for the removal of rubbers, adds in craftable disablers * rubber rounds don't exist, remove empty non-lethal mags to just have empty mags * Add in WT550 mags * Convert latheRecipes to use LayeredTextureRect instead of TextureRect * Fix for issue, texture layering now works * Add in missing shell uranium box art * add shelluranium to meta.json * Fix yml issue * Get rid of unused single ammo printing unlocks --------- Co-authored-by: Plykiya <plykiya@protonmail.com>
37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
using Content.Shared.Research.Prototypes;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.Graphics;
|
|
using Robust.Client.UserInterface;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
|
|
namespace Content.Client.Lathe.UI;
|
|
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class RecipeControl : Control
|
|
{
|
|
public Action<string>? OnButtonPressed;
|
|
public Func<string> TooltipTextSupplier;
|
|
|
|
public RecipeControl(LatheRecipePrototype recipe, Func<string> tooltipTextSupplier, bool canProduce, List<Texture> textures)
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
|
|
RecipeName.Text = recipe.Name;
|
|
RecipeTextures.Textures = textures;
|
|
Button.Disabled = !canProduce;
|
|
TooltipTextSupplier = tooltipTextSupplier;
|
|
Button.TooltipSupplier = SupplyTooltip;
|
|
|
|
Button.OnPressed += (_) =>
|
|
{
|
|
OnButtonPressed?.Invoke(recipe.ID);
|
|
};
|
|
}
|
|
|
|
private Control? SupplyTooltip(Control sender)
|
|
{
|
|
return new RecipeTooltip(TooltipTextSupplier());
|
|
}
|
|
}
|