Fix a bunch of warnings (#5058)

This commit is contained in:
Visne
2021-10-28 13:19:38 +02:00
committed by GitHub
parent 0bca9befca
commit 94579d1877
11 changed files with 65 additions and 73 deletions

View File

@@ -3,43 +3,40 @@
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client" xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
MinSize="400 525" MinSize="400 525"
Title="{Loc 'chem-master-bound-user-interface-title'}"> Title="{Loc 'chem-master-bound-user-interface-title'}">
<BoxContainer Name="Contents" <BoxContainer Orientation="Vertical"
Access="Internal"
Orientation="Vertical"
Margin="5 5 5 5" Margin="5 5 5 5"
SeparationOverride="10"> SeparationOverride="10">
<!-- Container -->
<BoxContainer Orientation="Horizontal"> <BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'chem-master-window-container-label'}"></Label> <Label Text="{Loc 'chem-master-window-container-label'}" />
<Control HorizontalExpand="True"></Control> <Control HorizontalExpand="True" />
<Button Name="EjectButton" <Button Name="EjectButton"
Access="Internal" Access="Public"
Text="{Loc 'chem-master-window-eject-button'}" /> Text="{Loc 'chem-master-window-eject-button'}" />
</BoxContainer> </BoxContainer>
<PanelContainer VerticalExpand="True" SizeFlagsStretchRatio="6" MinSize="0 200"> <PanelContainer VerticalExpand="True"
SizeFlagsStretchRatio="6"
MinSize="0 200">
<PanelContainer.PanelOverride> <PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" /> <gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
</PanelContainer.PanelOverride> </PanelContainer.PanelOverride>
<!-- Initially empty, when server sends state data this will have container contents and fill volume.--> <!-- Initially empty, when server sends state data this will have container contents and fill volume.-->
<BoxContainer Name="ContainerInfo" <BoxContainer Name="ContainerInfo"
Access="Internal"
Orientation="Vertical" Orientation="Vertical"
HorizontalExpand="True"> HorizontalExpand="True">
<Label Text="{Loc 'chem-master-window-no-container-loaded-text'}" /> <Label Text="{Loc 'chem-master-window-no-container-loaded-text'}" />
</BoxContainer> </BoxContainer>
</PanelContainer> </PanelContainer>
<!-- Padding -->
<Control MinSize="0 10" /> <Control MinSize="0 10" />
<!-- Buffer --> <!-- Buffer -->
<BoxContainer Orientation="Horizontal"> <BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'chem-master-window-buffer-text'}"></Label> <Label Text="{Loc 'chem-master-window-buffer-text'}" />
<Control HorizontalExpand="True" /> <Control HorizontalExpand="True" />
<Button Name="BufferTransferButton" <Button Name="BufferTransferButton"
Access="Internal" Access="Public"
Text="{Loc 'chem-master-window-transfer-button'}" ToggleMode="True" Text="{Loc 'chem-master-window-transfer-button'}" ToggleMode="True"
StyleClasses="OpenRight" /> StyleClasses="OpenRight" />
<Button Name="BufferDiscardButton" <Button Name="BufferDiscardButton"
Access="Internal" Access="Public"
Text="{Loc 'chem-master-window-discard-button'}" ToggleMode="True" Text="{Loc 'chem-master-window-discard-button'}" ToggleMode="True"
StyleClasses="OpenLeft" /> StyleClasses="OpenLeft" />
</BoxContainer> </BoxContainer>
@@ -50,7 +47,6 @@
</PanelContainer.PanelOverride> </PanelContainer.PanelOverride>
<!-- Buffer reagent list --> <!-- Buffer reagent list -->
<BoxContainer Name="BufferInfo" <BoxContainer Name="BufferInfo"
Access="Internal"
Orientation="Vertical" Orientation="Vertical"
HorizontalExpand="True"> HorizontalExpand="True">
<Label Text="{Loc 'chem-master-window-buffer-empty-text'}" /> <Label Text="{Loc 'chem-master-window-buffer-empty-text'}" />
@@ -64,7 +60,9 @@
<Label Text="{Loc 'chem-master-window-packaging-text'}" /> <Label Text="{Loc 'chem-master-window-packaging-text'}" />
</BoxContainer> </BoxContainer>
<!-- Wrap the packaging info--> <!-- Wrap the packaging info-->
<PanelContainer VerticalExpand="True" SizeFlagsStretchRatio="6" MinSize="0 100"> <PanelContainer VerticalExpand="True"
SizeFlagsStretchRatio="6"
MinSize="0 100">
<PanelContainer.PanelOverride> <PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" /> <gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
</PanelContainer.PanelOverride> </PanelContainer.PanelOverride>
@@ -72,33 +70,30 @@
<BoxContainer Orientation="Vertical" <BoxContainer Orientation="Vertical"
HorizontalExpand="True"> HorizontalExpand="True">
<!-- Packaging Info --> <!-- Packaging Info -->
<BoxContainer Name="PackagingInfo" <BoxContainer Orientation="Vertical"
Access="Internal"
Orientation="Vertical"
HorizontalExpand="True"> HorizontalExpand="True">
<BoxContainer Name="PillInfo" <BoxContainer Orientation="Horizontal">
Access="Internal" <Label Text="{Loc 'chem-master-window-pills-label'}" />
Orientation="Horizontal">
<Label Text="{Loc 'chem-master-window-pills-label'}"></Label>
<Control HorizontalExpand="True" <Control HorizontalExpand="True"
MinSize="50 0"> MinSize="50 0" />
</Control> <SpinBox Name="PillAmount"
<SpinBox Name="PillAmount" Access="Internal" Value="1" /> Access="Public"
Value="1" />
<Button Name="CreatePillButton" <Button Name="CreatePillButton"
Access="Internal" Access="Public"
Text="{Loc 'chem-master-window-create-pill-button'}" /> Text="{Loc 'chem-master-window-create-pill-button'}" />
<Label Text="{Loc 'chem-master-window-max-pills-volume-text'}" <Label Text="{Loc 'chem-master-window-max-pills-volume-text'}"
StyleClasses="LabelSecondaryColor" /> StyleClasses="LabelSecondaryColor" />
</BoxContainer> </BoxContainer>
<BoxContainer Name="BottleInfo" <BoxContainer Orientation="Horizontal">
Access="Internal"
Orientation="Horizontal">
<Label Text="{Loc 'chem-master-window-bottles-label'}" /> <Label Text="{Loc 'chem-master-window-bottles-label'}" />
<Control HorizontalExpand="True" <Control HorizontalExpand="True"
MinSize="50 0" /> MinSize="50 0" />
<SpinBox Name="BottleAmount" Access="Internal" Value="1" /> <SpinBox Name="BottleAmount"
Access="Public"
Value="1" />
<Button Name="CreateBottleButton" <Button Name="CreateBottleButton"
Access="Internal" Access="Public"
Text="{Loc 'chem-master-window-create-bottle-button'}" /> Text="{Loc 'chem-master-window-create-bottle-button'}" />
<Label Text="{Loc 'chem-master-window-max-bottles-volume-text'}" <Label Text="{Loc 'chem-master-window-max-bottles-volume-text'}"
StyleClasses="LabelSecondaryColor" /> StyleClasses="LabelSecondaryColor" />

