Solution visualizer fixes (#3883)
This commit is contained in:
@@ -3,6 +3,7 @@ using System;
|
|||||||
using Content.Shared.GameObjects.Components.Chemistry;
|
using Content.Shared.GameObjects.Components.Chemistry;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.GameObjects;
|
using Robust.Client.GameObjects;
|
||||||
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Serialization.Manager.Attributes;
|
using Robust.Shared.Serialization.Manager.Attributes;
|
||||||
|
|
||||||
namespace Content.Client.GameObjects.Components.Chemistry
|
namespace Content.Client.GameObjects.Components.Chemistry
|
||||||
@@ -12,9 +13,10 @@ namespace Content.Client.GameObjects.Components.Chemistry
|
|||||||
{
|
{
|
||||||
[DataField("maxFillLevels")] private int _maxFillLevels = 0;
|
[DataField("maxFillLevels")] private int _maxFillLevels = 0;
|
||||||
[DataField("fillBaseName")] private string? _fillBaseName = null;
|
[DataField("fillBaseName")] private string? _fillBaseName = null;
|
||||||
[DataField("emptySpriteName")] private string? _emptySpriteName = null;
|
|
||||||
[DataField("layer")] private SolutionContainerLayers _layer = SolutionContainerLayers.Fill;
|
[DataField("layer")] private SolutionContainerLayers _layer = SolutionContainerLayers.Fill;
|
||||||
[DataField("changeColor")] private bool _changeColor = true;
|
[DataField("changeColor")] private bool _changeColor = true;
|
||||||
|
[DataField("emptySpriteName")] private string? _emptySpriteName = null;
|
||||||
|
[DataField("emptySpriteColor")] private Color _emptySpriteColor = Color.White;
|
||||||
|
|
||||||
public override void OnChangeData(AppearanceComponent component)
|
public override void OnChangeData(AppearanceComponent component)
|
||||||
{
|
{
|
||||||
@@ -46,7 +48,11 @@ namespace Content.Client.GameObjects.Components.Chemistry
|
|||||||
if (_emptySpriteName == null)
|
if (_emptySpriteName == null)
|
||||||
sprite.LayerSetVisible(fillLayer, false);
|
sprite.LayerSetVisible(fillLayer, false);
|
||||||
else
|
else
|
||||||
|
{
|
||||||
sprite.LayerSetState(fillLayer, _emptySpriteName);
|
sprite.LayerSetState(fillLayer, _emptySpriteName);
|
||||||
|
if (_changeColor)
|
||||||
|
sprite.LayerSetColor(fillLayer, _emptySpriteColor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,12 @@ namespace Content.Shared.GameObjects.Components.Chemistry
|
|||||||
public bool CanRefill => Capabilities.HasCap(SolutionContainerCaps.Refillable);
|
public bool CanRefill => Capabilities.HasCap(SolutionContainerCaps.Refillable);
|
||||||
public bool CanDrain => Capabilities.HasCap(SolutionContainerCaps.Drainable);
|
public bool CanDrain => Capabilities.HasCap(SolutionContainerCaps.Drainable);
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
UpdateAppearance();
|
||||||
|
}
|
||||||
|
|
||||||
public void RemoveAllSolution()
|
public void RemoveAllSolution()
|
||||||
{
|
{
|
||||||
if (CurrentVolume == 0)
|
if (CurrentVolume == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user