Printable Special Mags and Empty Mags and Material Rebalance for Ammo (#26178)
* 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>
This commit is contained in:
@@ -10,6 +10,8 @@ using Robust.Client.GameObjects;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Lathe.UI;
|
||||
@@ -19,6 +21,8 @@ public sealed partial class LatheMenu : DefaultWindow
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
||||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private readonly IResourceCache _resources = default!;
|
||||
|
||||
private EntityUid _owner;
|
||||
private readonly SpriteSystem _spriteSystem;
|
||||
private readonly LatheSystem _lathe;
|
||||
@@ -104,12 +108,21 @@ public sealed partial class LatheMenu : DefaultWindow
|
||||
RecipeList.Children.Clear();
|
||||
foreach (var prototype in sortedRecipesToShow)
|
||||
{
|
||||
var icon = prototype.Icon == null
|
||||
? _spriteSystem.GetPrototypeIcon(prototype.Result).Default
|
||||
: _spriteSystem.Frame0(prototype.Icon);
|
||||
List<Texture> textures;
|
||||
if (_prototypeManager.TryIndex(prototype.Result, out EntityPrototype? entityProto) && entityProto != null)
|
||||
{
|
||||
textures = SpriteComponent.GetPrototypeTextures(entityProto, _resources).Select(o => o.Default).ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
textures = prototype.Icon == null
|
||||
? new List<Texture> { _spriteSystem.GetPrototypeIcon(prototype.Result).Default }
|
||||
: new List<Texture> { _spriteSystem.Frame0(prototype.Icon) };
|
||||
}
|
||||
|
||||
var canProduce = _lathe.CanProduce(_owner, prototype, quantity);
|
||||
|
||||
var control = new RecipeControl(prototype, () => GenerateTooltipText(prototype), canProduce, icon);
|
||||
var control = new RecipeControl(prototype, () => GenerateTooltipText(prototype), canProduce, textures);
|
||||
control.OnButtonPressed += s =>
|
||||
{
|
||||
if (!int.TryParse(AmountLineEdit.Text, out var amount) || amount <= 0)
|
||||
|
||||
Reference in New Issue
Block a user