View File

@@ -1,15 +1,9 @@
using System;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Timing;
namespace Content.Client.GameObjects.Components namespace Content.Client.Computer
{ {
/// <summary> /// <summary>
/// ComputerBoundUserInterface shunts all sorts of responsibilities that are in the BoundUserInterface for architectural reasons into the Window. /// ComputerBoundUserInterface shunts all sorts of responsibilities that are in the BoundUserInterface for architectural reasons into the Window.
@@ -63,7 +57,8 @@ namespace Content.Client.GameObjects.Components
public class ComputerBoundUserInterfaceBase : BoundUserInterface public class ComputerBoundUserInterfaceBase : BoundUserInterface
{ {
public ComputerBoundUserInterfaceBase(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey) {} public ComputerBoundUserInterfaceBase(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey) {}
public void SendMessage(BoundUserInterfaceMessage msg)
public new void SendMessage(BoundUserInterfaceMessage msg)
{ {
base.SendMessage(msg); base.SendMessage(msg);
} }

View File

@@ -192,7 +192,7 @@ namespace Content.Client.DragDrop
dragSprite.Color = dragSprite.Color.WithAlpha(0.7f); dragSprite.Color = dragSprite.Color.WithAlpha(0.7f);
// keep it on top of everything // keep it on top of everything
dragSprite.DrawDepth = (int) DrawDepth.Overlays; dragSprite.DrawDepth = (int) DrawDepth.Overlays;
if (dragSprite.Directional) if (!dragSprite.NoRotation)
{ {
_dragShadow.Transform.WorldRotation = _dragDropHelper.Dragged.Transform.WorldRotation; _dragShadow.Transform.WorldRotation = _dragDropHelper.Dragged.Transform.WorldRotation;
} }

View File

@@ -1,5 +1,5 @@
using System; using System;
using Content.Client.GameObjects.Components; using Content.Client.Computer;
using Content.Shared.Solar; using Content.Shared.Solar;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
@@ -27,32 +27,36 @@ namespace Content.Client.Power
public void SetupComputerWindow(ComputerBoundUserInterfaceBase cb) public void SetupComputerWindow(ComputerBoundUserInterfaceBase cb)
{ {
PanelRotation.OnTextEntered += (text) => { PanelRotation.OnTextEntered += text => {
double value; 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(); Rotation = Angle.FromDegrees(value), AngularVelocity = _lastState.AngularVelocity,
msg.Rotation = Angle.FromDegrees(value); };
msg.AngularVelocity = _lastState.AngularVelocity;
cb.SendMessage(msg); cb.SendMessage(msg);
// Predict this... // Predict this...
_lastState.Rotation = msg.Rotation; _lastState.Rotation = msg.Rotation;
NotARadar.UpdateState(_lastState); NotARadar.UpdateState(_lastState);
}
}; };
PanelVelocity.OnTextEntered += (text) => { PanelVelocity.OnTextEntered += text => {
double value; 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(); Rotation = NotARadar.PredictedPanelRotation, AngularVelocity = Angle.FromDegrees(value / 60),
msg.Rotation = NotARadar.PredictedPanelRotation; };
msg.AngularVelocity = Angle.FromDegrees(value / 60);
cb.SendMessage(msg); cb.SendMessage(msg);
// Predict this... // Predict this...
_lastState.Rotation = NotARadar.PredictedPanelRotation; _lastState.Rotation = NotARadar.PredictedPanelRotation;
_lastState.AngularVelocity = msg.AngularVelocity; _lastState.AngularVelocity = msg.AngularVelocity;
NotARadar.UpdateState(_lastState); NotARadar.UpdateState(_lastState);
}
}; };
} }

