Icon = new SpriteSpecifier.Rsi(new("/Textures/Objects/Fun/caps.rsi"), "mag-6"),
Act = () =>
{
- _quickDialog.OpenDialog(player, "Set Bullet Amount", $"Amount (max {ballisticAmmo.Capacity}):", (int amount) =>
+ _quickDialog.OpenDialog(player, "Set Bullet Amount", $"Amount (standard {ballisticAmmo.Capacity}):", (string amount) =>
{
- ballisticAmmo.UnspawnedCount = amount;
+ if (!int.TryParse(amount, out var result))
+ return;
+
+ if (result > 0)
+ {
+ ballisticAmmo.UnspawnedCount = result;
+ }
+ else
+ {
+ ballisticAmmo.UnspawnedCount = 0;
+ }
+
+ _gun.UpdateBallisticAppearance(args.Target, ballisticAmmo);
});
},
Impact = LogImpact.Medium,
args.Capacity = component.Capacity;
}
- private void UpdateBallisticAppearance(EntityUid uid, BallisticAmmoProviderComponent component)
+ public void UpdateBallisticAppearance(EntityUid uid, BallisticAmmoProviderComponent component)
{
if (!Timing.IsFirstTimePredicted || !TryComp<AppearanceComponent>(uid, out var appearance))
return;