Skip to content

Commit 3a37cb7

Browse files
committed
Merge branch 'master' into fathersoup
2 parents 5df6438 + 48ca915 commit 3a37cb7

File tree

2,610 files changed

+653752
-321765
lines changed

Some content is hidden

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

2,610 files changed

+653752
-321765
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/Resources/engineCommandPerms.yml @moonheart08 @Chief-Engineer
2020
/Resources/clientCommandPerms.yml @moonheart08 @Chief-Engineer
2121

22-
/Resources/Prototypes/Maps/ @Emisse
22+
/Resources/Prototypes/Maps/** @Emisse
2323

2424
/Resources/Prototypes/Body/ @DrSmugleaf # suffering
2525
/Resources/Prototypes/Entities/Mobs/Player/ @DrSmugleaf

.github/labeler.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"Changes: Sprites":
1+
"Changes: Sprites":
22
- changed-files:
33
- any-glob-to-any-file: '**/*.rsi/*.png'
44

@@ -23,6 +23,10 @@
2323
"Changes: Prototypes":
2424
- changed-files:
2525
# Equiv to any-glob-to-all as long as this has one matcher. If ALL changed files are not C# files, then apply label.
26-
- all-globs-to-all-files:
26+
- all-globs-to-any-file:
2727
- "Resources/Prototypes/**/*.yml"
2828
- '!Resources/Prototypes/Maps/**/*.yml'
29+
30+
"Changes: C#":
31+
- changed-files:
32+
- any-glob-to-any-file: '**/*.cs'

.github/workflows/labeler-approve.yml

+2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ on:
77
jobs:
88
remove_label:
99
permissions:
10+
contents: write
1011
pull-requests: write
12+
statuses: write
1113
if: github.event.review.state == 'approved'
1214
runs-on: ubuntu-latest
1315
steps:
File renamed without changes.

Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs

+19-3
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ public void UpdateState(IdCardConsoleBoundUserInterfaceState state)
150150

