From: deltanedas <39013340+deltanedas@users.noreply.github.com>
Date: Tue, 2 May 2023 07:53:10 +0000 (+0000)
Subject: add lock uplink button (#15994)
X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=a5aa4196a4f725644f70466246ddc3654d119ae5;p=space-station-14.git
add lock uplink button (#15994)
Co-authored-by: deltanedas <@deltanedas:kde.org>
---
diff --git a/Content.Client/PDA/PDABoundUserInterface.cs b/Content.Client/PDA/PDABoundUserInterface.cs
index 52507df703..4553b23fd3 100644
--- a/Content.Client/PDA/PDABoundUserInterface.cs
+++ b/Content.Client/PDA/PDABoundUserInterface.cs
@@ -55,11 +55,6 @@ namespace Content.Client.PDA
SendMessage(new ItemSlotButtonPressedEvent(PDAComponent.PDAPenSlotId));
};
- _menu.ActivateUplinkButton.OnPressed += _ =>
- {
- SendMessage(new PDAShowUplinkMessage());
- };
-
_menu.ActivateMusicButton.OnPressed += _ =>
{
SendMessage(new PDAShowMusicMessage());
@@ -70,6 +65,16 @@ namespace Content.Client.PDA
SendMessage(new PDAShowRingtoneMessage());
};
+ _menu.ShowUplinkButton.OnPressed += _ =>
+ {
+ SendMessage(new PDAShowUplinkMessage());
+ };
+
+ _menu.LockUplinkButton.OnPressed += _ =>
+ {
+ SendMessage(new PDALockUplinkMessage());
+ };
+
_menu.OnProgramItemPressed += ActivateCartridge;
_menu.OnInstallButtonPressed += InstallCartridge;
_menu.OnUninstallButtonPressed += UninstallCartridge;
diff --git a/Content.Client/PDA/PDAMenu.xaml b/Content.Client/PDA/PDAMenu.xaml
index d54de2c6bb..e1c0e706d5 100644
--- a/Content.Client/PDA/PDAMenu.xaml
+++ b/Content.Client/PDA/PDAMenu.xaml
@@ -62,14 +62,18 @@
Text="{Loc 'crew-manifest-button-label'}"
Description="{Loc 'crew-manifest-button-description'}"
Visible="False" />
-
+
+
programs)
diff --git a/Content.Server/PDA/PDASystem.cs b/Content.Server/PDA/PDASystem.cs
index f0448003fc..6c4d63b54a 100644
--- a/Content.Server/PDA/PDASystem.cs
+++ b/Content.Server/PDA/PDASystem.cs
@@ -137,6 +137,15 @@ namespace Content.Server.PDA
_store.ToggleUi(msg.Session.AttachedEntity!.Value, uid, store);
break;
}
+ case PDALockUplinkMessage _:
+ {
+ if (TryComp(uid, out var uplink))
+ {
+ _ringer.LockUplink(uid, uplink);
+ UpdatePdaUi(uid, pda);
+ }
+ break;
+ }
}
}
diff --git a/Content.Server/PDA/Ringer/RingerSystem.cs b/Content.Server/PDA/Ringer/RingerSystem.cs
index a75dcce74d..f4fd1173e6 100644
--- a/Content.Server/PDA/Ringer/RingerSystem.cs
+++ b/Content.Server/PDA/Ringer/RingerSystem.cs
@@ -79,6 +79,21 @@ namespace Content.Server.PDA.Ringer
}
}
+ ///
+ /// Locks the uplink and closes the window, if its open
+ ///
+ ///
+ /// Will not update the PDA ui so you must do that yourself if needed
+ ///
+ public void LockUplink(EntityUid uid, RingerUplinkComponent? uplink)
+ {
+ if (!Resolve(uid, ref uplink, true))
+ return;
+
+ uplink.Unlocked = false;
+ _ui.TryCloseAll(uid, StoreUiKey.Key);
+ }
+
public void RandomizeRingtone(EntityUid uid, RingerComponent ringer, MapInitEvent args)
{
UpdateRingerRingtone(ringer, GenerateRingtone());
diff --git a/Content.Shared/PDA/PDAMessagesUI.cs b/Content.Shared/PDA/PDAMessagesUI.cs
index a74e1515ee..d0e32d8723 100644
--- a/Content.Shared/PDA/PDAMessagesUI.cs
+++ b/Content.Shared/PDA/PDAMessagesUI.cs
@@ -1,49 +1,39 @@
using Robust.Shared.Serialization;
-namespace Content.Shared.PDA
-{
- [Serializable, NetSerializable]
- public sealed class PDAToggleFlashlightMessage : BoundUserInterfaceMessage
- {
- public PDAToggleFlashlightMessage()
- {
-
- }
- }
-
- [Serializable, NetSerializable]
- public sealed class PDAShowRingtoneMessage : BoundUserInterfaceMessage
- {
- public PDAShowRingtoneMessage()
- {
-
- }
- }
+namespace Content.Shared.PDA;
- [Serializable, NetSerializable]
- public sealed class PDAShowUplinkMessage : BoundUserInterfaceMessage
- {
- public PDAShowUplinkMessage()
- {
+[Serializable, NetSerializable]
+public sealed class PDAToggleFlashlightMessage : BoundUserInterfaceMessage
+{
+ public PDAToggleFlashlightMessage() { }
+}
- }
- }
+[Serializable, NetSerializable]
+public sealed class PDAShowRingtoneMessage : BoundUserInterfaceMessage
+{
+ public PDAShowRingtoneMessage() { }
+}
- [Serializable, NetSerializable]
- public sealed class PDAShowMusicMessage : BoundUserInterfaceMessage
- {
- public PDAShowMusicMessage()
- {
+[Serializable, NetSerializable]
+public sealed class PDAShowUplinkMessage : BoundUserInterfaceMessage
+{
+ public PDAShowUplinkMessage() { }
+}
- }
- }
+[Serializable, NetSerializable]
+public sealed class PDALockUplinkMessage : BoundUserInterfaceMessage
+{
+ public PDALockUplinkMessage() { }
+}
- [Serializable, NetSerializable]
- public sealed class PDARequestUpdateInterfaceMessage : BoundUserInterfaceMessage
- {
- public PDARequestUpdateInterfaceMessage()
- {
+[Serializable, NetSerializable]
+public sealed class PDAShowMusicMessage : BoundUserInterfaceMessage
+{
+ public PDAShowMusicMessage() { }
+}
- }
- }
+[Serializable, NetSerializable]
+public sealed class PDARequestUpdateInterfaceMessage : BoundUserInterfaceMessage
+{
+ public PDARequestUpdateInterfaceMessage() { }
}
diff --git a/Resources/Locale/en-US/pda/pda-component.ftl b/Resources/Locale/en-US/pda/pda-component.ftl
index 4feb86252e..1eb1f829d8 100644
--- a/Resources/Locale/en-US/pda/pda-component.ftl
+++ b/Resources/Locale/en-US/pda/pda-component.ftl
@@ -16,9 +16,11 @@ comp-pda-io-program-fallback-title = Program
comp-pda-io-no-programs-available = No Programs Available
-pda-bound-user-interface-uplink-tab-title = Uplink
+pda-bound-user-interface-show-uplink-title = Open Uplink
+pda-bound-user-interface-show-uplink-description = Access your uplink
-pda-bound-user-interface-uplink-tab-description = Access your uplink
+pda-bound-user-interface-lock-uplink-title = Lock Uplink
+pda-bound-user-interface-lock-uplink-description = Prevent anyone from accessing your uplink without the code
comp-pda-ui-menu-title = PDA