machine frame tweaks (#13248)
Closes https://github.com/space-wizards/space-station-14/issues/11547 Closes https://github.com/space-wizards/space-station-14/issues/11549
This commit is contained in:
@@ -1,23 +0,0 @@
|
|||||||
using Content.Shared.Construction;
|
|
||||||
using JetBrains.Annotations;
|
|
||||||
using Robust.Client.GameObjects;
|
|
||||||
|
|
||||||
namespace Content.Client.Construction
|
|
||||||
{
|
|
||||||
[UsedImplicitly]
|
|
||||||
public sealed class MachineFrameVisualizer : AppearanceVisualizer
|
|
||||||
{
|
|
||||||
[Obsolete("Subscribe to AppearanceChangeEvent instead.")]
|
|
||||||
public override void OnChangeData(AppearanceComponent component)
|
|
||||||
{
|
|
||||||
base.OnChangeData(component);
|
|
||||||
|
|
||||||
if (component.TryGetData<int>(MachineFrameVisuals.State, out var data))
|
|
||||||
{
|
|
||||||
var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<ISpriteComponent>(component.Owner);
|
|
||||||
|
|
||||||
sprite.LayerSetState(0, $"box_{data}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +1,15 @@
|
|||||||
using Content.Server.Construction.Components;
|
using Content.Server.Construction.Components;
|
||||||
using Content.Server.Stack;
|
using Content.Server.Stack;
|
||||||
using Content.Shared.Construction;
|
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Stacks;
|
using Content.Shared.Stacks;
|
||||||
using Content.Shared.Tag;
|
using Content.Shared.Tag;
|
||||||
using Robust.Server.GameObjects;
|
|
||||||
using Robust.Shared.Containers;
|
using Robust.Shared.Containers;
|
||||||
|
|
||||||
namespace Content.Server.Construction;
|
namespace Content.Server.Construction;
|
||||||
|
|
||||||
public sealed class MachineFrameSystem : EntitySystem
|
public sealed class MachineFrameSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private readonly AppearanceSystem _appearance = default!;
|
|
||||||
[Dependency] private readonly IComponentFactory _factory = default!;
|
[Dependency] private readonly IComponentFactory _factory = default!;
|
||||||
[Dependency] private readonly SharedContainerSystem _container = default!;
|
[Dependency] private readonly SharedContainerSystem _container = default!;
|
||||||
[Dependency] private readonly TagSystem _tag = default!;
|
[Dependency] private readonly TagSystem _tag = default!;
|
||||||
@@ -58,8 +55,6 @@ public sealed class MachineFrameSystem : EntitySystem
|
|||||||
// Setup requirements and progress...
|
// Setup requirements and progress...
|
||||||
ResetProgressAndRequirements(component, machineBoard);
|
ResetProgressAndRequirements(component, machineBoard);
|
||||||
|
|
||||||
_appearance.SetData(uid, MachineFrameVisuals.State, 2);
|
|
||||||
|
|
||||||
if (TryComp(uid, out ConstructionComponent? construction))
|
if (TryComp(uid, out ConstructionComponent? construction))
|
||||||
{
|
{
|
||||||
// So prying the components off works correctly.
|
// So prying the components off works correctly.
|
||||||
@@ -224,8 +219,6 @@ public sealed class MachineFrameSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
if (!component.HasBoard)
|
if (!component.HasBoard)
|
||||||
{
|
{
|
||||||
_appearance.SetData(component.Owner, MachineFrameVisuals.State, 1);
|
|
||||||
|
|
||||||
component.TagRequirements.Clear();
|
component.TagRequirements.Clear();
|
||||||
component.MaterialRequirements.Clear();
|
component.MaterialRequirements.Clear();
|
||||||
component.ComponentRequirements.Clear();
|
component.ComponentRequirements.Clear();
|
||||||
@@ -243,8 +236,6 @@ public sealed class MachineFrameSystem : EntitySystem
|
|||||||
if (!TryComp<MachineBoardComponent>(board, out var machineBoard))
|
if (!TryComp<MachineBoardComponent>(board, out var machineBoard))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_appearance.SetData(component.Owner, MachineFrameVisuals.State, 2);
|
|
||||||
|
|
||||||
ResetProgressAndRequirements(component, machineBoard);
|
ResetProgressAndRequirements(component, machineBoard);
|
||||||
|
|
||||||
foreach (var part in component.PartContainer.ContainedEntities)
|
foreach (var part in component.PartContainer.ContainedEntities)
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
using Robust.Shared.Serialization;
|
|
||||||
|
|
||||||
namespace Content.Shared.Construction
|
|
||||||
{
|
|
||||||
[NetSerializable]
|
|
||||||
public enum MachineFrameVisuals
|
|
||||||
{
|
|
||||||
State,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
|
construction-condition-machine-container-empty = Remove the parts from the frame using a [color=cyan]Crowbar[/color].
|
||||||
|
|
||||||
# MachineFrameComplete
|
# MachineFrameComplete
|
||||||
construction-condition-machine-frame-requirement-label = Requires:
|
construction-condition-machine-frame-requirement-label = Requires:
|
||||||
construction-condition-machine-frame-insert-circuit-board-message = Insert [color=cyan]any machine circuit board[/color].
|
construction-condition-machine-frame-insert-circuit-board-message = Insert [color=cyan]any machine circuit board[/color].
|
||||||
|
|||||||
@@ -104,9 +104,13 @@
|
|||||||
sprite: Structures/Machines/parts.rsi
|
sprite: Structures/Machines/parts.rsi
|
||||||
state: box_1
|
state: box_1
|
||||||
- type: Appearance
|
- type: Appearance
|
||||||
visuals:
|
- type: ItemMapper
|
||||||
- type: MachineFrameVisualizer
|
mapLayers:
|
||||||
|
box_2:
|
||||||
|
minCount: 1
|
||||||
|
whitelist:
|
||||||
|
components:
|
||||||
|
- MachineBoard
|
||||||
|
|
||||||
- type: entity
|
- type: entity
|
||||||
id: MachineFrameDestroyed
|
id: MachineFrameDestroyed
|
||||||
|
|||||||
@@ -25,8 +25,6 @@
|
|||||||
- node: missingWires
|
- node: missingWires
|
||||||
entity: UnfinishedMachineFrame
|
entity: UnfinishedMachineFrame
|
||||||
actions:
|
actions:
|
||||||
- !type:SpriteStateChange
|
|
||||||
state: "box_0"
|
|
||||||
- !type:EmptyAllContainers
|
- !type:EmptyAllContainers
|
||||||
edges:
|
edges:
|
||||||
- to: machineFrame
|
- to: machineFrame
|
||||||
@@ -69,18 +67,28 @@
|
|||||||
- tool: Screwing
|
- tool: Screwing
|
||||||
doAfter: 0.5
|
doAfter: 0.5
|
||||||
|
|
||||||
- to: missingWires
|
- to: machineFrame
|
||||||
conditions:
|
conditions:
|
||||||
- !type:EntityAnchored
|
- !type:EntityAnchored
|
||||||
completed:
|
- !type:ContainerNotEmpty
|
||||||
- !type:SpawnPrototype
|
container: machine_board
|
||||||
prototype: CableApcStack1
|
|
||||||
steps:
|
steps:
|
||||||
- tool: Prying
|
- tool: Prying
|
||||||
doAfter: 2
|
doAfter: 2
|
||||||
completed:
|
completed:
|
||||||
- !type:EmptyAllContainers
|
- !type:EmptyAllContainers
|
||||||
- !type:MachineFrameRegenerateProgress
|
- !type:MachineFrameRegenerateProgress
|
||||||
|
|
||||||
|
- to: missingWires
|
||||||
|
conditions:
|
||||||
|
- !type:EntityAnchored
|
||||||
|
- !type:ContainerEmpty
|
||||||
|
container: machine_board
|
||||||
|
examineText: construction-condition-machine-container-empty
|
||||||
|
completed:
|
||||||
|
- !type:SpawnPrototype
|
||||||
|
prototype: CableApcStack1
|
||||||
|
steps:
|
||||||
- tool: Cutting
|
- tool: Cutting
|
||||||
doAfter: 0.25
|
doAfter: 0.25
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user