Added pricegun sound (#34119)
added pricegun sound Co-authored-by: dylanhunter <dylan2.whittingham@live.uwe.ac.uk>
This commit is contained in:
committed by
GitHub
parent
1a5be80d04
commit
39ee853801
@@ -1,7 +1,9 @@
|
||||
using Content.Server.Popups;
|
||||
using Content.Shared.Cargo.Components;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Timing;
|
||||
using Content.Shared.Cargo.Systems;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
|
||||
namespace Content.Server.Cargo.Systems;
|
||||
|
||||
@@ -11,12 +13,12 @@ public sealed class PriceGunSystem : SharedPriceGunSystem
|
||||
[Dependency] private readonly PricingSystem _pricingSystem = default!;
|
||||
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly CargoSystem _bountySystem = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
|
||||
protected override bool GetPriceOrBounty(EntityUid priceGunUid, EntityUid target, EntityUid user)
|
||||
protected override bool GetPriceOrBounty(Entity<PriceGunComponent> entity, EntityUid target, EntityUid user)
|
||||
{
|
||||
if (!TryComp(priceGunUid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((priceGunUid, useDelay)))
|
||||
if (!TryComp(entity.Owner, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((entity.Owner, useDelay)))
|
||||
return false;
|
||||
|
||||
// Check if we're scanning a bounty crate
|
||||
if (_bountySystem.IsBountyComplete(target, out _))
|
||||
{
|
||||
@@ -25,10 +27,15 @@ public sealed class PriceGunSystem : SharedPriceGunSystem
|
||||
else // Otherwise appraise the price
|
||||
{
|
||||
var price = _pricingSystem.GetPrice(target);
|
||||
_popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result", ("object", Identity.Entity(target, EntityManager)), ("price", $"{price:F2}")), user, user);
|
||||
_popupSystem.PopupEntity(Loc.GetString("price-gun-pricing-result",
|
||||
("object", Identity.Entity(target, EntityManager)),
|
||||
("price", $"{price:F2}")),
|
||||
user,
|
||||
user);
|
||||
}
|
||||
|
||||
_useDelay.TryResetDelay((priceGunUid, useDelay));
|
||||
_audio.PlayPvs(entity.Comp.AppraisalSound, entity.Owner);
|
||||
_useDelay.TryResetDelay((entity.Owner, useDelay));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user