From c6d3e4f3bdf932853b182f7167256162f1ea12dd Mon Sep 17 00:00:00 2001 From: Visne <39844191+Visne@users.noreply.github.com> Date: Thu, 19 Jan 2023 03:56:45 +0100 Subject: [PATCH] Fix warnings and code cleanup/fixes (#13570) --- .../NetSerializerStringBenchmark.cs | 2 +- .../UI/Bwoink/BwoinkControl.xaml.cs | 2 +- .../SpawnExplosion/ExplosionDebugOverlay.cs | 10 +-- .../UI/Tabs/ObjectsTab/ObjectsTab.xaml | 1 - .../UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs | 6 +- .../Monitor/UI/Widgets/PumpControl.xaml.cs | 4 +- .../UI/Widgets/ThresholdBoundControl.xaml.cs | 2 +- .../Atmos/Overlays/AtmosDebugOverlay.cs | 2 +- .../Atmos/Overlays/GasTileOverlay.cs | 2 +- Content.Client/Atmos/UI/GasFilterWindow.xaml | 1 - .../Atmos/UI/GasFilterWindow.xaml.cs | 2 +- Content.Client/Atmos/UI/GasMixerWindow.xaml | 1 - .../Atmos/UI/GasPressurePumpWindow.xaml | 1 - .../Atmos/UI/GasVolumePumpWindow.xaml | 1 - .../CargoOrderConsoleBoundUserInterface.cs | 2 +- .../Chemistry/UI/ChemMasterWindow.xaml.cs | 4 +- Content.Client/Clickable/ClickMapManager.cs | 2 +- .../Clickable/ClickableComponent.cs | 2 +- .../UI/CloningConsoleWindow.xaml | 1 - .../UI/CloningConsoleWindow.xaml.cs | 6 -- .../Computer/ComputerBoundUserInterface.cs | 2 +- .../Decals/UI/DecalPlacerWindow.xaml | 1 - Content.Client/DragDrop/DragDropHelper.cs | 5 +- Content.Client/Fax/UI/FaxWindow.xaml | 3 +- .../Fluids/PuddleVisualizerSystem.cs | 63 +++++--------- .../Guidebook/Controls/GuidebookWindow.xaml | 3 +- Content.Client/Guidebook/GuidebookSystem.cs | 2 +- .../UI/HealthAnalyzerWindow.xaml.cs | 4 +- Content.Client/Humanoid/MarkingPicker.xaml.cs | 1 + .../Instruments/InstrumentSystem.cs | 7 -- Content.Client/Lathe/UI/LatheMenu.xaml | 2 - Content.Client/Lathe/UI/LatheQueueMenu.xaml | 1 - .../Lobby/UI/LobbyCharacterPreviewPanel.cs | 2 +- .../Options/UI/Tabs/NetworkTab.xaml.cs | 11 +-- .../PDA/Ringer/RingtoneMenu.xaml.cs | 8 +- Content.Client/Paper/UI/PaperWindow.xaml | 2 - Content.Client/Paper/UI/PaperWindow.xaml.cs | 4 +- Content.Client/Paper/UI/StampWidget.xaml | 6 -- .../Data/GeneratedParallaxTextureSource.cs | 3 +- .../Parallax/Data/ParallaxPrototype.cs | 2 +- .../Preferences/UI/CharacterSetupGui.xaml | 1 - Content.Client/Stylesheets/StyleNano.cs | 6 +- .../UI/SurveillanceCameraSetupWindow.xaml.cs | 2 +- .../Targeting/UI/TargetingDoll.xaml | 12 +-- .../UserInterface/Controls/MenuButton.cs | 12 +-- .../Systems/Actions/ActionUIController.cs | 3 +- .../Systems/Actions/Widgets/ActionsBar.xaml | 1 - .../Systems/Bwoink/AHelpUIController.cs | 2 +- .../Controls/CharacterObjectiveControl.xaml | 1 - .../Chat/Controls/ChannelFilterButton.cs | 2 +- .../Inventory/Controls/InventoryDisplay.cs | 2 +- .../Controls/ObjectiveBriefingControl.xaml | 1 - .../Ranged/Systems/GunSystem.Ballistic.cs | 1 - .../Tests/Chemistry/SolutionSystemTests.cs | 4 +- .../Tests/Commands/RestartRoundTest.cs | 2 +- .../Tests/Damageable/DamageableTest.cs | 2 +- .../EntityPrototypeComponentsTest.cs | 3 +- .../Tests/Materials/MaterialTests.cs | 11 ++- .../Tests/PostMapInitTest.cs | 10 +-- .../Abilities/Mime/MimePowersComponent.cs | 7 +- Content.Server/Access/Systems/IdCardSystem.cs | 2 +- Content.Server/Actions/ActionsSystem.cs | 5 -- .../Administration/Managers/RoleBanManager.cs | 2 +- .../Systems/AdminVerbSystem.Tools.cs | 4 - .../AdvertisementsPackPrototype.cs | 2 +- Content.Server/Afk/AFKSystem.cs | 1 - .../AirlockPainter/AirlockPainterSystem.cs | 2 +- .../RoundAnnouncementPrototype.cs | 2 +- .../Effects/PyroclasticAnomalySystem.cs | 5 +- Content.Server/Armor/ArmorSystem.cs | 2 - .../EntitySystems/AtmosphereSystem.Gases.cs | 2 +- .../AtmosphereSystem.HighPressureDelta.cs | 2 +- .../AtmosphereSystem.Processing.cs | 2 +- .../Miasma/AntiRottingContainerComponent.cs | 2 +- .../Atmos/Miasma/BodyPreservedComponent.cs | 2 +- .../Atmos/Miasma/PerishableComponent.cs | 2 +- .../Components/GasVentScrubberComponent.cs | 2 +- .../Unary/EntitySystems/GasPortableSystem.cs | 2 +- .../Atmos/Reactions/GasReactionPrototype.cs | 2 +- Content.Server/Bed/Sleep/SleepingSystem.cs | 2 +- .../Body/Systems/BloodstreamSystem.cs | 2 +- .../Body/Systems/InternalsSystem.cs | 8 +- .../Botany/Systems/MutationSystem.cs | 16 ++-- .../Cargo/Systems/CargoSystem.Shuttle.cs | 4 +- .../CartridgeLoader/CartridgeLoaderSystem.cs | 4 +- .../Chat/Commands/SuicideCommand.cs | 5 +- Content.Server/Chat/Systems/ChatSystem.cs | 2 +- .../EntitySystems/ChemMasterSystem.cs | 2 +- .../EntitySystems/ChemistrySystem.Injector.cs | 2 +- .../EntitySystems/ChemistrySystemMixer.cs | 2 +- .../EntitySystems/SolutionContainerSystem.cs | 4 +- .../EntitySystems/SolutionTransferSystem.cs | 1 - .../Components/ActiveCloningPodComponent.cs | 14 ++-- Content.Server/Contests/ContestsSystem.cs | 10 +-- .../Cuffs/Components/CuffableComponent.cs | 3 - .../Systems/DeviceNetworkSystem.cs | 2 +- .../Components/DiseaseMachineComponent.cs | 2 +- .../DiseaseMachineRunningComponent.cs | 2 +- .../Components/DiseaseSwabComponent.cs | 2 +- .../Disease/Effects/DiseaseAdjustReagent.cs | 23 ++--- .../Disease/Effects/DiseasePolymorph.cs | 2 +- .../Disease/Effects/DiseasePopUp.cs | 2 +- .../Disease/Effects/DiseaseSnough.cs | 7 +- .../Disposal/Mailing/MailingUnitSystem.cs | 2 +- Content.Server/Doors/Systems/DoorSystem.cs | 1 - .../Dragon/Components/DragonComponent.cs | 6 +- .../Electrocution/ElectrocutionSystem.cs | 4 +- Content.Server/Emag/EmagSystem.cs | 1 - .../DisassembleOnAltVerbSystem.cs | 2 - .../ExplosionSystem.Processing.cs | 6 +- .../EntitySystems/ExplosionSystem.TileFill.cs | 4 +- .../EntitySystems/ExplosionTileFlood.cs | 4 +- Content.Server/Fax/FaxSystem.cs | 8 +- Content.Server/Flash/FlashSystem.cs | 2 +- .../Fluids/Components/DrainComponent.cs | 2 +- .../Fluids/EntitySystems/EvaporationSystem.cs | 2 +- .../Systems/ForensicScannerSystem.cs | 3 +- .../GameTicking/GameTicker.RoundFlow.cs | 84 +++++++++---------- .../Presets/GamePresetPrototype.cs | 2 +- .../GameTicking/Rules/PiratesRuleSystem.cs | 1 - .../GameTicking/Rules/SecretRuleSystem.cs | 2 - .../GameTicking/Rules/SuspicionRuleSystem.cs | 4 +- .../GameTicking/Rules/TraitorRuleSystem.cs | 9 +- .../GameTicking/Rules/ZombieRuleSystem.cs | 8 +- Content.Server/Ghost/Ghost.cs | 7 +- Content.Server/Holiday/HolidayPrototype.cs | 2 +- Content.Server/Holosign/HolosignSystem.cs | 1 - Content.Server/Info/InfoSystem.cs | 2 +- .../Inventory/ServerInventorySystem.cs | 6 +- .../EntitySystems/HandheldLightSystem.cs | 2 +- .../Light/EntitySystems/PoweredLightSystem.cs | 59 +++++++------ Content.Server/Lock/LockSystem.cs | 15 +--- .../System/SignalLinkerSystem.cs | 6 +- .../Medical/MedicalScannerSystem.cs | 2 +- .../Medical/Stethoscope/StethoscopeSystem.cs | 2 +- Content.Server/Medical/VomitSystem.cs | 4 +- Content.Server/Mind/Mind.cs | 2 +- Content.Server/MoMMI/MoMMILink.cs | 2 +- .../Components/NPCPathfindPointComponent.cs | 6 +- .../NPC/Pathfinding/PathfindingSystem.Grid.cs | 2 - .../EntitySystems/NodeGroupSystem.cs | 2 +- .../Nutrition/EntitySystems/DrinkSystem.cs | 21 ++--- .../Objectives/ObjectivePrototype.cs | 2 +- Content.Server/PDA/PDASystem.cs | 2 +- .../ParticleAcceleratorControlBoxComponent.cs | 9 +- .../Pointing/EntitySystems/PointingSystem.cs | 2 +- .../Polymorph/Systems/PolymorphableSystem.cs | 6 +- .../Components/ApcElectronicsComponent.cs | 2 +- .../Power/EntitySystems/ApcSystem.cs | 2 +- .../Power/EntitySystems/ChargerSystem.cs | 4 +- .../PowerMonitoringConsoleSystem.cs | 9 +- .../RandomAppearanceComponent.cs | 4 +- Content.Server/Roles/AddRoleCommand.cs | 2 +- Content.Server/Salvage/SalvageMapPrototype.cs | 2 +- Content.Server/Salvage/SalvageSystem.cs | 2 +- .../Systems/ShuttleSystem.EmergencyConsole.cs | 1 - .../Systems/ShuttleSystem.FasterThanLight.cs | 2 +- .../ContainmentFieldGeneratorSystem.cs | 3 +- .../EntitySystems/EventHorizonSystem.cs | 16 ++-- .../EntitySystems/SingularitySystem.cs | 4 +- .../Components/ReplacementAccentComponent.cs | 2 +- .../EntitySystems/SpanishAccentSystem.cs | 6 +- .../Standing/StandingStateSystem.cs | 2 +- .../Station/Systems/StationSystem.cs | 12 +-- .../StationEvents/Events/RandomSentience.cs | 2 +- .../EntitySystems/BluespaceLockerSystem.cs | 2 +- Content.Server/Tabletop/TabletopSystem.cs | 2 +- Content.Server/Tools/ToolSystem.Welder.cs | 1 - .../Uplink/Commands/AddUplinkCommand.cs | 1 - .../UserInterface/StatValuesCommand.cs | 2 +- .../Utility/Commands/EchoCommand.cs | 3 +- Content.Server/Wires/IWireAction.cs | 6 +- Content.Server/Wires/WireLayout.cs | 2 +- Content.Server/Wires/WiresSystem.cs | 16 ++-- Content.Shared/Access/AccessGroupPrototype.cs | 2 +- Content.Shared/Access/AccessLevelPrototype.cs | 2 +- .../Access/Systems/AccessReaderSystem.cs | 2 +- .../Access/Systems/SharedAccessSystem.cs | 4 +- .../Actions/ActionTypes/ActionPrototypes.cs | 6 +- Content.Shared/Actions/SharedActionsSystem.cs | 2 +- Content.Shared/Alert/AlertOrderPrototype.cs | 2 +- Content.Shared/Alert/AlertPrototype.cs | 2 +- .../Atmos/Prototypes/GasPrototype.cs | 2 +- .../Atmos/Visuals/PortableScrubberVisuals.cs | 21 +++-- Content.Shared/BarSign/BarSignPrototype.cs | 2 +- .../Bed/Sleep/ForcedSleepingComponent.cs | 2 +- .../Prototypes/MetabolismGroupPrototype.cs | 2 +- .../Prototypes/MetabolizerTypePrototype.cs | 2 +- Content.Shared/CCVar/CCVars.cs | 6 +- .../TypingIndicatorPrototype.cs | 2 +- .../Components/SharedInjectorComponent.cs | 2 +- .../Chemistry/Components/Solution.cs | 6 +- .../ReagentDispenserInventoryPrototype.cs | 2 +- .../Chemistry/Reaction/ReactionPrototype.cs | 4 +- .../Reaction/ReactiveGroupPrototype.cs | 2 +- .../Reaction/SharedChemicalReactionSystem.cs | 2 +- .../Chemistry/Reagent/ReagentPrototype.cs | 2 +- .../Clothing/ClothingSpeedModifierSystem.cs | 2 - .../Conditions/WallmountCondition.cs | 2 +- .../Prototypes/ConstructionGraphPrototype.cs | 2 +- .../Prototypes/ConstructionPrototype.cs | 2 +- .../Prototypes/DamageContainerPrototype.cs | 2 +- .../Damage/Prototypes/DamageGroupPrototype.cs | 2 +- .../Prototypes/DamageModifierSetPrototype.cs | 2 +- .../Damage/Prototypes/DamageTypePrototype.cs | 2 +- .../Prototypes/ExaminableDamagePrototype.cs | 2 +- Content.Shared/Dataset/DatasetPrototype.cs | 2 +- .../Decals/ColorPalettePrototype.cs | 2 +- .../DecalGridChunkCollectionTypeSerializer.cs | 10 +-- Content.Shared/Decals/DecalPrototype.cs | 2 +- .../DeviceNetwork/DeviceFrequencyPrototype.cs | 2 +- .../Systems/SharedDeviceListSystem.cs | 1 - .../Disease/DiseaseMachineVisuals.cs | 2 +- Content.Shared/Disease/DiseasePrototype.cs | 2 +- Content.Shared/Disease/DiseasedComponent.cs | 4 +- .../Doors/Systems/SharedAirlockSystem.cs | 6 -- Content.Shared/DragDrop/IDraggable.cs | 2 +- Content.Shared/Drone/SharedDroneSystem.cs | 5 -- .../EntityList/EntityListPrototype.cs | 2 +- Content.Shared/FixedPoint/FixedPoint2.cs | 2 +- Content.Shared/HUD/HudThemePrototype.cs | 2 +- .../SharedHandsSystem.Interactions.cs | 4 +- .../Humanoid/HumanoidVisualLayersExtension.cs | 1 - Content.Shared/Humanoid/Markings/Marking.cs | 6 +- .../Humanoid/Prototypes/SpeciesPrototype.cs | 10 +-- .../Interaction/RotateToFaceSystem.cs | 2 +- .../Interaction/SharedInteractionSystem.cs | 4 +- .../Inventory/InventorySystem.Equip.cs | 2 +- .../Inventory/InventorySystem.Relay.cs | 2 +- .../Inventory/InventoryTemplatePrototype.cs | 2 +- .../Kitchen/MicrowaveMealRecipePrototype.cs | 2 +- Content.Shared/Kitchen/RecipeManager.cs | 15 +--- .../ContentLocalizationManager.cs | 2 +- Content.Shared/Localizations/Units.cs | 15 ++-- Content.Shared/Maps/ContentTileDefinition.cs | 2 +- Content.Shared/Materials/MaterialPrototype.cs | 2 +- .../NameIdentifierGroupPrototype.cs | 2 +- .../Polymorph/PolymorphPrototype.cs | 2 +- .../Prototypes/EntityPrototypeHelpers.cs | 2 +- Content.Shared/Radio/RadioChannelPrototype.cs | 2 +- .../Random/WeightedRandomPrototype.cs | 2 +- .../Prototypes/TechnologyPrototype.cs | 2 +- Content.Shared/Roles/AntagPrototype.cs | 2 +- Content.Shared/Roles/DepartmentPrototype.cs | 2 +- Content.Shared/Roles/JobPrototype.cs | 2 +- Content.Shared/Roles/StartingGearPrototype.cs | 2 +- .../Components/EventHorizonComponent.cs | 2 +- .../EntitySystems/SharedEventHorizonSystem.cs | 2 +- .../EntitySystems/SharedSingularitySystem.cs | 2 +- .../Speech/SpeechSoundsPrototype.cs | 2 +- Content.Shared/Stacks/StackPrototype.cs | 2 +- .../StatusEffect/StatusEffectPrototype.cs | 2 +- .../Stealth/Components/StealthComponent.cs | 5 +- Content.Shared/Stealth/SharedStealthSystem.cs | 2 +- .../Storage/Components/DumpableComponent.cs | 2 +- Content.Shared/Store/ListingPrototype.cs | 4 +- Content.Shared/Tag/TagPrototype.cs | 2 +- Content.Shared/Tools/ToolQualityPrototype.cs | 2 +- Content.Shared/Verbs/Verb.cs | 2 +- .../Weapons/Ranged/HitscanPrototype.cs | 2 +- Content.Shared/Weather/WeatherPrototype.cs | 2 +- Content.Tools/Merger.cs | 12 +-- Content.Tools/YamlTools.cs | 4 +- Pow3r/Program.OpenGL.cs | 4 +- Pow3r/Program.Veldrid.cs | 2 +- 265 files changed, 499 insertions(+), 666 deletions(-) diff --git a/Content.Benchmarks/NetSerializerStringBenchmark.cs b/Content.Benchmarks/NetSerializerStringBenchmark.cs index 32421fcb8b..2b1b143117 100644 --- a/Content.Benchmarks/NetSerializerStringBenchmark.cs +++ b/Content.Benchmarks/NetSerializerStringBenchmark.cs @@ -377,7 +377,7 @@ namespace Content.Benchmarks throw new EndOfStreamException(); streamBytesLeft -= bytesInBuffer; - bool flush = streamBytesLeft == 0 ? true : false; + bool flush = streamBytesLeft == 0; bool completed = false; diff --git a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs index 67222800e7..664ba22072 100644 --- a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs +++ b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml.cs @@ -108,7 +108,7 @@ namespace Content.Client.Administration.UI.Bwoink return a.ActiveThisRound ? -1 : 1; // Finally, sort by the most recent message. - return bch!.LastMessage.CompareTo(ach!.LastMessage); + return bch.LastMessage.CompareTo(ach.LastMessage); }; Bans.OnPressed += _ => diff --git a/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs b/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs index ca56e5bcaf..33273ebbeb 100644 --- a/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs +++ b/Content.Client/Administration/UI/SpawnExplosion/ExplosionDebugOverlay.cs @@ -104,12 +104,12 @@ public sealed class ExplosionDebugOverlay : Overlay var screenCenter = _eyeManager.WorldToScreen(worldCenter); - if (Intensity![i] > 9) + if (Intensity[i] > 9) screenCenter += (-12, -8); else screenCenter += (-8, -8); - handle.DrawString(_font, screenCenter, Intensity![i].ToString("F2")); + handle.DrawString(_font, screenCenter, Intensity[i].ToString("F2")); } } @@ -118,7 +118,7 @@ public sealed class ExplosionDebugOverlay : Overlay var epicenter = tileSets[0].First(); var worldCenter = transform.Transform(((Vector2) epicenter + 0.5f) * tileSize); var screenCenter = _eyeManager.WorldToScreen(worldCenter) + (-24, -24); - var text = $"{Intensity![0]:F2}\nΣ={TotalIntensity:F1}\nΔ={Slope:F1}"; + var text = $"{Intensity[0]:F2}\nΣ={TotalIntensity:F1}\nΔ={Slope:F1}"; handle.DrawString(_font, screenCenter, text); } } @@ -159,7 +159,7 @@ public sealed class ExplosionDebugOverlay : Overlay { for (var i = 0; i < Intensity.Count; i++) { - var color = ColorMap(Intensity![i]); + var color = ColorMap(Intensity[i]); var colorTransparent = color; colorTransparent.A = 0.2f; @@ -183,7 +183,7 @@ public sealed class ExplosionDebugOverlay : Overlay private Color ColorMap(float intensity) { - var frac = 1 - intensity / Intensity![0]; + var frac = 1 - intensity / Intensity[0]; Color result; if (frac < 0.5f) result = Color.InterpolateBetween(Color.Red, Color.Orange, frac * 2); diff --git a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml index 2a13604e99..fb68e6c790 100644 --- a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml +++ b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml @@ -1,5 +1,4 @@  diff --git a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs index 4f1dd4b895..9ad0ca8cc6 100644 --- a/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs @@ -32,7 +32,7 @@ public sealed partial class ObjectsTab : Control foreach (var type in Enum.GetValues(typeof(ObjectsTabSelection))) { _selections.Add((ObjectsTabSelection)type!); - ObjectTypeOptions.AddItem(Enum.GetName((ObjectsTabSelection)type!)!); + ObjectTypeOptions.AddItem(Enum.GetName((ObjectsTabSelection)type)!); } RefreshObjectList(_selections[ObjectTypeOptions.SelectedId]); @@ -43,9 +43,9 @@ public sealed partial class ObjectsTab : Control var entities = selection switch { ObjectsTabSelection.Stations => _entityManager.EntitySysManager.GetEntitySystem().Stations.ToList(), - ObjectsTabSelection.Grids => _entityManager.EntityQuery(true).Select(x => ((Component) x).Owner).ToList(), + ObjectsTabSelection.Grids => _entityManager.EntityQuery(true).Select(x => x.Owner).ToList(), ObjectsTabSelection.Maps => _entityManager.EntityQuery(true).Select(x => x.Owner).ToList(), - _ => throw new ArgumentOutOfRangeException(nameof(selection), selection, null) + _ => throw new ArgumentOutOfRangeException(nameof(selection), selection, null), }; foreach (var control in _objects) diff --git a/Content.Client/Atmos/Monitor/UI/Widgets/PumpControl.xaml.cs b/Content.Client/Atmos/Monitor/UI/Widgets/PumpControl.xaml.cs index 457bc6e535..94123e0dff 100644 --- a/Content.Client/Atmos/Monitor/UI/Widgets/PumpControl.xaml.cs +++ b/Content.Client/Atmos/Monitor/UI/Widgets/PumpControl.xaml.cs @@ -43,7 +43,7 @@ public sealed partial class PumpControl : BoxContainer PumpDataChanged?.Invoke(_address, _data); }; - _internalBound.Value = (float) _data.InternalPressureBound; + _internalBound.Value = _data.InternalPressureBound; _internalBound.OnValueChanged += _ => { _data.InternalPressureBound = _internalBound.Value; @@ -51,7 +51,7 @@ public sealed partial class PumpControl : BoxContainer }; _internalBound.IsValid += value => value >= 0; - _externalBound.Value = (float) _data.ExternalPressureBound; + _externalBound.Value = _data.ExternalPressureBound; _externalBound.OnValueChanged += _ => { _data.ExternalPressureBound = _externalBound.Value; diff --git a/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml.cs b/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml.cs index 26782ab424..da63db77d3 100644 --- a/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml.cs +++ b/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml.cs @@ -33,7 +33,7 @@ public sealed partial class ThresholdBoundControl : BoxContainer public void SetValue(float value) { _value = value; - CSpinner.Value = (float) ScaledValue!; + CSpinner.Value = ScaledValue; } public void SetEnabled(bool enabled) diff --git a/Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs b/Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs index fe6a42f706..e02a8d69d8 100644 --- a/Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs +++ b/Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs @@ -55,7 +55,7 @@ namespace Content.Client.Atmos.Overlays var dataMaybeNull = _atmosDebugOverlaySystem.GetData(mapGrid.Owner, tile.GridIndices); if (dataMaybeNull != null) { - var data = (SharedAtmosDebugOverlaySystem.AtmosDebugOverlayData) dataMaybeNull!; + var data = (SharedAtmosDebugOverlaySystem.AtmosDebugOverlayData) dataMaybeNull; if (pass == 0) { // -- Mole Count -- diff --git a/Content.Client/Atmos/Overlays/GasTileOverlay.cs b/Content.Client/Atmos/Overlays/GasTileOverlay.cs index a446156f81..ac8eb70afc 100644 --- a/Content.Client/Atmos/Overlays/GasTileOverlay.cs +++ b/Content.Client/Atmos/Overlays/GasTileOverlay.cs @@ -40,7 +40,7 @@ namespace Content.Client.Atmos.Overlays private int _gasCount; - public const int GasOverlayZIndex = (int) Content.Shared.DrawDepth.DrawDepth.Effects; // Under ghosts, above mostly everything else + public const int GasOverlayZIndex = (int) Shared.DrawDepth.DrawDepth.Effects; // Under ghosts, above mostly everything else public GasTileOverlay(GasTileOverlaySystem system, IEntityManager entManager, IResourceCache resourceCache, IPrototypeManager protoMan, SpriteSystem spriteSys) { diff --git a/Content.Client/Atmos/UI/GasFilterWindow.xaml b/Content.Client/Atmos/UI/GasFilterWindow.xaml index b161c7025e..30333b07bd 100644 --- a/Content.Client/Atmos/UI/GasFilterWindow.xaml +++ b/Content.Client/Atmos/UI/GasFilterWindow.xaml @@ -1,6 +1,5 @@ diff --git a/Content.Client/Atmos/UI/GasFilterWindow.xaml.cs b/Content.Client/Atmos/UI/GasFilterWindow.xaml.cs index cd2f8075b9..74cef4b39b 100644 --- a/Content.Client/Atmos/UI/GasFilterWindow.xaml.cs +++ b/Content.Client/Atmos/UI/GasFilterWindow.xaml.cs @@ -37,7 +37,7 @@ namespace Content.Client.Atmos.UI FilterTransferRateInput.OnTextChanged += _ => SetFilterRate.Disabled = false; SetFilterRate.OnPressed += _ => { - FilterTransferRateChanged?.Invoke(FilterTransferRateInput.Text ??= ""); + FilterTransferRateChanged?.Invoke(FilterTransferRateInput.Text); SetFilterRate.Disabled = true; }; diff --git a/Content.Client/Atmos/UI/GasMixerWindow.xaml b/Content.Client/Atmos/UI/GasMixerWindow.xaml index 405907be4b..7e74348962 100644 --- a/Content.Client/Atmos/UI/GasMixerWindow.xaml +++ b/Content.Client/Atmos/UI/GasMixerWindow.xaml @@ -1,6 +1,5 @@ diff --git a/Content.Client/Atmos/UI/GasPressurePumpWindow.xaml b/Content.Client/Atmos/UI/GasPressurePumpWindow.xaml index 039c39596a..8be7a84e86 100644 --- a/Content.Client/Atmos/UI/GasPressurePumpWindow.xaml +++ b/Content.Client/Atmos/UI/GasPressurePumpWindow.xaml @@ -1,6 +1,5 @@ diff --git a/Content.Client/Atmos/UI/GasVolumePumpWindow.xaml b/Content.Client/Atmos/UI/GasVolumePumpWindow.xaml index 9630430791..93ebc35a93 100644 --- a/Content.Client/Atmos/UI/GasVolumePumpWindow.xaml +++ b/Content.Client/Atmos/UI/GasVolumePumpWindow.xaml @@ -1,6 +1,5 @@ diff --git a/Content.Client/Cargo/BUI/CargoOrderConsoleBoundUserInterface.cs b/Content.Client/Cargo/BUI/CargoOrderConsoleBoundUserInterface.cs index f81109fdc8..5107ed9e13 100644 --- a/Content.Client/Cargo/BUI/CargoOrderConsoleBoundUserInterface.cs +++ b/Content.Client/Cargo/BUI/CargoOrderConsoleBoundUserInterface.cs @@ -75,8 +75,8 @@ namespace Content.Client.Cargo.BUI description.PushColor(Color.White); // Rich text default color is grey if (row.MainButton.ToolTip != null) description.AddText(row.MainButton.ToolTip); - _orderMenu.Description.SetMessage(description); + _orderMenu.Description.SetMessage(description); _product = row.Product; _orderMenu.ProductName.Text = row.ProductName.Text; _orderMenu.PointCost.Text = row.PointCost.Text; diff --git a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs index f0dc1a2579..477288e5c8 100644 --- a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs +++ b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs @@ -153,8 +153,8 @@ namespace Content.Client.Chemistry.UI /// State data for the dispenser. private void UpdatePanelInfo(ChemMasterBoundUserInterfaceState state) { - BufferTransferButton.Pressed = state.Mode == Shared.Chemistry.ChemMasterMode.Transfer; - BufferDiscardButton.Pressed = state.Mode == Shared.Chemistry.ChemMasterMode.Discard; + BufferTransferButton.Pressed = state.Mode == ChemMasterMode.Transfer; + BufferDiscardButton.Pressed = state.Mode == ChemMasterMode.Discard; BuildContainerUI(InputContainerInfo, state.InputContainerInfo, true); BuildContainerUI(OutputContainerInfo, state.OutputContainerInfo, false); diff --git a/Content.Client/Clickable/ClickMapManager.cs b/Content.Client/Clickable/ClickMapManager.cs index 848e9d0d3d..6f34f4453c 100644 --- a/Content.Client/Clickable/ClickMapManager.cs +++ b/Content.Client/Clickable/ClickMapManager.cs @@ -53,7 +53,7 @@ namespace Content.Client.Clickable var pathStr = obj.Path.ToString(); foreach (var path in IgnoreTexturePaths) { - if (pathStr.StartsWith(path)) + if (pathStr.StartsWith(path, StringComparison.Ordinal)) return; } diff --git a/Content.Client/Clickable/ClickableComponent.cs b/Content.Client/Clickable/ClickableComponent.cs index dd5e152280..56d562bd13 100644 --- a/Content.Client/Clickable/ClickableComponent.cs +++ b/Content.Client/Clickable/ClickableComponent.cs @@ -85,7 +85,7 @@ namespace Content.Client.Clickable // Next, to get the right click map we need the "direction" of this layer that is actually being used to draw the sprite on the screen. // This **can** differ from the dir defined before, but can also just be the same. if (sprite.EnableDirectionOverride) - dir = sprite.DirectionOverride.Convert(rsiState.Directions);; + dir = sprite.DirectionOverride.Convert(rsiState.Directions); dir = dir.OffsetRsiDir(layer.DirOffset); if (_clickMapManager.IsOccluding(layer.ActualRsi!, layer.State, dir, layer.AnimationFrame, layerImagePos)) diff --git a/Content.Client/CloningConsole/UI/CloningConsoleWindow.xaml b/Content.Client/CloningConsole/UI/CloningConsoleWindow.xaml index 958bc83d11..f08b94c7ac 100644 --- a/Content.Client/CloningConsole/UI/CloningConsoleWindow.xaml +++ b/Content.Client/CloningConsole/UI/CloningConsoleWindow.xaml @@ -1,6 +1,5 @@ diff --git a/Content.Client/CloningConsole/UI/CloningConsoleWindow.xaml.cs b/Content.Client/CloningConsole/UI/CloningConsoleWindow.xaml.cs index 4e97784250..b71f1a282f 100644 --- a/Content.Client/CloningConsole/UI/CloningConsoleWindow.xaml.cs +++ b/Content.Client/CloningConsole/UI/CloningConsoleWindow.xaml.cs @@ -2,7 +2,6 @@ using Robust.Client.AutoGenerated; using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; using Content.Client.Message; -using Robust.Shared.Timing; using Content.Shared.Cloning.CloningConsole; namespace Content.Client.CloningConsole.UI @@ -18,11 +17,6 @@ namespace Content.Client.CloningConsole.UI private CloningConsoleBoundUserInterfaceState? _lastUpdate; - protected override void FrameUpdate(FrameEventArgs args) - { - base.FrameUpdate(args); - } - public void Populate(CloningConsoleBoundUserInterfaceState state) { _lastUpdate = state; diff --git a/Content.Client/Computer/ComputerBoundUserInterface.cs b/Content.Client/Computer/ComputerBoundUserInterface.cs index 2dccd68d21..1a65c168c9 100644 --- a/Content.Client/Computer/ComputerBoundUserInterface.cs +++ b/Content.Client/Computer/ComputerBoundUserInterface.cs @@ -52,7 +52,7 @@ namespace Content.Client.Computer } /// - /// This class is to avoid a lot of <> being written when we just want to refer to SendMessage. + /// This class is to avoid a lot of <> being written when we just want to refer to SendMessage. /// We could instead qualify a lot of generics even further, but that is a waste of time. /// [Virtual] diff --git a/Content.Client/Decals/UI/DecalPlacerWindow.xaml b/Content.Client/Decals/UI/DecalPlacerWindow.xaml index a2f1c6be7b..19c63a44bc 100644 --- a/Content.Client/Decals/UI/DecalPlacerWindow.xaml +++ b/Content.Client/Decals/UI/DecalPlacerWindow.xaml @@ -1,5 +1,4 @@  diff --git a/Content.Client/DragDrop/DragDropHelper.cs b/Content.Client/DragDrop/DragDropHelper.cs index 8f4f2381c5..959ff5e789 100644 --- a/Content.Client/DragDrop/DragDropHelper.cs +++ b/Content.Client/DragDrop/DragDropHelper.cs @@ -61,10 +61,7 @@ namespace Content.Client.DragDrop /// /// /// - /// drag will be triggered when mouse leaves - /// this deadzone around the mousedown position - public DragDropHelper(OnBeginDrag onBeginDrag, OnContinueDrag onContinueDrag, - OnEndDrag onEndDrag) + public DragDropHelper(OnBeginDrag onBeginDrag, OnContinueDrag onContinueDrag, OnEndDrag onEndDrag) { _inputManager = IoCManager.Resolve(); _onBeginDrag = onBeginDrag; diff --git a/Content.Client/Fax/UI/FaxWindow.xaml b/Content.Client/Fax/UI/FaxWindow.xaml index c83e617aa7..7b68316b11 100644 --- a/Content.Client/Fax/UI/FaxWindow.xaml +++ b/Content.Client/Fax/UI/FaxWindow.xaml @@ -1,5 +1,4 @@ @@ -29,4 +28,4 @@ Text="{Loc 'fax-machine-ui-refresh-button'}" /> - \ No newline at end of file + diff --git a/Content.Client/Fluids/PuddleVisualizerSystem.cs b/Content.Client/Fluids/PuddleVisualizerSystem.cs index ad3db77afe..56d652799c 100644 --- a/Content.Client/Fluids/PuddleVisualizerSystem.cs +++ b/Content.Client/Fluids/PuddleVisualizerSystem.cs @@ -45,57 +45,36 @@ namespace Content.Client.Fluids return; } - if (args.Component.TryGetData(PuddleVisuals.VolumeScale, out float volumeScale) - && args.Component.TryGetData(PuddleVisuals.CurrentVolume, out FixedPoint2 currentVolume) - && args.Component.TryGetData(PuddleVisuals.SolutionColor, out Color solutionColor) - && args.Component.TryGetData(PuddleVisuals.IsEvaporatingVisual, out bool isEvaporating)) + if (!args.Component.TryGetData(PuddleVisuals.VolumeScale, out float volumeScale) + || !args.Component.TryGetData(PuddleVisuals.CurrentVolume, out FixedPoint2 currentVolume) + || !args.Component.TryGetData(PuddleVisuals.SolutionColor, out Color solutionColor) + || !args.Component.TryGetData(PuddleVisuals.IsEvaporatingVisual, out bool isEvaporating)) { - // volumeScale is our opacity based on level of fullness to overflow. The lower bound is hard-capped for visibility reasons. - var cappedScale = Math.Min(1.0f, volumeScale * 0.75f + 0.25f); + return; + } - Color newColor; - if (component.Recolor) - { - newColor = solutionColor.WithAlpha(cappedScale); - } - else - { - newColor = args.Sprite.Color.WithAlpha(cappedScale); - } + // volumeScale is our opacity based on level of fullness to overflow. The lower bound is hard-capped for visibility reasons. + var cappedScale = Math.Min(1.0f, volumeScale * 0.75f + 0.25f); - args.Sprite.LayerSetColor(0, newColor); + var newColor = component.Recolor ? solutionColor.WithAlpha(cappedScale) : args.Sprite.Color.WithAlpha(cappedScale); - if (component.CustomPuddleSprite) //Don't consider wet floor effects if we're using a custom sprite. - { - return; - } + args.Sprite.LayerSetColor(0, newColor); - bool wetFloorEffectNeeded; + // Don't consider wet floor effects if we're using a custom sprite. + if (component.CustomPuddleSprite) + return; - if (isEvaporating - && currentVolume <= component.WetFloorEffectThreshold) - { - wetFloorEffectNeeded = true; - } - else - wetFloorEffectNeeded = false; - - if (wetFloorEffectNeeded) - { - if (args.Sprite.LayerGetState(0) != "sparkles") // If we need the effect but don't already have it - start it - { - StartWetFloorEffect(args.Sprite, component.WetFloorEffectAlpha); - } - } - else - { - if (args.Sprite.LayerGetState(0) == "sparkles") // If we have the effect but don't need it - end it - EndWetFloorEffect(args.Sprite, component.OriginalRsi); - } + if (isEvaporating && currentVolume <= component.WetFloorEffectThreshold) + { + // If we need the effect but don't already have it - start it + if (args.Sprite.LayerGetState(0) != "sparkles") + StartWetFloorEffect(args.Sprite, component.WetFloorEffectAlpha); } else { - return; + // If we have the effect but don't need it - end it + if (args.Sprite.LayerGetState(0) == "sparkles") + EndWetFloorEffect(args.Sprite, component.OriginalRsi); } } diff --git a/Content.Client/Guidebook/Controls/GuidebookWindow.xaml b/Content.Client/Guidebook/Controls/GuidebookWindow.xaml index e23b083674..b8c4f9e251 100644 --- a/Content.Client/Guidebook/Controls/GuidebookWindow.xaml +++ b/Content.Client/Guidebook/Controls/GuidebookWindow.xaml @@ -1,5 +1,4 @@ -? guides = new(); + Dictionary guides = new(); foreach (var guideId in guideList) { if (!_prototypeManager.TryIndex(guideId, out var guide)) diff --git a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs index 61a281cb42..2a7afdd716 100644 --- a/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs +++ b/Content.Client/HealthAnalyzer/UI/HealthAnalyzerWindow.xaml.cs @@ -37,7 +37,7 @@ namespace Content.Client.HealthAnalyzer.UI text.Append($"{Loc.GetString("health-analyzer-window-entity-health-text", ("entityName", entityName))}\n"); - /// Status Effects / Components + // Status Effects / Components if (entities.HasComponent(msg.TargetEntity)) { text.Append($"{Loc.GetString("disease-scanner-diseased")}\n"); @@ -46,7 +46,7 @@ namespace Content.Client.HealthAnalyzer.UI text.Append($"{Loc.GetString("disease-scanner-not-diseased")}\n"); } - /// Damage + // Damage text.Append($"\n{Loc.GetString("health-analyzer-window-entity-damage-total-text", ("amount", damageable.TotalDamage))}\n"); HashSet shownTypes = new(); diff --git a/Content.Client/Humanoid/MarkingPicker.xaml.cs b/Content.Client/Humanoid/MarkingPicker.xaml.cs index 2e53365ce0..7a6babc9af 100644 --- a/Content.Client/Humanoid/MarkingPicker.xaml.cs +++ b/Content.Client/Humanoid/MarkingPicker.xaml.cs @@ -282,6 +282,7 @@ public sealed partial class MarkingPicker : Control _currentMarkings.ShiftRankUpFromEnd(_selectedMarkingCategory, src); break; // do nothing? + // ReSharper disable once RedundantEmptySwitchSection default: break; } diff --git a/Content.Client/Instruments/InstrumentSystem.cs b/Content.Client/Instruments/InstrumentSystem.cs index 64bf036b9b..11ceb36df5 100644 --- a/Content.Client/Instruments/InstrumentSystem.cs +++ b/Content.Client/Instruments/InstrumentSystem.cs @@ -150,13 +150,6 @@ public sealed class InstrumentSystem : SharedInstrumentSystem var tick = instrument.Renderer.SequencerTick-1; instrument.MidiEventBuffer.Add(RobustMidiEvent.SystemReset(tick)); - - // We add a "all notes off" message. - for (byte i = 0; i < 16; i++) - { - //instrument.MidiEventBuffer.Add(RobustMidiEvent.AllNotesOff(i, tick)); - } - instrument.Renderer.PlayerTick = playerTick; } diff --git a/Content.Client/Lathe/UI/LatheMenu.xaml b/Content.Client/Lathe/UI/LatheMenu.xaml index fef6d9a171..f5f6ecff8b 100644 --- a/Content.Client/Lathe/UI/LatheMenu.xaml +++ b/Content.Client/Lathe/UI/LatheMenu.xaml @@ -1,7 +1,5 @@  diff --git a/Content.Client/Lathe/UI/LatheQueueMenu.xaml b/Content.Client/Lathe/UI/LatheQueueMenu.xaml index 73f3b1dacd..901af24a30 100644 --- a/Content.Client/Lathe/UI/LatheQueueMenu.xaml +++ b/Content.Client/Lathe/UI/LatheQueueMenu.xaml @@ -1,6 +1,5 @@  diff --git a/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs b/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs index ee609feb93..02670f7774 100644 --- a/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs +++ b/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs @@ -142,7 +142,7 @@ namespace Content.Client.Lobby.UI var highPriorityJob = profile.JobPriorities.FirstOrDefault(p => p.Value == JobPriority.High).Key; - // ReSharper disable once ConstantNullCoalescingCondition + // ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract (what is resharper smoking?) var job = protoMan.Index(highPriorityJob ?? SharedGameTicker.FallbackOverflowJob); if (job.StartingGear != null && invSystem.TryGetSlots(dummy, out var slots)) diff --git a/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs b/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs index d2cee8d9b3..0cdc3b53fb 100644 --- a/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs +++ b/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs @@ -1,3 +1,4 @@ +using System.Globalization; using Robust.Client.AutoGenerated; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; @@ -111,11 +112,11 @@ namespace Content.Client.Options.UI.Tabs ApplyButton.Disabled = isEverythingSame; ResetButton.Disabled = isEverythingSame; - NetInterpRatioLabel.Text = NetInterpRatioSlider.Value.ToString(); - NetPredictTickBiasLabel.Text = NetPredictTickBiasSlider.Value.ToString(); - NetPvsSpawnLabel.Text = NetPvsSpawnSlider.Value.ToString(); - NetPvsEntryLabel.Text = NetPvsEntrySlider.Value.ToString(); - NetPvsLeaveLabel.Text = NetPvsLeaveSlider.Value.ToString(); + NetInterpRatioLabel.Text = NetInterpRatioSlider.Value.ToString(CultureInfo.InvariantCulture); + NetPredictTickBiasLabel.Text = NetPredictTickBiasSlider.Value.ToString(CultureInfo.InvariantCulture); + NetPvsSpawnLabel.Text = NetPvsSpawnSlider.Value.ToString(CultureInfo.InvariantCulture); + NetPvsEntryLabel.Text = NetPvsEntrySlider.Value.ToString(CultureInfo.InvariantCulture); + NetPvsLeaveLabel.Text = NetPvsLeaveSlider.Value.ToString(CultureInfo.InvariantCulture); // TODO disable / grey-out the predict and interp sliders if prediction is disabled. // Currently no option to do this, but should be added to the slider control in general diff --git a/Content.Client/PDA/Ringer/RingtoneMenu.xaml.cs b/Content.Client/PDA/Ringer/RingtoneMenu.xaml.cs index 3daa87efc1..cb638efcd9 100644 --- a/Content.Client/PDA/Ringer/RingtoneMenu.xaml.cs +++ b/Content.Client/PDA/Ringer/RingtoneMenu.xaml.cs @@ -9,16 +9,16 @@ namespace Content.Client.PDA.Ringer [GenerateTypedNameReferences] public sealed partial class RingtoneMenu : DefaultWindow { - public string[] PreviousNoteInputs = new string[] { "A", "A", "A", "A"}; - public LineEdit[] RingerNoteInputs = default!; + public string[] PreviousNoteInputs = new[] { "A", "A", "A", "A" }; + public LineEdit[] RingerNoteInputs = default!; public RingtoneMenu() { RobustXamlLoader.Load(this); - RingerNoteInputs = new LineEdit[] { RingerNoteOneInput, RingerNoteTwoInput, RingerNoteThreeInput, RingerNoteFourInput }; + RingerNoteInputs = new[] { RingerNoteOneInput, RingerNoteTwoInput, RingerNoteThreeInput, RingerNoteFourInput }; - for (int i = 0; i < RingerNoteInputs.Length; i++) + for (int i = 0; i < RingerNoteInputs.Length; i++) { var input = RingerNoteInputs[i]; int index = i; diff --git a/Content.Client/Paper/UI/PaperWindow.xaml b/Content.Client/Paper/UI/PaperWindow.xaml index 60f4e36e00..c2f4a197e2 100644 --- a/Content.Client/Paper/UI/PaperWindow.xaml +++ b/Content.Client/Paper/UI/PaperWindow.xaml @@ -1,7 +1,5 @@ diff --git a/Content.Client/Paper/UI/PaperWindow.xaml.cs b/Content.Client/Paper/UI/PaperWindow.xaml.cs index 218a3c2d7e..56b8f00afa 100644 --- a/Content.Client/Paper/UI/PaperWindow.xaml.cs +++ b/Content.Client/Paper/UI/PaperWindow.xaml.cs @@ -46,7 +46,7 @@ namespace Content.Client.Paper.UI { var resCache = IoCManager.Resolve(); - /// Initialize the background: + // Initialize the background: PaperBackground.ModulateSelfOverride = visuals.BackgroundModulate; var backgroundImage = visuals.BackgroundImagePath != null? resCache.GetResource(visuals.BackgroundImagePath) : null; if (backgroundImage != null) @@ -111,7 +111,7 @@ namespace Content.Client.Paper.UI // So, we'll make the window non-resizable and fix the size of the content. // Ideally, would like to be able to allow resizing only one direction. ScrollingContents.MinSize = Vector2.Zero; - ScrollingContents.MinSize = (Vector2)(a); + ScrollingContents.MinSize = a; if (a.X > 0.0f) { diff --git a/Content.Client/Paper/UI/StampWidget.xaml b/Content.Client/Paper/UI/StampWidget.xaml index 5aeb9788fd..f0398353b7 100644 --- a/Content.Client/Paper/UI/StampWidget.xaml +++ b/Content.Client/Paper/UI/StampWidget.xaml @@ -1,14 +1,8 @@ - - diff --git a/Content.Client/Parallax/Data/GeneratedParallaxTextureSource.cs b/Content.Client/Parallax/Data/GeneratedParallaxTextureSource.cs index 638051a6d5..702ba5f3ab 100644 --- a/Content.Client/Parallax/Data/GeneratedParallaxTextureSource.cs +++ b/Content.Client/Parallax/Data/GeneratedParallaxTextureSource.cs @@ -76,7 +76,7 @@ public sealed class GeneratedParallaxTextureSource : IParallaxTextureSource catch (Exception ex) { Logger.ErrorS("parallax", $"Couldn't retrieve parallax cached texture: {ex}"); - // The show must go on. + try { // Also try to at least sort of fix this if we've been fooled by a config backup @@ -84,6 +84,7 @@ public sealed class GeneratedParallaxTextureSource : IParallaxTextureSource } catch (Exception) { + // The show must go on. } return Texture.Transparent; } diff --git a/Content.Client/Parallax/Data/ParallaxPrototype.cs b/Content.Client/Parallax/Data/ParallaxPrototype.cs index e57b431823..cfba2bb826 100644 --- a/Content.Client/Parallax/Data/ParallaxPrototype.cs +++ b/Content.Client/Parallax/Data/ParallaxPrototype.cs @@ -14,7 +14,7 @@ namespace Content.Client.Parallax.Data; public sealed class ParallaxPrototype : IPrototype { /// - [IdDataFieldAttribute] + [IdDataField] public string ID { get; } = default!; /// diff --git a/Content.Client/Preferences/UI/CharacterSetupGui.xaml b/Content.Client/Preferences/UI/CharacterSetupGui.xaml index 5b79561744..5db8610475 100644 --- a/Content.Client/Preferences/UI/CharacterSetupGui.xaml +++ b/Content.Client/Preferences/UI/CharacterSetupGui.xaml @@ -1,7 +1,6 @@ diff --git a/Content.Client/Stylesheets/StyleNano.cs b/Content.Client/Stylesheets/StyleNano.cs index b329f0d550..7d2fb429f7 100644 --- a/Content.Client/Stylesheets/StyleNano.cs +++ b/Content.Client/Stylesheets/StyleNano.cs @@ -22,15 +22,15 @@ namespace Content.Client.Stylesheets public static Font NotoStack(this IResourceCache resCache, string variation = "Regular", int size = 10, bool display = false) { var ds = display ? "Display" : ""; - var sv = variation.StartsWith("Bold") ? "Bold" : "Regular"; + var sv = variation.StartsWith("Bold", StringComparison.Ordinal) ? "Bold" : "Regular"; return resCache.GetFont ( // Ew, but ok - new [] + new[] { $"/Fonts/NotoSans{ds}/NotoSans{ds}-{variation}.ttf", $"/Fonts/NotoSans/NotoSansSymbols-{sv}.ttf", - "/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf" + "/Fonts/NotoSans/NotoSansSymbols2-Regular.ttf", }, size ); diff --git a/Content.Client/SurveillanceCamera/UI/SurveillanceCameraSetupWindow.xaml.cs b/Content.Client/SurveillanceCamera/UI/SurveillanceCameraSetupWindow.xaml.cs index 8e25045f1a..a7feb9db54 100644 --- a/Content.Client/SurveillanceCamera/UI/SurveillanceCameraSetupWindow.xaml.cs +++ b/Content.Client/SurveillanceCamera/UI/SurveillanceCameraSetupWindow.xaml.cs @@ -56,7 +56,7 @@ public sealed partial class SurveillanceCameraSetupWindow : DefaultWindow id++; } - idList.Sort((a, b) => a.networkName.CompareTo(b.networkName)); + idList.Sort((a, b) => string.Compare(a.networkName, b.networkName, StringComparison.Ordinal)); foreach (var (networkId, network) in idList) { diff --git a/Content.Client/Targeting/UI/TargetingDoll.xaml b/Content.Client/Targeting/UI/TargetingDoll.xaml index 1f2949bb37..f50ddfe448 100644 --- a/Content.Client/Targeting/UI/TargetingDoll.xaml +++ b/Content.Client/Targeting/UI/TargetingDoll.xaml @@ -1,17 +1,7 @@  + Orientation="Vertical"> diff --git a/Content.Client/UserInterface/Controls/MenuButton.cs b/Content.Client/UserInterface/Controls/MenuButton.cs index 9896dbc006..028412eae7 100644 --- a/Content.Client/UserInterface/Controls/MenuButton.cs +++ b/Content.Client/UserInterface/Controls/MenuButton.cs @@ -26,11 +26,11 @@ public sealed class MenuButton : ContainerButton private BoundKeyFunction _function; private readonly BoxContainer _root; - private readonly TextureRect _buttonIcon; - private readonly Label _buttonLabel; + private readonly TextureRect? _buttonIcon; + private readonly Label? _buttonLabel; public string AppendStyleClass { set => AddStyleClass(value); } - public Texture? Icon { get => _buttonIcon.Texture; set => _buttonIcon.Texture = value; } + public Texture? Icon { get => _buttonIcon!.Texture; set => _buttonIcon!.Texture = value; } public BoundKeyFunction BoundKey { @@ -38,7 +38,7 @@ public sealed class MenuButton : ContainerButton set { _function = value; - _buttonLabel.Text = BoundKeyHelper.ShortKeyName(value); + _buttonLabel!.Text = BoundKeyHelper.ShortKeyName(value); } } @@ -95,12 +95,12 @@ public sealed class MenuButton : ContainerButton private void OnKeyBindingChanged(IKeyBinding obj) { - _buttonLabel.Text = BoundKeyHelper.ShortKeyName(_function); + _buttonLabel!.Text = BoundKeyHelper.ShortKeyName(_function); } private void OnKeyBindingChanged() { - _buttonLabel.Text = BoundKeyHelper.ShortKeyName(_function); + _buttonLabel!.Text = BoundKeyHelper.ShortKeyName(_function); } protected override void StylePropertiesChanged() diff --git a/Content.Client/UserInterface/Systems/Actions/ActionUIController.cs b/Content.Client/UserInterface/Systems/Actions/ActionUIController.cs index ad8172695f..c47fba16a2 100644 --- a/Content.Client/UserInterface/Systems/Actions/ActionUIController.cs +++ b/Content.Client/UserInterface/Systems/Actions/ActionUIController.cs @@ -886,7 +886,6 @@ public sealed class ActionUIController : UIController, IOnStateChanged - /// public void ToggleTargeting(TargetedAction action) { if (SelectingTargetFor == action) @@ -952,7 +951,7 @@ public sealed class ActionUIController : UIController, IOnStateChanged(out var handOverlay) || handOverlay == null) + if (!_overlays.TryGetOverlay(out var handOverlay)) return; handOverlay.IconOverride = null; diff --git a/Content.Client/UserInterface/Systems/Actions/Widgets/ActionsBar.xaml b/Content.Client/UserInterface/Systems/Actions/Widgets/ActionsBar.xaml index 145325ee8f..b6d5bb92af 100644 --- a/Content.Client/UserInterface/Systems/Actions/Widgets/ActionsBar.xaml +++ b/Content.Client/UserInterface/Systems/Actions/Widgets/ActionsBar.xaml @@ -1,7 +1,6 @@  _bwoinkSystem?.Send(userId, textMessage); diff --git a/Content.Client/UserInterface/Systems/Character/Controls/CharacterObjectiveControl.xaml b/Content.Client/UserInterface/Systems/Character/Controls/CharacterObjectiveControl.xaml index eada8823af..a384163c6d 100644 --- a/Content.Client/UserInterface/Systems/Character/Controls/CharacterObjectiveControl.xaml +++ b/Content.Client/UserInterface/Systems/Character/Controls/CharacterObjectiveControl.xaml @@ -1,6 +1,5 @@  diff --git a/Content.Client/UserInterface/Systems/Chat/Controls/ChannelFilterButton.cs b/Content.Client/UserInterface/Systems/Chat/Controls/ChannelFilterButton.cs index 5534ea21dd..43f189211f 100644 --- a/Content.Client/UserInterface/Systems/Chat/Controls/ChannelFilterButton.cs +++ b/Content.Client/UserInterface/Systems/Chat/Controls/ChannelFilterButton.cs @@ -11,7 +11,7 @@ public sealed class ChannelFilterButton : ContainerButton private static readonly Color ColorNormal = Color.FromHex("#7b7e9e"); private static readonly Color ColorHovered = Color.FromHex("#9699bb"); private static readonly Color ColorPressed = Color.FromHex("#789B8C"); - private readonly TextureRect _textureRect; + private readonly TextureRect? _textureRect; public readonly ChannelFilterPopup ChatFilterPopup; private readonly ChatUIController _chatUIController; private const int FilterDropdownOffset = 120; diff --git a/Content.Client/UserInterface/Systems/Inventory/Controls/InventoryDisplay.cs b/Content.Client/UserInterface/Systems/Inventory/Controls/InventoryDisplay.cs index 31923c0501..0110463f4f 100644 --- a/Content.Client/UserInterface/Systems/Inventory/Controls/InventoryDisplay.cs +++ b/Content.Client/UserInterface/Systems/Inventory/Controls/InventoryDisplay.cs @@ -21,7 +21,7 @@ public sealed class InventoryDisplay : LayoutContainer AddChild(resizer); } - public SlotControl? AddButton(SlotControl newButton, Vector2i buttonOffset) + public SlotControl AddButton(SlotControl newButton, Vector2i buttonOffset) { AddChild(newButton); HorizontalExpand = true; diff --git a/Content.Client/UserInterface/Systems/Objectives/Controls/ObjectiveBriefingControl.xaml b/Content.Client/UserInterface/Systems/Objectives/Controls/ObjectiveBriefingControl.xaml index 2acf022ead..5b49c0e3a7 100644 --- a/Content.Client/UserInterface/Systems/Objectives/Controls/ObjectiveBriefingControl.xaml +++ b/Content.Client/UserInterface/Systems/Objectives/Controls/ObjectiveBriefingControl.xaml @@ -1,6 +1,5 @@