151151
FullNameLabel.Modulate = interfaceEnabled ? Color.White : Color.Gray;
152152
FullNameLineEdit.Editable = interfaceEnabled;
153+
154+
//ss220 format name fix start
155+
FullNameLineEdit.Text = FullNameLineEdit.Text
156+
.Replace('[', '(')
157+
.Replace(']', ')');
158+
//ss220 format name fix end
159+
153160
if (!fullNameDirty)
154161
{
155162
FullNameLineEdit.Text = state.TargetIdFullName ?? string.Empty;
@@ -159,6 +166,13 @@ public void UpdateState(IdCardConsoleBoundUserInterfaceState state)
159166

160167
JobTitleLabel.Modulate = interfaceEnabled ? Color.White : Color.Gray;
161168
JobTitleLineEdit.Editable = interfaceEnabled;
169+
170+
//ss220 format name fix start
171+
JobTitleLineEdit.Text = JobTitleLineEdit.Text
172+
.Replace('[', '(')
173+
.Replace(']', ')');
174+
//ss220 format name fix end
175+
162176
if (!jobTitleDirty)
163177
{
164178
JobTitleLineEdit.Text = state.TargetIdJobTitle ?? string.Empty;
@@ -194,10 +208,12 @@ private void SubmitData()
194208
var jobProtoDirty = _lastJobProto != null &&
195209
_jobPrototypeIds[JobPresetOptionButton.SelectedId] != _lastJobProto;
196210

211+
var fullNameSafe = FullNameLineEdit.Text.Replace("[", "(").Replace("]", ")"); //ss220 format name fix start
212+
var jobTitleSafe = JobTitleLineEdit.Text.Replace("[", "(").Replace("]", ")"); //ss220 format name fix start
213+
197214
_owner.SubmitData(
198-
FullNameLineEdit.Text,
199-
JobTitleLineEdit.Text,
200-
// Iterate over the buttons dictionary, filter by `Pressed`, only get key from the key/value pair
215+
fullNameSafe, //ss220 format name fix
216+
jobTitleSafe, //ss220 format name fix
201217
_accessButtons.ButtonsList.Where(x => x.Value.Pressed).Select(x => x.Key).ToList(),
202218
jobProtoDirty ? _jobPrototypeIds[JobPresetOptionButton.SelectedId] : string.Empty);
203219
}

Content.Client/Administration/UI/BanPanel/BanPanel.xaml.cs

+5-6
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ namespace Content.Client.Administration.UI.BanPanel;
2222
[GenerateTypedNameReferences]
2323
public sealed partial class BanPanel : DefaultWindow
2424
{
25-
public event Action<string?, (IPAddress, int)?, bool, byte[]?, bool, uint, string, NoteSeverity, int, string[]?, bool, bool>? BanSubmitted;
25+
public event Action<string?, (IPAddress, int)?, bool, ImmutableTypedHwid?, bool, uint, string, NoteSeverity, int, string[]?, bool, bool>? BanSubmitted;
2626
public event Action<string>? PlayerChanged;
2727
private string? PlayerUsername { get; set; }
2828
private (IPAddress, int)? IpAddress { get; set; }
29-
private byte[]? Hwid { get; set; }
29+
private ImmutableTypedHwid? Hwid { get; set; }
3030
private double TimeEntered { get; set; }
3131
private int statedRoundEntered { get; set; }
3232
private uint Multiplier { get; set; }
@@ -392,9 +392,8 @@ private void OnIpChanged()
392392
private void OnHwidChanged()
393393
{
394394
var hwidString = HwidLine.Text;
395-
var length = 3 * (hwidString.Length / 4) - hwidString.TakeLast(2).Count(c => c == '=');
396-
Hwid = new byte[length];
397-
if (HwidCheckbox.Pressed && !(string.IsNullOrEmpty(hwidString) && LastConnCheckbox.Pressed) && !Convert.TryFromBase64String(hwidString, Hwid, out _))
395+
ImmutableTypedHwid? hwid = null;
396+
if (HwidCheckbox.Pressed && !(string.IsNullOrEmpty(hwidString) && LastConnCheckbox.Pressed) && !ImmutableTypedHwid.TryParse(hwidString, out hwid))
398397
{
399398
ErrorLevel |= ErrorLevelEnum.Hwid;
400399
HwidLine.ModulateSelfOverride = Color.Red;
@@ -411,7 +410,7 @@ private void OnHwidChanged()
411410
Hwid = null;
412411
return;
413412
}
414-
Hwid = Convert.FromHexString(hwidString);
413+
Hwid = hwid;
415414
}
416415

417416
private void OnTypeChanged()

Content.Client/Administration/UI/Notes/NoteEdit.xaml

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<Label Name="ExpiryLabel" Text="{Loc admin-note-editor-expiry-label}" Visible="False" />
99
<HistoryLineEdit Name="ExpiryLineEdit" PlaceHolder="{Loc admin-note-editor-expiry-placeholder}"
1010
Visible="False" HorizontalExpand="True" />
11+
<OptionButton Name="ExpiryLengthDropdown" Visible="False" />
1112
</BoxContainer>
1213
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
1314
<OptionButton Name="TypeOption" HorizontalAlignment="Center" />

Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs

+51-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ public sealed partial class NoteEdit : FancyWindow
1717
[Dependency] private readonly IGameTiming _gameTiming = default!;
1818
[Dependency] private readonly IClientConsoleHost _console = default!;
1919

20+
private enum Multipliers
21+
{
22+
Minutes,
23+
Hours,
24+
Days,
25+
Weeks,
26+
Months,
27+
Years,
28+
Centuries
29+
}
30+
2031
public event Action<int, NoteType, string, NoteSeverity?, bool, DateTime?>? SubmitPressed;
2132

2233
public NoteEdit(SharedAdminNote? note, string playerName, bool canCreate, bool canEdit)
@@ -31,6 +42,20 @@ public NoteEdit(SharedAdminNote? note, string playerName, bool canCreate, bool c
3142

3243
ResetSubmitButton();
3344

45+
// It's weird to use minutes as the IDs, but it works and makes sense kind of :)
46+
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-minutes"), (int) Multipliers.Minutes);
47+
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-hours"), (int) Multipliers.Hours);
48+
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-days"), (int) Multipliers.Days);
49+
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-weeks"), (int) Multipliers.Weeks);
50+
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-months"), (int) Multipliers.Months);
51+
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-years"), (int) Multipliers.Years);
52+
ExpiryLengthDropdown.AddItem(Loc.GetString("admin-note-button-centuries"), (int) Multipliers.Centuries);
53+
ExpiryLengthDropdown.OnItemSelected += OnLengthChanged;
54+
55+
ExpiryLengthDropdown.SelectId((int) Multipliers.Weeks);
56+
57+
ExpiryLineEdit.OnTextChanged += OnTextChanged;
58+
3459
TypeOption.AddItem(Loc.GetString("admin-note-editor-type-note"), (int) NoteType.Note);
3560
TypeOption.AddItem(Loc.GetString("admin-note-editor-type-message"), (int) NoteType.Message);
3661
TypeOption.AddItem(Loc.GetString("admin-note-editor-type-watchlist"), (int) NoteType.Watchlist);
@@ -134,6 +159,7 @@ private void OnTypeChanged(OptionButton.ItemSelectedEventArgs args)
134159
SecretCheckBox.Pressed = true; // SS220 Secret Default
135160
SeverityOption.Disabled = false;
136161
PermanentCheckBox.Pressed = true;
162+
SubmitButton.Disabled = true;
137163
UpdatePermanentCheckboxFields();
138164
break;
139165
case (int) NoteType.Message: // Message: these are shown to the player when they log on
@@ -172,8 +198,9 @@ private void UpdatePermanentCheckboxFields()
172198
{
173199
ExpiryLabel.Visible = !PermanentCheckBox.Pressed;
174200
ExpiryLineEdit.Visible = !PermanentCheckBox.Pressed;
201+
ExpiryLengthDropdown.Visible = !PermanentCheckBox.Pressed;
175202

176-
ExpiryLineEdit.Text = !PermanentCheckBox.Pressed ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty;
203+
ExpiryLineEdit.Text = !PermanentCheckBox.Pressed ? 1.ToString() : string.Empty;
177204
}
178205

179206
private void OnSecretPressed(BaseButton.ButtonEventArgs _)
@@ -187,6 +214,16 @@ private void OnSeverityChanged(OptionButton.ItemSelectedEventArgs args)
187214
SeverityOption.SelectId(args.Id);
188215
}
189216

217+
private void OnLengthChanged(OptionButton.ItemSelectedEventArgs args)
218+
{
219+
ExpiryLengthDropdown.SelectId(args.Id);
220+
}
221+
222+
private void OnTextChanged(HistoryLineEdit.LineEditEventArgs args)
223+
{
224+
ParseExpiryTime();
225+
}
226+
190227
private void OnSubmitButtonPressed(BaseButton.ButtonEventArgs args)
191228
{
192229
if (!ParseExpiryTime())
@@ -263,13 +300,24 @@ private bool ParseExpiryTime()
263300
return true;
264301
}
265302

266-
if (string.IsNullOrWhiteSpace(ExpiryLineEdit.Text) || !DateTime.TryParse(ExpiryLineEdit.Text, out var result) || DateTime.UtcNow > result)
303+
if (string.IsNullOrWhiteSpace(ExpiryLineEdit.Text) || !uint.TryParse(ExpiryLineEdit.Text, out var inputInt))
267304
{
268305
ExpiryLineEdit.ModulateSelfOverride = Color.Red;
269306
return false;
270307
}
271308

272-
ExpiryTime = result.ToUniversalTime();
309+
var mult = ExpiryLengthDropdown.SelectedId switch
310+
{
311+
(int) Multipliers.Minutes => TimeSpan.FromMinutes(1).TotalMinutes,
312+
(int) Multipliers.Hours => TimeSpan.FromHours(1).TotalMinutes,
313+
(int) Multipliers.Days => TimeSpan.FromDays(1).TotalMinutes,
314+
(int) Multipliers.Weeks => TimeSpan.FromDays(7).TotalMinutes,
315+
(int) Multipliers.Months => TimeSpan.FromDays(30).TotalMinutes,
316+
(int) Multipliers.Years => TimeSpan.FromDays(365).TotalMinutes,
317+
(int) Multipliers.Centuries => TimeSpan.FromDays(36525).TotalMinutes,
318+
_ => throw new ArgumentOutOfRangeException(nameof(ExpiryLengthDropdown.SelectedId), "Multiplier out of range :(")
319+
};
320+
ExpiryTime = DateTime.UtcNow.AddMinutes(inputInt * mult);
273321
ExpiryLineEdit.ModulateSelfOverride = null;
274322
return true;
275323
}

Content.Client/Administration/UI/Tabs/RoundTab/RoundTab.xaml.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Content.Shared.CCVar;
2+
using Content.Shared.SS220.CCVars;
23
using Robust.Client.AutoGenerated;
34
using Robust.Client.UserInterface;
45
using Robust.Client.UserInterface.Controls;
@@ -16,7 +17,7 @@ public RoundTab()
1617
RobustXamlLoader.Load(this);
1718
IoCManager.InjectDependencies(this);
1819

19-
_config.OnValueChanged(CCVars.DelayEnabled, StateChanged, true);
20+
_config.OnValueChanged(CCVars220.DelayEnabled, StateChanged, true);
2021
Delay.OnPressed += ButtonClicked;
2122
}
2223

