Skip to content

Commit 0dc9c88

Browse files
committed
Merge branch 'master-ru' of https://gitlab.workbench.network/Workbench-Team/space-station-14 into arumoon-server
# Conflicts: # Resources/Locale/en-US/ss14-ru/prototypes/actions/types.ftl # Resources/Locale/en-US/ss14-ru/prototypes/entities/objects/devices/pda.ftl # Resources/Locale/ru-RU/ss14-ru/prototypes/actions/types.ftl # Resources/Locale/ru-RU/ss14-ru/prototypes/entities/objects/devices/pda.ftl # Resources/Maps/metastation.yml # Resources/Prototypes/Catalog/Fills/Lockers/security.yml # Resources/Prototypes/Maps/Driller.yml # Resources/migration.yml
2 parents 1c50732 + b9b7a11 commit 0dc9c88

File tree

256 files changed

+201503
-60898
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+201503
-60898
lines changed

Content.Client/Cargo/Systems/ClientPriceGunSystem.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Content.Shared.Cargo.Components;
12
using Content.Shared.Timing;
23
using Content.Shared.Cargo.Systems;
34

@@ -10,9 +11,9 @@ public sealed class ClientPriceGunSystem : SharedPriceGunSystem
1011
{
1112
[Dependency] private readonly UseDelaySystem _useDelay = default!;
1213

13-
protected override bool GetPriceOrBounty(EntityUid priceGunUid, EntityUid target, EntityUid user)
14+
protected override bool GetPriceOrBounty(Entity<PriceGunComponent> entity, EntityUid target, EntityUid user)
1415
{
15-
if (!TryComp(priceGunUid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((priceGunUid, useDelay)))
16+
if (!TryComp(entity, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((entity, useDelay)))
1617
return false;
1718

1819
// It feels worse if the cooldown is predicted but the popup isn't! So only do the cooldown reset on the server.

Content.Client/Clothing/Systems/ChameleonClothingSystem.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Linq;
2+
using Content.Client.PDA;
23
using Content.Shared.Clothing.Components;
34
using Content.Shared.Clothing.EntitySystems;
45
using Content.Shared.Inventory;
@@ -51,6 +52,15 @@ protected override void UpdateSprite(EntityUid uid, EntityPrototype proto)
5152
{
5253
sprite.CopyFrom(otherSprite);
5354
}
55+
56+
// Edgecase for PDAs to include visuals when UI is open
57+
if (TryComp(uid, out PdaBorderColorComponent? borderColor)
58+
&& proto.TryGetComponent(out PdaBorderColorComponent? otherBorderColor, _factory))
59+
{
60+
borderColor.BorderColor = otherBorderColor.BorderColor;
61+
borderColor.AccentHColor = otherBorderColor.AccentHColor;
62+
borderColor.AccentVColor = otherBorderColor.AccentVColor;
63+
}
5464
}
5565

5666
/// <summary>

Content.Client/Clothing/UI/ChameleonBoundUserInterface.cs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
1-
using Content.Client.Clothing.Systems;
1+
using Content.Client.Clothing.Systems;
22
using Content.Shared.Clothing.Components;
3+
using Content.Shared.Tag;
4+
using Content.Shared.Prototypes;
35
using JetBrains.Annotations;
46
using Robust.Client.GameObjects;
57
using Robust.Client.UserInterface;
8+
using Robust.Shared.Prototypes;
69

710
namespace Content.Client.Clothing.UI;
811

912
[UsedImplicitly]
1013
public sealed class ChameleonBoundUserInterface : BoundUserInterface
1114
{
15+
[Dependency] private readonly IComponentFactory _factory = default!;
16+
[Dependency] private readonly IPrototypeManager _proto = default!;
1217
private readonly ChameleonClothingSystem _chameleon;
18+
private readonly TagSystem _tag;
1319

1420
[ViewVariables]
1521
private ChameleonMenu? _menu;
1622

1723
public ChameleonBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
1824
{
1925
_chameleon = EntMan.System<ChameleonClothingSystem>();
26+
_tag = EntMan.System<TagSystem>();
2027
}
2128

2229
protected override void Open()
@@ -34,7 +41,24 @@ protected override void UpdateState(BoundUserInterfaceState state)
3441
return;
3542

3643
var targets = _chameleon.GetValidTargets(st.Slot);
37-
_menu?.UpdateState(targets, st.SelectedId);
44+
if (st.RequiredTag != null)
45+
{
46+
var newTargets = new List<string>();
47+
foreach (var target in targets)
48+
{
49+
if (string.IsNullOrEmpty(target) || !_proto.TryIndex(target, out EntityPrototype? proto))
50+
continue;
51+
52+
if (!proto.TryGetComponent(out TagComponent? tag, _factory) || !_tag.HasTag(tag, st.RequiredTag))
53+
continue;
54+
55+
newTargets.Add(target);
56+
}
57+
_menu?.UpdateState(newTargets, st.SelectedId);
58+
} else
59+
{
60+
_menu?.UpdateState(targets, st.SelectedId);
61+
}
3862
}
3963

4064
private void OnIdSelected(string selectedId)

Content.Client/Holopad/HolopadWindow.xaml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727
<!-- Header text -->
2828
<BoxContainer MinHeight="60" Orientation="Vertical" VerticalAlignment="Center">
2929
<Label Name="CallStatusText" Margin="10 5 10 0" ReservesSpace="False"/>
30-
<RichTextLabel Name="CallerIdText" HorizontalAlignment="Center" Margin="0 0 0 0" ReservesSpace="False"/>
30+
<BoxContainer Name="CallerIdContainer" Orientation="Vertical" ReservesSpace="False">
31+
<RichTextLabel Name="CallerIdText" HorizontalAlignment="Center" Margin="0 0 0 0"/>
32+
<Label Text="{Loc 'holopad-window-relay-label'}" Margin="10 10 10 0" ReservesSpace="False"/>
33+
<RichTextLabel Name="HolopadIdText" HorizontalAlignment="Center" Margin="0 0 0 10"/>
34+
</BoxContainer>
3135
</BoxContainer>
3236

3337
<!-- Controls (the answer call button is absent when the phone is not ringing) -->
@@ -68,18 +72,25 @@
6872
<PanelContainer Name="HolopadContactListHeaderPanel">
6973
<Label Text="{Loc 'holopad-window-select-contact-from-list'}" HorizontalAlignment="Center" Margin="0 3 0 3"/>
7074
</PanelContainer>
71-
75+
7276
<PanelContainer Name="HolopadContactListPanel">
73-
<ScrollContainer HorizontalExpand="True" VerticalExpand="True" Margin="8, 8, 8, 8" MinHeight="256">
77+
<BoxContainer Orientation="Vertical">
78+
79+
<!-- Contact filter -->
80+
<LineEdit Name="SearchLineEdit" HorizontalExpand="True" Margin="4, 4, 4, 0"
81+
PlaceHolder="{Loc holopad-window-filter-line-placeholder}" />
7482

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

80-
<!-- Container for the contacts -->
81-
<BoxContainer Name="ContactsList" Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True" Margin="10 0 10 0"/>
82-
</ScrollContainer>
85+
<!-- If there is no data yet, this will be displayed -->
86+
<BoxContainer Name="FetchingAvailableHolopadsContainer" HorizontalAlignment="Center" HorizontalExpand="True" VerticalExpand="True" ReservesSpace="False">
87+
<Label Text="{Loc 'holopad-window-fetching-contacts-list'}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
88+
</BoxContainer>
89+
90+
<!-- Container for the contacts -->
91+
<BoxContainer Name="ContactsList" Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True" Margin="10 0 10 0"/>
92+
</ScrollContainer>
93+
</BoxContainer>
8394
</PanelContainer>
8495
</BoxContainer>
8596

Content.Client/Holopad/HolopadWindow.xaml.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ public void UpdateState(Dictionary<NetEntity, string> holopads)
171171

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

175176
CallerIdText.SetMessage(FormattedMessage.FromMarkupOrThrow(callerId));
177+
HolopadIdText.SetMessage(FormattedMessage.FromMarkupOrThrow(holoapdId));
176178
LockOutIdText.SetMessage(FormattedMessage.FromMarkupOrThrow(callerId));
177179

178180
// Sort holopads alphabetically
@@ -236,10 +238,13 @@ private void UpdateAppearance()
236238
// Make / update required children
237239
foreach (var child in ContactsList.Children)
238240
{
239-
if (child is not HolopadContactButton)
241+
if (child is not HolopadContactButton contactButton)
240242
continue;
241243

242-
var contactButton = (HolopadContactButton)child;
244+
var passesFilter = string.IsNullOrEmpty(SearchLineEdit.Text) ||
245+
contactButton.Text?.Contains(SearchLineEdit.Text, StringComparison.CurrentCultureIgnoreCase) == true;
246+
247+
contactButton.Visible = passesFilter;
243248
contactButton.Disabled = (_currentState != TelephoneState.Idle || lockButtons);
244249
}
245250

@@ -290,7 +295,7 @@ private void UpdateAppearance()
290295
FetchingAvailableHolopadsContainer.Visible = (ContactsList.ChildCount == 0);
291296
ActiveCallControlsContainer.Visible = (_currentState != TelephoneState.Idle || _currentUiKey == HolopadUiKey.AiRequestWindow);
292297
CallPlacementControlsContainer.Visible = !ActiveCallControlsContainer.Visible;
293-
CallerIdText.Visible = (_currentState == TelephoneState.Ringing);
298+
CallerIdContainer.Visible = (_currentState == TelephoneState.Ringing);
294299
AnswerCallButton.Visible = (_currentState == TelephoneState.Ringing);
295300
}
296301

@@ -316,6 +321,7 @@ public HolopadContactButton()
316321
HorizontalExpand = true;
317322
SetHeight = 32;
318323
Margin = new Thickness(0f, 1f, 0f, 1f);
324+
ReservesSpace = false;
319325
}
320326

321327
public void UpdateValues(NetEntity netEntity, string label)

Content.Client/Lobby/LobbyState.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@
55
using Content.Client.Message;
66
using Content.Client.UserInterface.Systems.Chat;
77
using Content.Client.Voting;
8+
using Content.Shared.CCVar;
89
using Robust.Client;
910
using Robust.Client.Console;
1011
using Robust.Client.ResourceManagement;
1112
using Robust.Client.UserInterface;
1213
using Robust.Client.UserInterface.Controls;
14+
using Robust.Shared.Configuration;
1315
using Robust.Shared.Timing;
1416

15-
1617
namespace Content.Client.Lobby
1718
{
1819
public sealed class LobbyState : Robust.Client.State.State
1920
{
2021
[Dependency] private readonly IBaseClient _baseClient = default!;
22+
[Dependency] private readonly IConfigurationManager _cfg = default!;
2123
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
2224
[Dependency] private readonly IEntityManager _entityManager = default!;
2325
[Dependency] private readonly IResourceCache _resourceCache = default!;
@@ -49,7 +51,17 @@ protected override void Startup()
4951

5052
_voteManager.SetPopupContainer(Lobby.VoteContainer);
5153
LayoutContainer.SetAnchorPreset(Lobby, LayoutContainer.LayoutPreset.Wide);
52-
Lobby.ServerName.Text = _baseClient.GameInfo?.ServerName; //The eye of refactor gazes upon you...
54+
55+
var lobbyNameCvar = _cfg.GetCVar(CCVars.ServerLobbyName);
56+
var serverName = _baseClient.GameInfo?.ServerName ?? string.Empty;
57+
58+
Lobby.ServerName.Text = string.IsNullOrEmpty(lobbyNameCvar)
59+
? Loc.GetString("ui-lobby-title", ("serverName", serverName))
60+
: lobbyNameCvar;
61+
62+
var width = _cfg.GetCVar(CCVars.ServerLobbyRightPanelWidth);
63+
Lobby.RightSide.SetWidth = width;
64+
5365
UpdateLobbyUi();
5466

5567
Lobby.CharacterPreview.CharacterSetupButton.OnPressed += OnSetupPressed;

Content.Client/Lobby/UI/LobbyGui.xaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,12 @@
6262
<Control Access="Public" Visible="False" Name="CharacterSetupState" VerticalExpand="True" />
6363
</BoxContainer>
6464
<!-- Right Panel -->
65-
<PanelContainer Name="RightSide" StyleClasses="AngleRect" HorizontalAlignment="Right" VerticalExpand="True"
65+
<PanelContainer Name="RightSide" Access="Public" StyleClasses="AngleRect" HorizontalAlignment="Right" VerticalExpand="True"
6666
VerticalAlignment="Stretch">
6767
<BoxContainer Orientation="Vertical" HorizontalExpand="True">
6868
<!-- Top row -->
6969
<BoxContainer Orientation="Horizontal" MinSize="0 40" Name="HeaderContainer" Access="Public"
7070
SeparationOverride="4">
71-
<Label Margin="8 0 0 0" StyleClasses="LabelHeadingBigger" VAlign="Center"
72-
Text="{Loc 'ui-lobby-title'}" />
7371
<Label Name="ServerName" Access="Public" StyleClasses="LabelHeadingBigger" VAlign="Center"
7472
HorizontalExpand="True" HorizontalAlignment="Center" />
7573
</BoxContainer>

Content.Client/PDA/PdaMenu.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ public void UpdateState(PdaUpdateState state)
141141
_pdaOwner = state.PdaOwnerInfo.ActualOwnerName;
142142
PdaOwnerLabel.SetMarkup(Loc.GetString("comp-pda-ui-owner",
143143
("actualOwnerName", _pdaOwner)));
144+
PdaOwnerLabel.Visible = true;
145+
}
146+
else
147+
{
148+
PdaOwnerLabel.Visible = false;
144149
}
145150

146151

Content.Client/PDA/PdaSystem.cs

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,8 @@
11
using Content.Shared.PDA;
2-
using Content.Shared.Light;
3-
using Robust.Client.GameObjects;
42

53
namespace Content.Client.PDA;
64

75
public sealed class PdaSystem : SharedPdaSystem
86
{
9-
public override void Initialize()
10-
{
11-
base.Initialize();
127

13-
SubscribeLocalEvent<PdaComponent, AppearanceChangeEvent>(OnAppearanceChange);
14-
}
15-
16-
private void OnAppearanceChange(EntityUid uid, PdaComponent component, ref AppearanceChangeEvent args)
17-
{
18-
if (args.Sprite == null)
19-
return;
20-
21-
if (Appearance.TryGetData<bool>(uid, UnpoweredFlashlightVisuals.LightOn, out var isFlashlightOn, args.Component))
22-
args.Sprite.LayerSetVisible(PdaVisualLayers.Flashlight, isFlashlightOn);
23-
24-
if (Appearance.TryGetData<bool>(uid, PdaVisuals.IdCardInserted, out var isCardInserted, args.Component))
25-
args.Sprite.LayerSetVisible(PdaVisualLayers.IdLight, isCardInserted);
26-
}
27-
28-
protected override void OnComponentInit(EntityUid uid, PdaComponent component, ComponentInit args)
29-
{
30-
base.OnComponentInit(uid, component, args);
31-
32-
if (!TryComp<SpriteComponent>(uid, out var sprite))
33-
return;
34-
35-
if (component.State != null)
36-
sprite.LayerSetState(PdaVisualLayers.Base, component.State);
37-
38-
sprite.LayerSetVisible(PdaVisualLayers.Flashlight, component.FlashlightOn);
39-
sprite.LayerSetVisible(PdaVisualLayers.IdLight, component.IdSlot.StartingItem != null);
40-
}
41-
42-
public enum PdaVisualLayers : byte
43-
{
44-
Base,
45-
Flashlight,
46-
IdLight
47-
}
488
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Content.Shared.Light;
2+
using Content.Shared.PDA;
3+
using Robust.Client.GameObjects;
4+
5+
namespace Content.Client.PDA;
6+
7+
public sealed class PdaVisualizerSystem : VisualizerSystem<PdaVisualsComponent>
8+
{
9+
protected override void OnAppearanceChange(EntityUid uid, PdaVisualsComponent comp, ref AppearanceChangeEvent args)
10+
{
11+
if (args.Sprite == null)
12+
return;
13+
14+
if (AppearanceSystem.TryGetData<string>(uid, PdaVisuals.PdaType, out var pdaType, args.Component))
15+
args.Sprite.LayerSetState(PdaVisualLayers.Base, pdaType);
16+
17+
if (AppearanceSystem.TryGetData<bool>(uid, UnpoweredFlashlightVisuals.LightOn, out var isFlashlightOn, args.Component))
18+
args.Sprite.LayerSetVisible(PdaVisualLayers.Flashlight, isFlashlightOn);
19+
20+
if (AppearanceSystem.TryGetData<bool>(uid, PdaVisuals.IdCardInserted, out var isCardInserted, args.Component))
21+
args.Sprite.LayerSetVisible(PdaVisualLayers.IdLight, isCardInserted);
22+
}
23+
24+
public enum PdaVisualLayers : byte
25+
{
26+
Base,
27+
Flashlight,
28+
IdLight
29+
}
30+
}

0 commit comments

Comments
 (0)