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

View File

@@ -1,15 +1,9 @@
using System;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Timing;
namespace Content.Client.GameObjects.Components
namespace Content.Client.Computer
{
/// <summary>
/// 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 ComputerBoundUserInterfaceBase(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey) {}
public void SendMessage(BoundUserInterfaceMessage msg)
public new void SendMessage(BoundUserInterfaceMessage msg)
{
base.SendMessage(msg);
}

View File

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

View File

@@ -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;
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);
Rotation = NotARadar.PredictedPanelRotation, AngularVelocity = Angle.FromDegrees(value / 60),
};
cb.SendMessage(msg);
// Predict this...
_lastState.Rotation = NotARadar.PredictedPanelRotation;
_lastState.AngularVelocity = msg.AngularVelocity;
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.Shared.GameObjects;
using Robust.Shared.Log;
@@ -23,9 +23,7 @@ namespace Content.Client.Singularity.Components
}
else
{
#pragma warning disable 618
_spriteComponent.Directional = false;
#pragma warning restore 618
_spriteComponent.NoRotation = true;
}
}
}

View File

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

View File

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

View File

@@ -427,7 +427,7 @@ namespace Content.Server.Interaction
/// </summary>
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;
if (target != null)

View File

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

View File

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

View File

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