@@ -28,7 +29,7 @@ private void StateChanged(bool value)
2829
// Extra check
2930
private void ButtonClicked(BaseButton.ButtonEventArgs args)
3031
{
31-
Delay.Pressed = _config.GetCVar(CCVars.DelayEnabled);
32+
Delay.Pressed = _config.GetCVar(CCVars220.DelayEnabled);
3233
}
3334

3435
protected override void Dispose(bool disposing)

Content.Client/Alerts/ClientAlertsSystem.cs

+10-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Content.Shared.Alert;
33
using JetBrains.Annotations;
44
using Robust.Client.Player;
5+
using Robust.Shared.GameStates;
56
using Robust.Shared.Player;
67
using Robust.Shared.Prototypes;
78

@@ -24,8 +25,7 @@ public override void Initialize()
2425

2526
SubscribeLocalEvent<AlertsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
2627
SubscribeLocalEvent<AlertsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);
27-
28-
SubscribeLocalEvent<AlertsComponent, AfterAutoHandleStateEvent>(ClientAlertsHandleState);
28+
SubscribeLocalEvent<AlertsComponent, ComponentHandleState>(OnHandleState);
2929
}
3030
protected override void LoadPrototypes()
3131
{
@@ -47,17 +47,22 @@ public IReadOnlyDictionary<AlertKey, AlertState>? ActiveAlerts
4747
}
4848
}
4949