View File

@@ -1,4 +1,4 @@
using Content.Shared.Singularity.Components; using Content.Shared.Singularity.Components;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Log; using Robust.Shared.Log;
@@ -23,9 +23,7 @@ namespace Content.Client.Singularity.Components
} }
else else
{ {
#pragma warning disable 618 _spriteComponent.NoRotation = true;
_spriteComponent.Directional = false;
#pragma warning restore 618
} }
} }
} }

View File

@@ -17,7 +17,7 @@ namespace Content.Server.Chemistry.Components
public class FoamSolutionAreaEffectComponent : SolutionAreaEffectComponent public class FoamSolutionAreaEffectComponent : SolutionAreaEffectComponent
{ {
public override string Name => "FoamSolutionAreaEffect"; public override string Name => "FoamSolutionAreaEffect";
public static string SolutionName = "foam"; public new const string SolutionName = "foam";
[DataField("foamedMetalPrototype")] private string? _foamedMetalPrototype; [DataField("foamedMetalPrototype")] private string? _foamedMetalPrototype;

View File

@@ -14,7 +14,7 @@ namespace Content.Server.Chemistry.Components
public class SmokeSolutionAreaEffectComponent : SolutionAreaEffectComponent public class SmokeSolutionAreaEffectComponent : SolutionAreaEffectComponent
{ {
public override string Name => "SmokeSolutionAreaEffect"; public override string Name => "SmokeSolutionAreaEffect";
public const string SolutionName = "smoke"; public new const string SolutionName = "smoke";
protected override void UpdateVisuals() protected override void UpdateVisuals()
{ {

View File

@@ -427,7 +427,7 @@ namespace Content.Server.Interaction
/// </summary> /// </summary>
public async Task<bool> InteractUsingRanged(IEntity user, IEntity used, IEntity? target, EntityCoordinates clickLocation, bool inRangeUnobstructed) public async Task<bool> InteractUsingRanged(IEntity user, IEntity used, IEntity? target, EntityCoordinates clickLocation, bool inRangeUnobstructed)
{ {
if (await InteractDoBefore(user, used, inRangeUnobstructed ? target : null, clickLocation, false)) if (InteractDoBefore(user, used, inRangeUnobstructed ? target : null, clickLocation, false))
return true; return true;
if (target != null) if (target != null)

View File

@@ -354,7 +354,7 @@ namespace Content.Shared.Interaction
return inRange; return inRange;
} }
public async Task<bool> InteractDoBefore( public bool InteractDoBefore(
IEntity user, IEntity user,
IEntity used, IEntity used,
IEntity? target, IEntity? target,
@@ -376,7 +376,7 @@ namespace Content.Shared.Interaction
if (!_actionBlockerSystem.CanInteract(user)) if (!_actionBlockerSystem.CanInteract(user))
return; return;
if (await InteractDoBefore(user, used, target, clickLocation, true)) if (InteractDoBefore(user, used, target, clickLocation, true))
return; return;
// all interactions should only happen when in range / unobstructed, so no range check is needed // all interactions should only happen when in range / unobstructed, so no range check is needed

View File

@@ -8,7 +8,7 @@
caliber: Cap caliber: Cap
- type: Sprite - type: Sprite
netsync: false netsync: false
directional: true noRot: false
sprite: Objects/Weapons/Guns/Ammunition/Casings/ammo_casing.rsi sprite: Objects/Weapons/Guns/Ammunition/Casings/ammo_casing.rsi
layers: layers:
- state: base - state: base

View File

@@ -97,7 +97,7 @@
abstract: true abstract: true
components: components:
- type: Sprite - type: Sprite
directional: false noRot: true
sprite: Objects/Weapons/Guns/Projectiles/spark.rsi sprite: Objects/Weapons/Guns/Projectiles/spark.rsi
color: "#ffff33" color: "#ffff33"
layers: layers: