Fix visualizer issues (#3440)

This commit is contained in:
Ygg01
2021-02-28 12:02:08 +01:00
committed by GitHub
parent 2326cb5f3c
commit df76ceee6c
3 changed files with 4 additions and 4 deletions

View File

@@ -152,8 +152,8 @@ namespace Content.Client.GameObjects.Components
private void ProcessCompositeSprites(AppearanceComponent component, ISpriteComponent spriteComponent)
{
// If hidden, don't render any sprites
if (!component.TryGetData<bool>(StackVisuals.Hide, out var hide)
|| hide)
if (component.TryGetData<bool>(StackVisuals.Hide, out var hide)
&& hide)
{
foreach (var transparentSprite in _spriteLayers)
{

View File

@@ -63,6 +63,7 @@ namespace Content.Client.GameObjects.Components.Storage
spriteComponent.LayerSetVisible(OpenIcon, false);
break;
}
component.SetData(StackVisuals.Hide, bagState == SharedBagState.Close);
}
}
}

View File

@@ -39,7 +39,7 @@ namespace Content.Client.GameObjects.Components.Storage
base.Initialize();
// Hide stackVisualizer on start
_bagState = SharedBagState.Close;
ChangeStorageVisualization(SharedBagState.Close);
}
public override void OnAdd()
@@ -149,7 +149,6 @@ namespace Content.Client.GameObjects.Components.Storage
if (Owner.TryGetComponent<AppearanceComponent>(out var appearanceComponent))
{
appearanceComponent.SetData(SharedBagOpenVisuals.BagState, state);
appearanceComponent.SetData(StackVisuals.Hide, state == SharedBagState.Close);
}
}