50-
protected override void AfterShowAlert(Entity<AlertsComponent> alerts)
50+
private void OnHandleState(Entity<AlertsComponent> alerts, ref ComponentHandleState args)
5151
{
52+
if (args.Current is not AlertComponentState cast)
53+
return;
54+
55+
alerts.Comp.Alerts = cast.Alerts;
56+
5257
UpdateHud(alerts);
5358
}
5459

55-
protected override void AfterClearAlert(Entity<AlertsComponent> alerts)
60+
protected override void AfterShowAlert(Entity<AlertsComponent> alerts)
5661
{
5762
UpdateHud(alerts);
5863
}
5964

60-
private void ClientAlertsHandleState(Entity<AlertsComponent> alerts, ref AfterAutoHandleStateEvent args)
65+
protected override void AfterClearAlert(Entity<AlertsComponent> alerts)
6166
{
6267
UpdateHud(alerts);
6368
}
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using Robust.Shared.GameObjects;
2-
31
namespace Content.Client.Atmos.Components;
42

53
[RegisterComponent]
6-
public sealed partial class PipeColorVisualsComponent : Component
7-
{
8-
}
4+
public sealed partial class PipeColorVisualsComponent : Component;

Content.Client/Atmos/Consoles/AtmosAlarmEntryContainer.xaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<BoxContainer xmlns="https://spacestation14.io"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3-
xmlns:s="clr-namespace:Content.Client.Stylesheets"
43
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
54
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
65
Orientation="Vertical" HorizontalExpand ="True" Margin="0 0 0 3">
@@ -62,7 +61,7 @@
6261
</PanelContainer>
6362
</BoxContainer>
6463

