Fix warnings and code cleanup/fixes (#13570)

This commit is contained in:
Visne
2023-01-19 03:56:45 +01:00
committed by GitHub
parent 3ca5a0224b
commit c6d3e4f3bd
265 changed files with 499 additions and 666 deletions

View File

@@ -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 += _ =>

View File

@@ -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);

View File

@@ -1,5 +1,4 @@
<Control xmlns="https://spacestation14.io"
xmlns:pt="clr-namespace:Content.Client.Administration.UI.Tabs.PlayerTab"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls">
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">

View File

@@ -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<StationSystem>().Stations.ToList(),
ObjectsTabSelection.Grids => _entityManager.EntityQuery<MapGridComponent>(true).Select(x => ((Component) x).Owner).ToList(),
ObjectsTabSelection.Grids => _entityManager.EntityQuery<MapGridComponent>(true).Select(x => x.Owner).ToList(),
ObjectsTabSelection.Maps => _entityManager.EntityQuery<MapComponent>(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)