diff --git a/.github/workflows/labeler-review.yml b/.github/workflows/labeler-review.yml deleted file mode 100644 index 0adfee7d0e5..00000000000 --- a/.github/workflows/labeler-review.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: "Labels: Approved" -on: - pull_request_review: - types: [submitted] -jobs: - add_label: - # Change the repository name after you've made sure the team name is correct for your fork! - if: ${{ (github.repository == 'space-wizards/space-station-14') && (github.event.review.state == 'APPROVED') }} - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: tspascoal/get-user-teams-membership@v3 - id: checkUserMember - with: - username: ${{ github.actor }} - team: "content-maintainers,junior-maintainers" - GITHUB_TOKEN: ${{ secrets.LABELER_PAT }} - - if: ${{ steps.checkUserMember.outputs.isTeamMember == 'true' }} - uses: actions-ecosystem/action-add-labels@v1 - with: - labels: "S: Approved" diff --git a/Content.Client/Actions/ActionsSystem.cs b/Content.Client/Actions/ActionsSystem.cs index b594817701e..7b13233bab5 100644 --- a/Content.Client/Actions/ActionsSystem.cs +++ b/Content.Client/Actions/ActionsSystem.cs @@ -258,13 +258,13 @@ public void UnlinkAllActions() public void LinkAllActions(ActionsComponent? actions = null) { - if (_playerManager.LocalEntity is not { } user || - !Resolve(user, ref actions, false)) - { - return; - } + if (_playerManager.LocalEntity is not { } user || + !Resolve(user, ref actions, false)) + { + return; + } - LinkActions?.Invoke(actions); + LinkActions?.Invoke(actions); } public override void Shutdown() diff --git a/Content.Client/Administration/UI/BanPanel/BanPanel.xaml.cs b/Content.Client/Administration/UI/BanPanel/BanPanel.xaml.cs index 3c7322d4739..588d62e5603 100644 --- a/Content.Client/Administration/UI/BanPanel/BanPanel.xaml.cs +++ b/Content.Client/Administration/UI/BanPanel/BanPanel.xaml.cs @@ -22,11 +22,11 @@ namespace Content.Client.Administration.UI.BanPanel; [GenerateTypedNameReferences] public sealed partial class BanPanel : DefaultWindow { - public event Action? BanSubmitted; + public event Action? BanSubmitted; public event Action? PlayerChanged; private string? PlayerUsername { get; set; } private (IPAddress, int)? IpAddress { get; set; } - private ImmutableTypedHwid? Hwid { get; set; } + private byte[]? Hwid { get; set; } private double TimeEntered { get; set; } private uint Multiplier { get; set; } private bool HasBanFlag { get; set; } @@ -371,8 +371,9 @@ private void OnIpChanged() private void OnHwidChanged() { var hwidString = HwidLine.Text; - ImmutableTypedHwid? hwid = null; - if (HwidCheckbox.Pressed && !(string.IsNullOrEmpty(hwidString) && LastConnCheckbox.Pressed) && !ImmutableTypedHwid.TryParse(hwidString, out hwid)) + var length = 3 * (hwidString.Length / 4) - hwidString.TakeLast(2).Count(c => c == '='); + Hwid = new byte[length]; + if (HwidCheckbox.Pressed && !(string.IsNullOrEmpty(hwidString) && LastConnCheckbox.Pressed) && !Convert.TryFromBase64String(hwidString, Hwid, out _)) { ErrorLevel |= ErrorLevelEnum.Hwid; HwidLine.ModulateSelfOverride = Color.Red; @@ -389,7 +390,7 @@ private void OnHwidChanged() Hwid = null; return; } - Hwid = hwid; + Hwid = Convert.FromHexString(hwidString); } private void OnTypeChanged() diff --git a/Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs b/Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs index c8e3afeb22c..a412e47396b 100644 --- a/Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs +++ b/Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs @@ -159,7 +159,6 @@ private void OnTypeChanged(OptionButton.ItemSelectedEventArgs args) SecretCheckBox.Pressed = false; SeverityOption.Disabled = false; PermanentCheckBox.Pressed = true; - SubmitButton.Disabled = true; UpdatePermanentCheckboxFields(); break; case (int) NoteType.Message: // Message: these are shown to the player when they log on diff --git a/Content.Client/Atmos/Components/PipeColorVisualsComponent.cs b/Content.Client/Atmos/Components/PipeColorVisualsComponent.cs index 9b24b1adc25..355b10cb4a4 100644 --- a/Content.Client/Atmos/Components/PipeColorVisualsComponent.cs +++ b/Content.Client/Atmos/Components/PipeColorVisualsComponent.cs @@ -1,4 +1,8 @@ +using Robust.Shared.GameObjects; + namespace Content.Client.Atmos.Components; [RegisterComponent] -public sealed partial class PipeColorVisualsComponent : Component; +public sealed partial class PipeColorVisualsComponent : Component +{ +} diff --git a/Content.Client/Atmos/Consoles/AtmosAlarmEntryContainer.xaml b/Content.Client/Atmos/Consoles/AtmosAlarmEntryContainer.xaml index 3dbe14e6b6d..6bdfb3989f9 100644 --- a/Content.Client/Atmos/Consoles/AtmosAlarmEntryContainer.xaml +++ b/Content.Client/Atmos/Consoles/AtmosAlarmEntryContainer.xaml @@ -1,5 +1,6 @@ @@ -61,7 +62,7 @@ - + diff --git a/Content.Client/Atmos/Consoles/AtmosAlarmEntryContainer.xaml.cs b/Content.Client/Atmos/Consoles/AtmosAlarmEntryContainer.xaml.cs index e533ef2dce0..79bb66560e3 100644 --- a/Content.Client/Atmos/Consoles/AtmosAlarmEntryContainer.xaml.cs +++ b/Content.Client/Atmos/Consoles/AtmosAlarmEntryContainer.xaml.cs @@ -136,9 +136,8 @@ public void UpdateEntry(AtmosAlertsComputerEntry entry, bool isFocus, AtmosAlert GasGridContainer.RemoveAllChildren(); var gasData = focusData.Value.GasData.Where(g => g.Key != Gas.Oxygen); - var keyValuePairs = gasData.ToList(); - if (keyValuePairs.Count == 0) + if (gasData.Count() == 0) { // No other gases var gasLabel = new Label() @@ -159,11 +158,13 @@ public void UpdateEntry(AtmosAlertsComputerEntry entry, bool isFocus, AtmosAlert else { // Add an entry for each gas - foreach ((var gas, (var mol, var percent, var alert)) in keyValuePairs) + foreach ((var gas, (var mol, var percent, var alert)) in gasData) { - FixedPoint2 gasPercent = percent * 100f; + var gasPercent = (FixedPoint2)0f; + gasPercent = percent * 100f; - var gasShorthand = _gasShorthands.GetValueOrDefault(gas, "X"); + if (!_gasShorthands.TryGetValue(gas, out var gasShorthand)) + gasShorthand = "X"; var gasLabel = new Label() { diff --git a/Content.Client/Atmos/Consoles/AtmosAlertsComputerBoundUserInterface.cs b/Content.Client/Atmos/Consoles/AtmosAlertsComputerBoundUserInterface.cs index 6f0e7f80da1..08cae979b9b 100644 --- a/Content.Client/Atmos/Consoles/AtmosAlertsComputerBoundUserInterface.cs +++ b/Content.Client/Atmos/Consoles/AtmosAlertsComputerBoundUserInterface.cs @@ -14,6 +14,8 @@ protected override void Open() _menu = new AtmosAlertsComputerWindow(this, Owner); _menu.OpenCentered(); _menu.OnClose += Close; + + EntMan.TryGetComponent(Owner, out var xform); } protected override void UpdateState(BoundUserInterfaceState state) @@ -22,6 +24,9 @@ protected override void UpdateState(BoundUserInterfaceState state) var castState = (AtmosAlertsComputerBoundInterfaceState) state; + if (castState == null) + return; + EntMan.TryGetComponent(Owner, out var xform); _menu?.UpdateUI(xform?.Coordinates, castState.AirAlarms, castState.FireAlarms, castState.FocusData); } diff --git a/Content.Client/Atmos/Consoles/AtmosAlertsComputerWindow.xaml b/Content.Client/Atmos/Consoles/AtmosAlertsComputerWindow.xaml index e5ede1b92e3..8824a776ee6 100644 --- a/Content.Client/Atmos/Consoles/AtmosAlertsComputerWindow.xaml +++ b/Content.Client/Atmos/Consoles/AtmosAlertsComputerWindow.xaml @@ -1,6 +1,7 @@ (OnInit); - SubscribeLocalEvent(OnAppearanceChanged, after: [typeof(SubFloorHideSystem)]); + SubscribeLocalEvent(OnAppearanceChanged, after: new[] { typeof(SubFloorHideSystem) }); } private void OnInit(EntityUid uid, PipeAppearanceComponent component, ComponentInit args) @@ -82,8 +84,7 @@ private void OnAppearanceChanged(EntityUid uid, PipeAppearanceComponent componen layer.Visible &= visible; - if (!visible) - continue; + if (!visible) continue; layer.Color = color; } diff --git a/Content.Client/Atmos/Monitor/AtmosAlarmableVisualsSystem.cs b/Content.Client/Atmos/Monitor/AtmosAlarmableVisualsSystem.cs index 18ca2234752..019f25f376b 100644 --- a/Content.Client/Atmos/Monitor/AtmosAlarmableVisualsSystem.cs +++ b/Content.Client/Atmos/Monitor/AtmosAlarmableVisualsSystem.cs @@ -1,7 +1,12 @@ +using System.Collections.Generic; using Content.Shared.Atmos.Monitor; using Content.Shared.Power; using Robust.Client.GameObjects; using Robust.Client.Graphics; +using Robust.Shared.GameObjects; +using Robust.Shared.IoC; +using Robust.Shared.Maths; +using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Client.Atmos.Monitor; @@ -22,7 +27,7 @@ protected override void OnAppearanceChange(EntityUid uid, AtmosAlarmableVisualsC { foreach (var visLayer in component.HideOnDepowered) { - if (args.Sprite.LayerMapTryGet(visLayer, out var powerVisibilityLayer)) + if (args.Sprite.LayerMapTryGet(visLayer, out int powerVisibilityLayer)) args.Sprite.LayerSetVisible(powerVisibilityLayer, powered); } } @@ -31,7 +36,7 @@ protected override void OnAppearanceChange(EntityUid uid, AtmosAlarmableVisualsC { foreach (var (setLayer, powerState) in component.SetOnDepowered) { - if (args.Sprite.LayerMapTryGet(setLayer, out var setStateLayer)) + if (args.Sprite.LayerMapTryGet(setLayer, out int setStateLayer)) args.Sprite.LayerSetState(setStateLayer, new RSI.StateId(powerState)); } } diff --git a/Content.Client/Atmos/Monitor/UI/AirAlarmBoundUserInterface.cs b/Content.Client/Atmos/Monitor/UI/AirAlarmBoundUserInterface.cs index 650f96eec97..d9e94e373b4 100644 --- a/Content.Client/Atmos/Monitor/UI/AirAlarmBoundUserInterface.cs +++ b/Content.Client/Atmos/Monitor/UI/AirAlarmBoundUserInterface.cs @@ -1,7 +1,11 @@ using Content.Shared.Atmos; using Content.Shared.Atmos.Monitor; using Content.Shared.Atmos.Monitor.Components; +using Robust.Client.GameObjects; using Robust.Client.UserInterface; +using Robust.Shared.GameObjects; +using Robust.Shared.IoC; +using Robust.Shared.Log; namespace Content.Client.Atmos.Monitor.UI; @@ -74,7 +78,6 @@ protected override void Dispose(bool disposing) { base.Dispose(disposing); - if (disposing) - _window?.Dispose(); + if (disposing) _window?.Dispose(); } } diff --git a/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs b/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs index 65164983865..e1425ac491b 100644 --- a/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs +++ b/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs @@ -8,6 +8,7 @@ using Content.Shared.Atmos.Piping.Unary.Components; using Content.Shared.Temperature; using Robust.Client.AutoGenerated; +using Robust.Client.GameObjects; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; @@ -58,7 +59,7 @@ public AirAlarmWindow() AirAlarmMode.Fill => "air-alarm-ui-mode-fill", AirAlarmMode.Panic => "air-alarm-ui-mode-panic", AirAlarmMode.None => "air-alarm-ui-mode-none", - _ => "error", + _ => "error" }; _modes.AddItem(Loc.GetString(text)); } @@ -69,7 +70,7 @@ public AirAlarmWindow() AirAlarmModeChanged!.Invoke((AirAlarmMode) args.Id); }; - _autoMode.OnToggled += _ => + _autoMode.OnToggled += args => { AutoModeChanged!.Invoke(_autoMode.Pressed); }; @@ -175,18 +176,22 @@ public void UpdateDeviceData(string addr, IAtmosDeviceData device) public static Color ColorForThreshold(float amount, AtmosAlarmThreshold threshold) { - threshold.CheckThreshold(amount, out var curAlarm); + threshold.CheckThreshold(amount, out AtmosAlarmType curAlarm); return ColorForAlarm(curAlarm); } public static Color ColorForAlarm(AtmosAlarmType curAlarm) { - return curAlarm switch + if(curAlarm == AtmosAlarmType.Danger) { - AtmosAlarmType.Danger => StyleNano.DangerousRedFore, - AtmosAlarmType.Warning => StyleNano.ConcerningOrangeFore, - _ => StyleNano.GoodGreenFore, - }; + return StyleNano.DangerousRedFore; + } + else if(curAlarm == AtmosAlarmType.Warning) + { + return StyleNano.ConcerningOrangeFore; + } + + return StyleNano.GoodGreenFore; } diff --git a/Content.Client/Atmos/Monitor/UI/Widgets/PumpControl.xaml.cs b/Content.Client/Atmos/Monitor/UI/Widgets/PumpControl.xaml.cs index 2cd51d6fc7f..17b03b84684 100644 --- a/Content.Client/Atmos/Monitor/UI/Widgets/PumpControl.xaml.cs +++ b/Content.Client/Atmos/Monitor/UI/Widgets/PumpControl.xaml.cs @@ -1,8 +1,12 @@ +using System; +using Content.Shared.Atmos.Monitor; using Content.Shared.Atmos.Monitor.Components; using Content.Shared.Atmos.Piping.Unary.Components; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.Controls; +using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; +using Robust.Shared.Localization; namespace Content.Client.Atmos.Monitor.UI.Widgets; @@ -21,7 +25,7 @@ public sealed partial class PumpControl : BoxContainer private OptionButton _pressureCheck => CPressureCheck; private FloatSpinBox _externalBound => CExternalBound; private FloatSpinBox _internalBound => CInternalBound; - private Button _copySettings => CCopySettings; + private Button _copySettings => CCopySettings; public PumpControl(GasVentPumpData data, string address) { @@ -82,7 +86,7 @@ public PumpControl(GasVentPumpData data, string address) _data.PressureChecks = (VentPressureBound) args.Id; PumpDataChanged?.Invoke(_address, _data); }; - + _copySettings.OnPressed += _ => { PumpDataCopied?.Invoke(_data); diff --git a/Content.Client/Atmos/Monitor/UI/Widgets/ScrubberControl.xaml.cs b/Content.Client/Atmos/Monitor/UI/Widgets/ScrubberControl.xaml.cs index c16ff688c93..f2241bcd8da 100644 --- a/Content.Client/Atmos/Monitor/UI/Widgets/ScrubberControl.xaml.cs +++ b/Content.Client/Atmos/Monitor/UI/Widgets/ScrubberControl.xaml.cs @@ -1,9 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; using Content.Shared.Atmos; +using Content.Shared.Atmos.Monitor; using Content.Shared.Atmos.Monitor.Components; using Content.Shared.Atmos.Piping.Unary.Components; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.Controls; +using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; +using Robust.Shared.Localization; namespace Content.Client.Atmos.Monitor.UI.Widgets; @@ -21,7 +27,7 @@ public sealed partial class ScrubberControl : BoxContainer private OptionButton _pumpDirection => CPumpDirection; private FloatSpinBox _volumeRate => CVolumeRate; private CheckBox _wideNet => CWideNet; - private Button _copySettings => CCopySettings; + private Button _copySettings => CCopySettings; private GridContainer _gases => CGasContainer; private Dictionary _gasControls = new(); @@ -71,7 +77,7 @@ public ScrubberControl(GasVentScrubberData data, string address) _data.PumpDirection = (ScrubberPumpDirection) args.Id; ScrubberDataChanged?.Invoke(_address, _data); }; - + _copySettings.OnPressed += _ => { ScrubberDataCopied?.Invoke(_data); diff --git a/Content.Client/Atmos/Monitor/UI/Widgets/SensorInfo.xaml.cs b/Content.Client/Atmos/Monitor/UI/Widgets/SensorInfo.xaml.cs index 9e60b6cea62..da602cd7479 100644 --- a/Content.Client/Atmos/Monitor/UI/Widgets/SensorInfo.xaml.cs +++ b/Content.Client/Atmos/Monitor/UI/Widgets/SensorInfo.xaml.cs @@ -43,8 +43,7 @@ public SensorInfo(AtmosSensorData data, string address) var label = new RichTextLabel(); var fractionGas = amount / data.TotalMoles; - label.SetMarkup(Loc.GetString("air-alarm-ui-gases-indicator", - ("gas", $"{gas}"), + label.SetMarkup(Loc.GetString("air-alarm-ui-gases-indicator", ("gas", $"{gas}"), ("color", AirAlarmWindow.ColorForThreshold(fractionGas, data.GasThresholds[gas])), ("amount", $"{amount:0.####}"), ("percentage", $"{(100 * fractionGas):0.##}"))); @@ -54,9 +53,9 @@ public SensorInfo(AtmosSensorData data, string address) var threshold = data.GasThresholds[gas]; var gasThresholdControl = new ThresholdControl(Loc.GetString($"air-alarm-ui-thresholds-gas-title", ("gas", $"{gas}")), threshold, AtmosMonitorThresholdType.Gas, gas, 100); gasThresholdControl.Margin = new Thickness(20, 2, 2, 2); - gasThresholdControl.ThresholdDataChanged += (type, alarmThreshold, arg3) => + gasThresholdControl.ThresholdDataChanged += (type, threshold, arg3) => { - OnThresholdUpdate!(_address, type, alarmThreshold, arg3); + OnThresholdUpdate!(_address, type, threshold, arg3); }; _gasThresholds.Add(gas, gasThresholdControl); @@ -65,8 +64,7 @@ public SensorInfo(AtmosSensorData data, string address) _pressureThreshold = new ThresholdControl(Loc.GetString("air-alarm-ui-thresholds-pressure-title"), data.PressureThreshold, AtmosMonitorThresholdType.Pressure); PressureThresholdContainer.AddChild(_pressureThreshold); - _temperatureThreshold = new ThresholdControl(Loc.GetString("air-alarm-ui-thresholds-temperature-title"), - data.TemperatureThreshold, + _temperatureThreshold = new ThresholdControl(Loc.GetString("air-alarm-ui-thresholds-temperature-title"), data.TemperatureThreshold, AtmosMonitorThresholdType.Temperature); TemperatureThresholdContainer.AddChild(_temperatureThreshold); @@ -105,8 +103,7 @@ public void ChangeData(AtmosSensorData data) } var fractionGas = amount / data.TotalMoles; - label.SetMarkup(Loc.GetString("air-alarm-ui-gases-indicator", - ("gas", $"{gas}"), + label.SetMarkup(Loc.GetString("air-alarm-ui-gases-indicator", ("gas", $"{gas}"), ("color", AirAlarmWindow.ColorForThreshold(fractionGas, data.GasThresholds[gas])), ("amount", $"{amount:0.####}"), ("percentage", $"{(100 * fractionGas):0.##}"))); diff --git a/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml.cs b/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml.cs index 55f7c008987..3612d84de4c 100644 --- a/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml.cs +++ b/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml.cs @@ -1,4 +1,7 @@ +using Content.Client.Message; +using Content.Shared.Atmos; using Content.Shared.Atmos.Monitor; +using Content.Shared.Temperature; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.XAML; diff --git a/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdControl.xaml.cs b/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdControl.xaml.cs index 651620f3e25..78c73fa573a 100644 --- a/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdControl.xaml.cs +++ b/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdControl.xaml.cs @@ -1,8 +1,12 @@ +using System; using Content.Shared.Atmos; using Content.Shared.Atmos.Monitor; +using Content.Shared.Atmos.Monitor.Components; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.Controls; +using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; +using Robust.Shared.Localization; // holy FUCK // this technically works because some of this you can *not* do in XAML but holy FUCK @@ -111,38 +115,29 @@ public ThresholdControl(string name, AtmosAlarmThreshold threshold, AtmosMonitor _enabled.Pressed = !_threshold.Ignore; } - private string LabelForBound(string boundType) //, DebugMessage)> state) => { if (_system.TileData.TryGetValue(uid, out var data)) diff --git a/Content.Client/Clothing/FlippableClothingVisualizerSystem.cs b/Content.Client/Clothing/FlippableClothingVisualizerSystem.cs index 1f09ae9eebb..2c3afb0324f 100644 --- a/Content.Client/Clothing/FlippableClothingVisualizerSystem.cs +++ b/Content.Client/Clothing/FlippableClothingVisualizerSystem.cs @@ -7,7 +7,7 @@ namespace Content.Client.Clothing; -public sealed class FlippableClothingVisualizerSystem : VisualizerSystem +public sealed class FlippableClothingVisualizerSystem : VisualizerSystem { [Dependency] private readonly SharedItemSystem _itemSys = default!; diff --git a/Content.Client/Construction/UI/ConstructionMenu.xaml b/Content.Client/Construction/UI/ConstructionMenu.xaml index a934967a533..6e4438cf6fd 100644 --- a/Content.Client/Construction/UI/ConstructionMenu.xaml +++ b/Content.Client/Construction/UI/ConstructionMenu.xaml @@ -1,20 +1,15 @@ - + - - - - - -