Fix a bunch of warnings (#5058)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using Content.Client.GameObjects.Components;
|
||||
using Content.Client.Computer;
|
||||
using Content.Shared.Solar;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.AutoGenerated;
|
||||
@@ -27,32 +27,36 @@ namespace Content.Client.Power
|
||||
|
||||
public void SetupComputerWindow(ComputerBoundUserInterfaceBase cb)
|
||||
{
|
||||
PanelRotation.OnTextEntered += (text) => {
|
||||
PanelRotation.OnTextEntered += text => {
|
||||
double value;
|
||||
if (double.TryParse((string?) text.Text, out value))
|
||||
if (!double.TryParse((string?) text.Text, out value)) return;
|
||||
|
||||
SolarControlConsoleAdjustMessage msg = new()
|
||||
{
|
||||
SolarControlConsoleAdjustMessage msg = new SolarControlConsoleAdjustMessage();
|
||||
msg.Rotation = Angle.FromDegrees(value);
|
||||
msg.AngularVelocity = _lastState.AngularVelocity;
|
||||
cb.SendMessage(msg);
|
||||
// Predict this...
|
||||
_lastState.Rotation = msg.Rotation;
|
||||
NotARadar.UpdateState(_lastState);
|
||||
}
|
||||
Rotation = Angle.FromDegrees(value), AngularVelocity = _lastState.AngularVelocity,
|
||||
};
|
||||
|
||||
cb.SendMessage(msg);
|
||||
|
||||
// Predict this...
|
||||
_lastState.Rotation = msg.Rotation;
|
||||
NotARadar.UpdateState(_lastState);
|
||||
};
|
||||
PanelVelocity.OnTextEntered += (text) => {
|
||||
PanelVelocity.OnTextEntered += text => {
|
||||
double value;
|
||||
if (double.TryParse((string?) text.Text, out value))
|
||||
if (!double.TryParse((string?) text.Text, out value)) return;
|
||||
|
||||
SolarControlConsoleAdjustMessage msg = new()
|
||||
{
|
||||
SolarControlConsoleAdjustMessage msg = new SolarControlConsoleAdjustMessage();
|
||||
msg.Rotation = NotARadar.PredictedPanelRotation;
|
||||
msg.AngularVelocity = Angle.FromDegrees(value / 60);
|
||||
cb.SendMessage(msg);
|
||||
// Predict this...
|
||||
_lastState.Rotation = NotARadar.PredictedPanelRotation;
|
||||
_lastState.AngularVelocity = msg.AngularVelocity;
|
||||
NotARadar.UpdateState(_lastState);
|
||||
}
|
||||
Rotation = NotARadar.PredictedPanelRotation, AngularVelocity = Angle.FromDegrees(value / 60),
|
||||
};
|
||||
|
||||
cb.SendMessage(msg);
|
||||
|
||||
// Predict this...
|
||||
_lastState.Rotation = NotARadar.PredictedPanelRotation;
|
||||
_lastState.AngularVelocity = msg.AngularVelocity;
|
||||
NotARadar.UpdateState(_lastState);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user