Added sink (#14348)
This commit is contained in:
@@ -36,6 +36,13 @@ namespace Content.Client.Chemistry.Visualizers
|
||||
[DataField("metamorphicNameFull")]
|
||||
public string MetamorphicNameFull = "transformable-container-component-glass";
|
||||
|
||||
/// <summary>
|
||||
/// Which solution of the SolutionContainerManagerComponent to represent.
|
||||
/// If not set, will work as default.
|
||||
/// </summary>
|
||||
[DataField("solutionName")]
|
||||
public string SolutionName = "";
|
||||
|
||||
public string InitialName = string.Empty;
|
||||
public string InitialDescription = string.Empty;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,16 @@ public sealed class SolutionContainerVisualsSystem : VisualizerSystem<SolutionCo
|
||||
|
||||
protected override void OnAppearanceChange(EntityUid uid, SolutionContainerVisualsComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
// Check if the solution that was updated is the one set as represented
|
||||
if (!string.IsNullOrEmpty(component.SolutionName))
|
||||
{
|
||||
if (AppearanceSystem.TryGetData<string>(uid, SolutionContainerVisuals.SolutionName, out var name,
|
||||
args.Component) && name != component.SolutionName)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!AppearanceSystem.TryGetData<float>(uid, SolutionContainerVisuals.FillFraction, out var fraction, args.Component))
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user