Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/wizards/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
VigersRay committed Dec 29, 2024
2 parents f5e94f7 + 072b973 commit 036210f
Show file tree
Hide file tree
Showing 41 changed files with 500 additions and 84 deletions.
31 changes: 21 additions & 10 deletions Content.Client/Holopad/HolopadWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
<!-- Header text -->
<BoxContainer MinHeight="60" Orientation="Vertical" VerticalAlignment="Center">
<Label Name="CallStatusText" Margin="10 5 10 0" ReservesSpace="False"/>
<RichTextLabel Name="CallerIdText" HorizontalAlignment="Center" Margin="0 0 0 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"/>
<RichTextLabel Name="HolopadIdText" HorizontalAlignment="Center" Margin="0 0 0 10"/>
</BoxContainer>
</BoxContainer>

<!-- Controls (the answer call button is absent when the phone is not ringing) -->
Expand Down Expand Up @@ -68,18 +72,25 @@
<PanelContainer Name="HolopadContactListHeaderPanel">
<Label Text="{Loc 'holopad-window-select-contact-from-list'}" HorizontalAlignment="Center" Margin="0 3 0 3"/>
</PanelContainer>

<PanelContainer Name="HolopadContactListPanel">
<ScrollContainer HorizontalExpand="True" VerticalExpand="True" Margin="8, 8, 8, 8" MinHeight="256">
<BoxContainer Orientation="Vertical">

<!-- Contact filter -->
<LineEdit Name="SearchLineEdit" HorizontalExpand="True" Margin="4, 4, 4, 0"
PlaceHolder="{Loc holopad-window-filter-line-placeholder}" />

<!-- If there is no data yet, this will be displayed -->
<BoxContainer Name="FetchingAvailableHolopadsContainer" HorizontalAlignment="Center" HorizontalExpand="True" VerticalExpand="True" ReservesSpace="False">
<Label Text="{Loc 'holopad-window-fetching-contacts-list'}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</BoxContainer>
<ScrollContainer HorizontalExpand="True" VerticalExpand="True" Margin="8, 8, 8, 8" MinHeight="256">

<!-- Container for the contacts -->
<BoxContainer Name="ContactsList" Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True" Margin="10 0 10 0"/>
</ScrollContainer>
<!-- If there is no data yet, this will be displayed -->
<BoxContainer Name="FetchingAvailableHolopadsContainer" HorizontalAlignment="Center" HorizontalExpand="True" VerticalExpand="True" ReservesSpace="False">
<Label Text="{Loc 'holopad-window-fetching-contacts-list'}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</BoxContainer>

<!-- Container for the contacts -->
<BoxContainer Name="ContactsList" Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True" Margin="10 0 10 0"/>
</ScrollContainer>
</BoxContainer>
</PanelContainer>
</BoxContainer>

Expand Down
12 changes: 9 additions & 3 deletions Content.Client/Holopad/HolopadWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ public void UpdateState(Dictionary<NetEntity, string> holopads)

// Caller ID text
var callerId = _telephoneSystem.GetFormattedCallerIdForEntity(telephone.LastCallerId.Item1, telephone.LastCallerId.Item2, Color.LightGray, "Default", 11);
var holoapdId = _telephoneSystem.GetFormattedDeviceIdForEntity(telephone.LastCallerId.Item3, Color.LightGray, "Default", 11);

CallerIdText.SetMessage(FormattedMessage.FromMarkupOrThrow(callerId));
HolopadIdText.SetMessage(FormattedMessage.FromMarkupOrThrow(holoapdId));
LockOutIdText.SetMessage(FormattedMessage.FromMarkupOrThrow(callerId));

// Sort holopads alphabetically
Expand Down Expand Up @@ -236,10 +238,13 @@ private void UpdateAppearance()
// Make / update required children
foreach (var child in ContactsList.Children)
{
if (child is not HolopadContactButton)
if (child is not HolopadContactButton contactButton)
continue;

var contactButton = (HolopadContactButton)child;
var passesFilter = string.IsNullOrEmpty(SearchLineEdit.Text) ||
contactButton.Text?.Contains(SearchLineEdit.Text, StringComparison.CurrentCultureIgnoreCase) == true;

contactButton.Visible = passesFilter;
contactButton.Disabled = (_currentState != TelephoneState.Idle || lockButtons);
}

Expand Down Expand Up @@ -290,7 +295,7 @@ private void UpdateAppearance()
FetchingAvailableHolopadsContainer.Visible = (ContactsList.ChildCount == 0);
ActiveCallControlsContainer.Visible = (_currentState != TelephoneState.Idle || _currentUiKey == HolopadUiKey.AiRequestWindow);
CallPlacementControlsContainer.Visible = !ActiveCallControlsContainer.Visible;
CallerIdText.Visible = (_currentState == TelephoneState.Ringing);
CallerIdContainer.Visible = (_currentState == TelephoneState.Ringing);
AnswerCallButton.Visible = (_currentState == TelephoneState.Ringing);
}

Expand All @@ -316,6 +321,7 @@ public HolopadContactButton()
HorizontalExpand = true;
SetHeight = 32;
Margin = new Thickness(0f, 1f, 0f, 1f);
ReservesSpace = false;
}

