makes conveyors to use machine linking & refactors machine linking a bit (#2464)

* makes conveyors to use machine linking & refactors machine linking a bit

* nullable errors

* temp commit, starting work on construction

* working recipies & graphs

* fixes crash

* makes items gravitate towards the center when on a conveyor

* makes conveyors take bool signal too

* ignores components clientside

* default arm
entitymanager
maxtransmitters
unsubscribe methods

* twowayLEVER

* _

* componentreference
struct

* yaml run
leverDefinitelyNotCopiedFromGirderNoNoNo dies today :(

* nullable

* no divide by 0

* making sloth happy

* space gone - happy?

* final fix

* yes

* adds item to lathe

* conveyor item -> conveyor assembly

* technology

* reviews ADRESSED

* Update Content.Shared/GameObjects/Verbs/VerbUtility.cs

Co-authored-by: Paul <ritter.paul1+git@googlemail.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
Paul Ritter
2020-11-18 14:53:46 +01:00
committed by GitHub
parent 2cae1ac641
commit 501156f84c
24 changed files with 345 additions and 447 deletions

View File

@@ -16,7 +16,6 @@ namespace Content.Client.GameObjects.Components.Conveyor
private string _stateRunning;
private string _stateStopped;
private string _stateReversed;
private string _stateLoose;
private void ChangeState(AppearanceComponent appearance)
{
@@ -32,7 +31,6 @@ namespace Content.Client.GameObjects.Components.Conveyor
ConveyorState.Off => _stateStopped,
ConveyorState.Forward => _stateRunning,
ConveyorState.Reversed => _stateReversed,
ConveyorState.Loose => _stateLoose,
_ => throw new ArgumentOutOfRangeException()
};
@@ -46,7 +44,6 @@ namespace Content.Client.GameObjects.Components.Conveyor
_stateRunning = node.GetNode("state_running").AsString();
_stateStopped = node.GetNode("state_stopped").AsString();
_stateReversed = node.GetNode("state_reversed").AsString();
_stateLoose = node.GetNode("state_loose").AsString();
}
public override void InitializeEntity(IEntity entity)

View File

@@ -1,5 +1,6 @@
using System;
using Content.Shared.GameObjects.Components.Conveyor;
using Content.Shared.GameObjects.Components.MachineLinking;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.Interfaces.GameObjects.Components;
@@ -11,12 +12,11 @@ using YamlDotNet.RepresentationModel;
namespace Content.Client.GameObjects.Components.Conveyor
{
[UsedImplicitly]
public class ConveyorSwitchVisualizer : AppearanceVisualizer
public class TwoWayLeverVisualizer : AppearanceVisualizer
{
private string _stateForward;
private string _stateOff;
private string _stateReversed;
private string _stateLoose;
private void ChangeState(AppearanceComponent appearance)
{
@@ -25,15 +25,14 @@ namespace Content.Client.GameObjects.Components.Conveyor
return;
}
appearance.TryGetData(ConveyorVisuals.State, out ConveyorState state);
appearance.TryGetData(TwoWayLeverVisuals.State, out TwoWayLeverSignal state);
var texture = state switch
{
ConveyorState.Off => _stateOff,
ConveyorState.Forward => _stateForward,
ConveyorState.Reversed => _stateReversed,
ConveyorState.Loose => _stateLoose,
_ => throw new ArgumentOutOfRangeException()
TwoWayLeverSignal.Middle => _stateOff,
TwoWayLeverSignal.Right => _stateForward,
TwoWayLeverSignal.Left => _stateReversed,
_ => _stateOff
};
sprite.LayerSetState(0, texture);
@@ -46,7 +45,6 @@ namespace Content.Client.GameObjects.Components.Conveyor
_stateForward = node.GetNode("state_forward").AsString();
_stateOff = node.GetNode("state_off").AsString();
_stateReversed = node.GetNode("state_reversed").AsString();
_stateLoose = node.GetNode("state_loose").AsString();
}
public override void InitializeEntity(IEntity entity)

View File

@@ -135,7 +135,6 @@
"DisposalBend",
"Recycler",
"Conveyor",
"ConveyorSwitch",
"Flippable",
"Airtight",
"MovedByPressure",
@@ -211,6 +210,8 @@
"CrematoriumEntityStorage",
"RandomArcade",
"RandomSpriteState",
"ConveyorAssembly",
"TwoWayLever"
};
}
}