Fix popups (#176)

* fix: fix popups

* fix: fix naming for backstab
This commit is contained in:
ThereDrD0
2024-03-04 09:56:23 +03:00
committed by GitHub
parent 6a230aec72
commit 9251e909ab
7 changed files with 51 additions and 45 deletions

View File

@@ -297,7 +297,7 @@ public sealed class ExecutionSystem : EntitySystem
{
if (attemptEv.Message != null)
{
_popupSystem.PopupClient(attemptEv.Message, weapon, attacker);
_popupSystem.PopupEntity(attemptEv.Message, weapon, attacker);
return;
}
}

View File

@@ -120,7 +120,7 @@ public sealed class InteractionPopupSystem : EntitySystem
_popupSystem.PopupEntity(msg, uid, user);
_popupSystem.PopupEntity(msgOthers, uid, Filter.PvsExcept(user, entityManager: EntityManager), true);
}
else
else if (msg != "") // WD edit
_popupSystem.PopupEntity(msg, uid, user); //play only for the initiating entity.
if (sfx is not null) //not all cases will have sound.

View File

@@ -323,7 +323,7 @@ namespace Content.Server.VendingMachines
if (_accessReader.IsAllowed(sender, uid, accessReader) || HasComp<EmaggedComponent>(uid))
return true;
Popup.PopupClient(Loc.GetString("vending-machine-component-try-eject-access-denied"), uid, sender);
Popup.PopupEntity(Loc.GetString("vending-machine-component-try-eject-access-denied"), uid, sender);
Deny(uid, vendComponent);
return false;
}
@@ -352,7 +352,7 @@ namespace Content.Server.VendingMachines
if (entry == null)
{
if (sender.HasValue)
Popup.PopupClient(Loc.GetString("vending-machine-component-try-eject-invalid-item"), uid, sender.Value);
Popup.PopupEntity(Loc.GetString("vending-machine-component-try-eject-invalid-item"), uid, sender.Value);
Deny(uid, vendComponent);
@@ -362,7 +362,7 @@ namespace Content.Server.VendingMachines
if (entry.Amount <= 0)
{
if (sender.HasValue)
Popup.PopupClient(Loc.GetString("vending-machine-component-try-eject-out-of-stock"), uid, sender.Value);
Popup.PopupEntity(Loc.GetString("vending-machine-component-try-eject-out-of-stock"), uid, sender.Value);
Deny(uid, vendComponent);
return;

View File

@@ -1,7 +1,7 @@
using Content.Server.Popups;
using Content.Server.Xenoarchaeology.Equipment.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts;
using Content.Shared.Interaction;
using Content.Shared.Popups;
using Content.Shared.Timing;
namespace Content.Server.Xenoarchaeology.Equipment.Systems;
@@ -9,7 +9,7 @@ namespace Content.Server.Xenoarchaeology.Equipment.Systems;
public sealed class NodeScannerSystem : EntitySystem
{
[Dependency] private readonly UseDelaySystem _useDelay = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
/// <inheritdoc/>
public override void Initialize()
@@ -36,7 +36,7 @@ public sealed class NodeScannerSystem : EntitySystem
return;
// WD edit
_popupSystem.PopupClient(Loc.GetString("node-scan-popup",
_popupSystem.PopupEntity(Loc.GetString("node-scan-popup",
("id", $"{artifact.CurrentNodeId}")), target, args.User);
}
}

View File

@@ -147,12 +147,12 @@ public sealed class CultistFactorySystem : EntitySystem
if (args.IsAnchored)
{
_transform.Unanchor(target, xform);
_popup.PopupClient(Loc.GetString("anchorable-unanchored"), uid, args.User);
_popup.PopupEntity(Loc.GetString("anchorable-unanchored"), uid, args.User);
}
else
{
_transform.AnchorEntity(target, xform);
_popup.PopupClient(Loc.GetString("anchorable-anchored"), uid, args.User);
_popup.PopupEntity(Loc.GetString("anchorable-anchored"), uid, args.User);
}
_audio.PlayPvs("/Audio/Items/ratchet.ogg", uid);

View File

@@ -48,5 +48,10 @@ public sealed class BackstabSystem : EntitySystem
args.PenetrateArmor = ent.Comp.PenetrateArmor;
if (!_net.IsServer)
return;
var message = Loc.GetString("backstab-damage-betrayal-dagger", ("damage", damage));
_popup.PopupClient(message, args.User, args.User, PopupType.MediumCaution);
}
}

View File

@@ -0,0 +1 @@
backstab-damage-betrayal-dagger = Удар в спину: {$damage}!