Merge branch 'master' into expl_int_analyzer

This commit is contained in:
Pieter-Jan Briers
2021-02-08 22:46:28 +01:00
140 changed files with 3622 additions and 1208 deletions

View File

@@ -1,3 +1,5 @@
// ReSharper disable once RedundantUsingDirective
// Used to warn the player in big red letters in debug mode
using System;
using Content.Client.GameObjects.Components;
using Content.Client.GameObjects.EntitySystems;
@@ -8,6 +10,7 @@ using Robust.Shared.Console;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
namespace Content.Client.Commands
{
@@ -93,6 +96,10 @@ namespace Content.Client.Commands
return;
}
#if DEBUG
shell.WriteError("WARNING: The client is using a debug build. You are risking losing your changes.");
#endif
shell.ConsoleHost.RegisteredCommands["togglelight"].Execute(shell, string.Empty, Array.Empty<string>());
shell.ConsoleHost.RegisteredCommands["showsubfloorforever"].Execute(shell, string.Empty, Array.Empty<string>());

View File

@@ -1,4 +1,5 @@
using Content.Shared.GameObjects.Components.ActionBlocking;
#nullable enable
using Content.Shared.GameObjects.Components.ActionBlocking;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Shared.GameObjects;
@@ -6,9 +7,10 @@ using Robust.Shared.GameObjects;
namespace Content.Client.GameObjects.Components.ActionBlocking
{
[RegisterComponent]
[ComponentReference(typeof(SharedHandcuffComponent))]
public class HandcuffComponent : SharedHandcuffComponent
{
public override void HandleComponentState(ComponentState curState, ComponentState nextState)
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
{
if (curState is not HandcuffedComponentState state)
{

View File

@@ -1,3 +1,4 @@
// ReSharper disable ArrangeTrailingCommaInMultilineLists
namespace Content.Client
{
public static class IgnoredComponents
@@ -242,7 +243,10 @@ namespace Content.Client
"SecretStash",
"Toilet",
"ClusterFlash",
"GasGenerator"
"GasGenerator",
"SolutionTransfer",
"Shovel",
"ReagentTank",
};
}
}

View File

@@ -0,0 +1,68 @@
#nullable enable
using Robust.Client.Placement;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Content.Client.Placement.Modes
{
public class WallmountLight : PlacementMode
{
public WallmountLight(PlacementManager pMan) : base(pMan)
{
}
public override void AlignPlacementMode(ScreenCoordinates mouseScreen)
{
MouseCoords = ScreenToCursorGrid(mouseScreen);
CurrentTile = GetTileRef(MouseCoords);
if (pManager.CurrentPermission!.IsTile)
{
return;
}
var tileCoordinates = new EntityCoordinates(MouseCoords.EntityId, CurrentTile.GridIndices);
Vector2 offset;
switch (pManager.Direction)
{
case Direction.North:
offset = new Vector2(0.5f, 1f);
break;
case Direction.South:
offset = new Vector2(0.5f, 0f);
break;
case Direction.East:
offset = new Vector2(1f, 0.5f);
break;
case Direction.West:
offset = new Vector2(0f, 0.5f);
break;
default:
return;
}
tileCoordinates = tileCoordinates.Offset(offset);
MouseCoords = tileCoordinates;
}
public override bool IsValidPosition(EntityCoordinates position)
{
if (pManager.CurrentPermission!.IsTile)
{
return false;
}
else if (!RangeCheck(position))
{
return false;
}
return true;
}
}
}

View File

@@ -188,11 +188,11 @@ namespace Content.Client.ParticleAccelerator
new MarginContainer
{
MarginLeftOverride = 4,
SizeFlagsHorizontal = SizeFlags.FillExpand,
Children =
{
new VBoxContainer
{
SizeFlagsHorizontal = SizeFlags.FillExpand,
Children =
{
new HBoxContainer
@@ -246,55 +246,61 @@ namespace Content.Client.ParticleAccelerator
}
}
},
new VBoxContainer
new MarginContainer
{
SizeFlagsHorizontal = SizeFlags.FillExpand,
CustomMinimumSize = (186, 0),
Children =
{
(_statusLabel = new Label
new VBoxContainer
{
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
}),
new Control
{
CustomMinimumSize = (0, 20)
},
new PanelContainer
{
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
PanelOverride = back2,
Children =
{
new GridContainer
(_statusLabel = new Label
{
Columns = 3,
VSeparationOverride = 0,
HSeparationOverride = 0,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
}),
new Control
{
CustomMinimumSize = (0, 20)
},
new PanelContainer
{
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
PanelOverride = back2,
Children =
{
new Control {CustomMinimumSize = imgSize},
(_endCapTexture = Segment("end_cap")),
new Control {CustomMinimumSize = imgSize},
(_controlBoxTexture = Segment("control_box")),
(_fuelChamberTexture = Segment("fuel_chamber")),
new Control {CustomMinimumSize = imgSize},
new Control {CustomMinimumSize = imgSize},
(_powerBoxTexture = Segment("power_box")),
new Control {CustomMinimumSize = imgSize},
(_emitterLeftTexture = Segment("emitter_left")),
(_emitterCenterTexture = Segment("emitter_center")),
(_emitterRightTexture = Segment("emitter_right")),
new GridContainer
{
Columns = 3,
VSeparationOverride = 0,
HSeparationOverride = 0,
Children =
{
new Control {CustomMinimumSize = imgSize},
(_endCapTexture = Segment("end_cap")),
new Control {CustomMinimumSize = imgSize},
(_controlBoxTexture = Segment("control_box")),
(_fuelChamberTexture = Segment("fuel_chamber")),
new Control {CustomMinimumSize = imgSize},
new Control {CustomMinimumSize = imgSize},
(_powerBoxTexture = Segment("power_box")),
new Control {CustomMinimumSize = imgSize},
(_emitterLeftTexture = Segment("emitter_left")),
(_emitterCenterTexture = Segment("emitter_center")),
(_emitterRightTexture = Segment("emitter_right")),
}
}
}
}
},
(_scanButton = new Button
{
Text = Loc.GetString("Scan Parts"),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
})
}
},
(_scanButton = new Button
{
Text = Loc.GetString("Scan Parts"),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
})
}
}
}
},
}
},
new StripeBack
@@ -507,7 +513,7 @@ namespace Content.Client.ParticleAccelerator
public void SetPowerState(ParticleAcceleratorUIState state, bool exists)
{
_base.ShaderOverride = exists ? null : _menu._greyScaleShader;
_base.ModulateSelfOverride = exists ? (Color?)null : new Color(127, 127, 127);
_base.ModulateSelfOverride = exists ? (Color?) null : new Color(127, 127, 127);
if (!state.Enabled || !exists)
{