Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trash bag visuals #32386

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

8 changes: 8 additions & 0 deletions Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
using Robust.Shared.Random;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
using Content.Shared.Rounding;
using Content.Shared.Storage;

namespace Content.Shared.Storage.EntitySystems;

Expand Down Expand Up @@ -759,6 +761,12 @@ public void UpdateAppearance(Entity<StorageComponent?, AppearanceComponent?> ent
_appearance.SetData(uid, StorageVisuals.Open, isOpen, appearance);
_appearance.SetData(uid, SharedBagOpenVisuals.BagState, isOpen ? SharedBagState.Open : SharedBagState.Closed, appearance);

if (TryComp<StorageFillVisualizerComponent>(uid, out var storageFillVisualizerComp))
{
var level = ContentHelpers.RoundToLevels(used, capacity, storageFillVisualizerComp.MaxFillLevels);
_appearance.SetData(uid, StorageFillVisuals.FillLevel, level, appearance);
}

// HideClosedStackVisuals true sets the StackVisuals.Hide to the open state of the storage.
// This is for containers that only show their contents when open. (e.g. donut boxes)
if (storage.HideStackVisualsWhenClosed)
Expand Down
Loading