]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Holopad UI tweak for incoming calls (#34137)
authorchromiumboy <50505512+chromiumboy@users.noreply.github.com>
Tue, 31 Dec 2024 10:37:28 +0000 (04:37 -0600)
committerGitHub <noreply@github.com>
Tue, 31 Dec 2024 10:37:28 +0000 (11:37 +0100)
* Initial commit

* Update

* Comment correction

* Minor margin increase

Content.Client/Holopad/HolopadWindow.xaml
Content.Server/Telephone/TelephoneSystem.cs
Resources/Locale/en-US/telephone/telephone.ftl

index 882f918158a34ba31a3db05f9861d48c052076c8..5a7ad05bea8c85d0e8eb822f3643d6a800b67d36 100644 (file)
@@ -29,7 +29,7 @@
                     <Label Name="CallStatusText" Margin="10 5 10 0" ReservesSpace="False"/>
                     <BoxContainer Name="CallerIdContainer" Orientation="Vertical" ReservesSpace="False">
                         <RichTextLabel Name="CallerIdText" HorizontalAlignment="Center" Margin="0 0 0 0"/>
-                        <Label Text="{Loc 'holopad-window-relay-label'}" Margin="10 5 10 0" ReservesSpace="False"/>
+                        <Label Text="{Loc 'holopad-window-relay-label'}" Margin="10 10 10 0" ReservesSpace="False"/>
                         <RichTextLabel Name="HolopadIdText" HorizontalAlignment="Center" Margin="0 0 0 10"/>
                     </BoxContainer>
                 </BoxContainer>
index cb0c72939aaa86c3263bd91c77b09bfbda9e6247..79e0fc884eb348ab9c38025b3aeda6fc8c7af1de 100644 (file)
@@ -7,8 +7,11 @@ using Content.Server.Speech;
 using Content.Server.Speech.Components;
 using Content.Shared.Chat;
 using Content.Shared.Database;
+using Content.Shared.Labels.Components;
 using Content.Shared.Mind.Components;
 using Content.Shared.Power;
+using Content.Shared.Silicons.StationAi;
+using Content.Shared.Silicons.Borgs.Components;
 using Content.Shared.Speech;
 using Content.Shared.Telephone;
 using Robust.Server.GameObjects;
@@ -19,8 +22,6 @@ using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 using Robust.Shared.Replays;
 using System.Linq;
-using Content.Shared.Silicons.StationAi;
-using Content.Shared.Silicons.Borgs.Components;
 
 namespace Content.Server.Telephone;
 
@@ -215,7 +216,14 @@ public sealed class TelephoneSystem : SharedTelephoneSystem
         source.Comp.Muted = options?.MuteSource == true;
 
         var callerInfo = GetNameAndJobOfCallingEntity(user);
-        receiver.Comp.LastCallerId = (callerInfo.Item1, callerInfo.Item2, Name(source)); // This will be networked when the state changes
+
+        // Base the name of the device on its label
+        string? deviceName = null;
+
+        if (TryComp<LabelComponent>(source, out var label))
+            deviceName = label.CurrentLabel;
+
+        receiver.Comp.LastCallerId = (callerInfo.Item1, callerInfo.Item2, deviceName); // This will be networked when the state changes
         receiver.Comp.LinkedTelephones.Add(source);
         receiver.Comp.Muted = options?.MuteReceiver == true;
 
index b1b27768e6ec0a2a61a335de7f41c5fc4c95827e..67e54c26f3080157c16077a07868a60ccce1a769 100644 (file)
@@ -6,5 +6,5 @@ chat-telephone-message-wrap-bold = [color={$color}][bold]{$name}[/bold] {$verb},
 chat-telephone-unknown-caller = [color={$color}][font={$fontType} size={$fontSize}][bolditalic]Unknown caller[/bolditalic][/font][/color]
 chat-telephone-caller-id-with-job = [color={$color}][font={$fontType} size={$fontSize}][bold]{CAPITALIZE($callerName)} ({CAPITALIZE($callerJob)})[/bold][/font][/color]
 chat-telephone-caller-id-without-job = [color={$color}][font={$fontType} size={$fontSize}][bold]{CAPITALIZE($callerName)}[/bold][/font][/color]
-chat-telephone-unknown-device = [color={$color}][font={$fontType} size={$fontSize}][bolditalic]Unknown device[/bolditalic][/font][/color]
+chat-telephone-unknown-device = [color={$color}][font={$fontType} size={$fontSize}][bolditalic]Unknown source[/bolditalic][/font][/color]
 chat-telephone-device-id = [color={$color}][font={$fontType} size={$fontSize}][bold]{CAPITALIZE($deviceName)}[/bold][/font][/color]