use PopupClient for encryption keys (#17291)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -115,29 +115,25 @@ public sealed class EncryptionKeySystem : EntitySystem
|
|||||||
{
|
{
|
||||||
if (!component.KeysUnlocked)
|
if (!component.KeysUnlocked)
|
||||||
{
|
{
|
||||||
if (_net.IsClient && _timing.IsFirstTimePredicted)
|
_popup.PopupClient(Loc.GetString("encryption-keys-are-locked"), uid, args.User);
|
||||||
_popup.PopupEntity(Loc.GetString("encryption-keys-are-locked"), uid, args.User);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TryComp<WiresPanelComponent>(uid, out var panel) && !panel.Open)
|
if (TryComp<WiresPanelComponent>(uid, out var panel) && !panel.Open)
|
||||||
{
|
{
|
||||||
if (_net.IsClient && _timing.IsFirstTimePredicted)
|
_popup.PopupClient(Loc.GetString("encryption-keys-panel-locked"), uid, args.User);
|
||||||
_popup.PopupEntity(Loc.GetString("encryption-keys-panel-locked"), uid, args.User);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (component.KeySlots <= component.KeyContainer.ContainedEntities.Count)
|
if (component.KeySlots <= component.KeyContainer.ContainedEntities.Count)
|
||||||
{
|
{
|
||||||
if (_net.IsClient && _timing.IsFirstTimePredicted)
|
_popup.PopupClient(Loc.GetString("encryption-key-slots-already-full"), uid, args.User);
|
||||||
_popup.PopupEntity(Loc.GetString("encryption-key-slots-already-full"), uid, args.User);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (component.KeyContainer.Insert(args.Used))
|
if (component.KeyContainer.Insert(args.Used))
|
||||||
{
|
{
|
||||||
if (_net.IsClient&& _timing.IsFirstTimePredicted)
|
_popup.PopupClient(Loc.GetString("encryption-key-successfully-installed"), uid, args.User);
|
||||||
_popup.PopupEntity(Loc.GetString("encryption-key-successfully-installed"), uid, args.User);
|
|
||||||
_audio.PlayPredicted(component.KeyInsertionSound, args.Target, args.User);
|
_audio.PlayPredicted(component.KeyInsertionSound, args.Target, args.User);
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
return;
|
return;
|
||||||
@@ -149,22 +145,19 @@ public sealed class EncryptionKeySystem : EntitySystem
|
|||||||
{
|
{
|
||||||
if (!component.KeysUnlocked)
|
if (!component.KeysUnlocked)
|
||||||
{
|
{
|
||||||
if (_net.IsClient && _timing.IsFirstTimePredicted)
|
_popup.PopupClient(Loc.GetString("encryption-keys-are-locked"), uid, args.User);
|
||||||
_popup.PopupEntity(Loc.GetString("encryption-keys-are-locked"), uid, args.User);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TryComp<WiresPanelComponent>(uid, out var panel) && !panel.Open)
|
if (TryComp<WiresPanelComponent>(uid, out var panel) && !panel.Open)
|
||||||
{
|
{
|
||||||
if (_net.IsClient && _timing.IsFirstTimePredicted)
|
_popup.PopupClient(Loc.GetString("encryption-keys-panel-locked"), uid, args.User);
|
||||||
_popup.PopupEntity(Loc.GetString("encryption-keys-panel-locked"), uid, args.User);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (component.KeyContainer.ContainedEntities.Count == 0)
|
if (component.KeyContainer.ContainedEntities.Count == 0)
|
||||||
{
|
{
|
||||||
if (_net.IsClient && _timing.IsFirstTimePredicted)
|
_popup.PopupClient(Loc.GetString("encryption-keys-no-keys"), uid, args.User);
|
||||||
_popup.PopupEntity(Loc.GetString("encryption-keys-no-keys"), uid, args.User);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user