public void UpdateValues(NetEntity netEntity, string label)
Expand Down
5 changes: 3 additions & 2 deletions Content.Server/Telephone/TelephoneSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public override void Update(float frameTime)

break;

// Try to hang up if their has been no recent in-call activity
// Try to hang up if there has been no recent in-call activity
case TelephoneState.InCall:
if (_timing.CurTime > telephone.StateStartTime + TimeSpan.FromSeconds(telephone.IdlingTimeout))
EndTelephoneCalls(entity);
Expand Down Expand Up @@ -214,7 +214,8 @@ private bool TryCallTelephone(Entity<TelephoneComponent> source, Entity<Telephon
source.Comp.LinkedTelephones.Add(receiver);
source.Comp.Muted = options?.MuteSource == true;

receiver.Comp.LastCallerId = GetNameAndJobOfCallingEntity(user); // This will be networked when the state changes
var callerInfo = GetNameAndJobOfCallingEntity(user);
receiver.Comp.LastCallerId = (callerInfo.Item1, callerInfo.Item2, Name(source)); // This will be networked when the state changes
receiver.Comp.LinkedTelephones.Add(source);
receiver.Comp.Muted = options?.MuteReceiver == true;

Expand Down
17 changes: 17 additions & 0 deletions Content.Shared/Telephone/SharedTelephoneSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,21 @@ public string GetFormattedCallerIdForEntity(string? presumedName, string? presum

return callerId;
}

public string GetFormattedDeviceIdForEntity(string? deviceName, Color fontColor, string fontType = "Default", int fontSize = 12)
{
if (deviceName == null)
{
return Loc.GetString("chat-telephone-unknown-device",
("color", fontColor),
("fontType", fontType),
("fontSize", fontSize));
}

return Loc.GetString("chat-telephone-device-id",
("deviceName", deviceName),
("color", fontColor),
("fontType", fontType),
("fontSize", fontSize));
}
}
3 changes: 2 additions & 1 deletion Content.Shared/Telephone/TelephoneComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ public sealed partial class TelephoneComponent : Component

/// <summary>
/// The presumed name and/or job of the last person to call this telephone
/// and the name of the device that they used to do so
/// </summary>
[ViewVariables, AutoNetworkedField]
public (string?, string?) LastCallerId;
public (string?, string?, string?) LastCallerId;
}

#region: Telephone events
Expand Down
85 changes: 44 additions & 41 deletions Resources/Changelog/Changelog.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,4 @@
Entries:
- author: Moomoobeef
changes:
- message: Added flavors to an array of previously indescribable things.
type: Add
id: 7258
time: '2024-09-01T00:03:30.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/31685
- author: Ilya246
changes:
- message: Fixed tip 26 being misinformation about the tesla. It now displays truthful
information.
type: Fix
id: 7259
time: '2024-09-01T11:03:23.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/31705
- author: yuitop
changes:
- message: space dragon fire breath ability now has cursor indicator
type: Tweak
id: 7260
time: '2024-09-01T19:28:12.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/31725
- author: EmoGarbage404
changes:
- message: The grappling gun is now available inside the salvage vendor. Additional
ones can be scavenged in space.
type: Add
- message: Removed the grappling gun from science research and lathes.
type: Remove
- message: Fixed issue that made the rope from the grappling gun not appear.
type: Fix
id: 7261
time: '2024-09-02T04:33:25.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/31737
- author: yuitop
changes:
- message: added in-hand sprite for Smile the Slime
type: Add
id: 7262
time: '2024-09-02T04:36:05.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/31731
- author: EmoGarbage404
changes:
- message: Space Carp and Sharkminnows are a bit weaker overall.
Expand Down Expand Up @@ -3935,3 +3894,47 @@
id: 7757
time: '2024-12-28T14:49:03.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/33704
- author: chromiumboy
changes:
- message: The holoapd UI has been updated to include a text-based filter for the
contacts list, and also to specify the name of the holopad that incoming calls
originate from
type: Tweak
id: 7758
time: '2024-12-28T23:33:16.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/34055
- author: zHonys
changes:
- message: Smile can now use hats
type: Add
id: 7759
time: '2024-12-29T01:49:05.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/33924
- author: ewokswagger
changes:
- message: Pizza deliveries are now guaranteed to have at least one cotton pizza.
type: Tweak
id: 7760
time: '2024-12-29T01:50:49.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/33997
- author: ArtisticRoomba, JuneSzalkowska
changes:
- message: New cotton dough slices and cotton dough rolls.
type: Add
- message: New cotton baguette, cotton crostini, cotton chevre-chaud, cotton bagel,
and cotton croissant recipes. You can make them by following the recipes for
regular baguettes, bagels, etc, but use cotton dough instead.
type: Add
- message: Slicing dough into thirds now divides the nutriment value into thirds.
Previously you could slice dough to triple your nutriment.
type: Fix
id: 7761
time: '2024-12-29T02:02:25.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/33508
- author: Velcroboy
changes:
- message: Rolling joints no longer requires a cigarette filter.
type: Tweak
id: 7762
time: '2024-12-29T03:25:40.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/34106
Loading

0 comments on commit 036210f

Please sign in to comment.