65-
<!-- If the alarm is inactive, this is label is diplayed instead -->
64+
<!-- If the alarm is inactive, this is label is displayed instead -->
6665
<Label Name="NoDataLabel" Text="{Loc 'atmos-alerts-window-no-data-available'}" HorizontalAlignment="Center" Margin="0 15" FontColorOverride="#a9a9a9" ReservesSpace="False" Visible="False"></Label>
6766

6867
<!-- Silencing progress bar -->

Content.Client/Atmos/Consoles/AtmosAlarmEntryContainer.xaml.cs

+5-6
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,9 @@ public void UpdateEntry(AtmosAlertsComputerEntry entry, bool isFocus, AtmosAlert
136136
GasGridContainer.RemoveAllChildren();
137137

138138
var gasData = focusData.Value.GasData.Where(g => g.Key != Gas.Oxygen);
139+
var keyValuePairs = gasData.ToList();
139140

140-
if (gasData.Count() == 0)
141+
if (keyValuePairs.Count == 0)
141142
{
142143
// No other gases
143144
var gasLabel = new Label()
@@ -158,13 +159,11 @@ public void UpdateEntry(AtmosAlertsComputerEntry entry, bool isFocus, AtmosAlert
158159
else
159160
{
160161
// Add an entry for each gas
161-
foreach ((var gas, (var mol, var percent, var alert)) in gasData)
162+
foreach ((var gas, (var mol, var percent, var alert)) in keyValuePairs)
162163
{
163-
var gasPercent = (FixedPoint2)0f;
164-
gasPercent = percent * 100f;
164+
FixedPoint2 gasPercent = percent * 100f;
165165

166-
if (!_gasShorthands.TryGetValue(gas, out var gasShorthand))
167-
gasShorthand = "X";
166+
var gasShorthand = _gasShorthands.GetValueOrDefault(gas, "X");
168167

169168
var gasLabel = new Label()
170169
{

Content.Client/Atmos/Consoles/AtmosAlertsComputerBoundUserInterface.cs

-5
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ protected override void Open()
1414
_menu = new AtmosAlertsComputerWindow(this, Owner);
1515
_menu.OpenCentered();
1616
_menu.OnClose += Close;
17-
18-
EntMan.TryGetComponent<TransformComponent>(Owner, out var xform);
1917
}
2018

2119
protected override void UpdateState(BoundUserInterfaceState state)
@@ -24,9 +22,6 @@ protected override void UpdateState(BoundUserInterfaceState state)
2422

2523
var castState = (AtmosAlertsComputerBoundInterfaceState) state;
2624

27-
if (castState == null)
28-
return;
29-
3025
EntMan.TryGetComponent<TransformComponent>(Owner, out var xform);
3126
_menu?.UpdateUI(xform?.Coordinates, castState.AirAlarms, castState.FireAlarms, castState.FocusData);
3227
}

Content.Client/Atmos/Consoles/AtmosAlertsComputerWindow.xaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<controls:FancyWindow xmlns="https://spacestation14.io"
22
xmlns:ui="clr-namespace:Content.Client.Pinpointer.UI"
33
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
4-
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
54
Title="{Loc 'atmos-alerts-window-title'}"
65
Resizable="False"
76
SetSize="1120 750"

0 commit comments

Comments
 (0)