Fix warnings and code cleanup/fixes (#13570)
This commit is contained in:
@@ -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 += _ =>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user