APC construction updated, uses electronics (#10987)
* APC construction and deconstruction Construction action GivePrototype * APC needs screwing + sprites * apc framework, working construction recipe * Energy swords hot * APC changes * APC construction/deconstruction * removed comments * Revert "Energy swords hot" This reverts commit 75228483abb3cc6252118b319bc8949d5198362d. * Renamed function for clarity * Fixed the last step not showing in the construction menu * Some fixes * Update Content.Server/Power/EntitySystems/ApcSystem.cs Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> * Update Content.Server/Construction/Completions/GivePrototype.cs Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> * Update Resources/Prototypes/Entities/Structures/Power/apc.yml Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> * Update Resources/Prototypes/Entities/Structures/Power/apc.yml Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> * Update Content.Server/Power/Components/ApcElectronicsComponent.cs Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> * Update Content.Client/Power/APC/ApcVisualizer.cs Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> Co-authored-by: CommieFlowers <rasmus.cedergren@hotmail.com> Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Content.Shared.APC;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.State;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Maths;
|
||||
@@ -22,6 +23,9 @@ namespace Content.Client.Power.APC
|
||||
|
||||
var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<ISpriteComponent>(entity);
|
||||
|
||||
sprite.LayerMapSet(Layers.Panel, sprite.AddLayerState("apc0"));
|
||||
sprite.LayerSetShader(Layers.Panel, "unshaded");
|
||||
|
||||
sprite.LayerMapSet(Layers.ChargeState, sprite.AddLayerState("apco3-0"));
|
||||
sprite.LayerSetShader(Layers.ChargeState, "unshaded");
|
||||
|
||||
@@ -45,9 +49,21 @@ namespace Content.Client.Power.APC
|
||||
|
||||
var ent = IoCManager.Resolve<IEntityManager>();
|
||||
var sprite = ent.GetComponent<ISpriteComponent>(component.Owner);
|
||||
if (component.TryGetData<ApcChargeState>(ApcVisuals.ChargeState, out var state))
|
||||
if (component.TryGetData<ApcPanelState>(ApcVisuals.PanelState, out var panelState))
|
||||
{
|
||||
switch (state)
|
||||
switch (panelState)
|
||||
{
|
||||
case ApcPanelState.Closed:
|
||||
sprite.LayerSetState(Layers.Panel, "apc0");
|
||||
break;
|
||||
case ApcPanelState.Open:
|
||||
sprite.LayerSetState(Layers.Panel, "apcframe");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (component.TryGetData<ApcChargeState>(ApcVisuals.ChargeState, out var chargeState))
|
||||
{
|
||||
switch (chargeState)
|
||||
{
|
||||
case ApcChargeState.Lack:
|
||||
sprite.LayerSetState(Layers.ChargeState, "apco3-0");
|
||||
@@ -65,7 +81,7 @@ namespace Content.Client.Power.APC
|
||||
|
||||
if (ent.TryGetComponent(component.Owner, out SharedPointLightComponent? light))
|
||||
{
|
||||
light.Color = state switch
|
||||
light.Color = chargeState switch
|
||||
{
|
||||
ApcChargeState.Lack => LackColor,
|
||||
ApcChargeState.Charging => ChargingColor,
|
||||
@@ -88,6 +104,7 @@ namespace Content.Client.Power.APC
|
||||
Equipment,
|
||||
Lighting,
|
||||
Environment,
|
||||
Panel,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user