Convert ItemSize to prototypes (#21481)
* item sizes are prototypes * eek
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Numerics;
|
||||
using Content.Client.Items.Systems;
|
||||
using Content.Client.Message;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
@@ -23,6 +24,7 @@ namespace Content.Client.Storage.UI
|
||||
private readonly IEntityManager _entityManager;
|
||||
|
||||
private readonly SharedStorageSystem _storage;
|
||||
private readonly ItemSystem _item;
|
||||
|
||||
private readonly RichTextLabel _information;
|
||||
public readonly ContainerButton StorageContainerButton;
|
||||
@@ -34,6 +36,7 @@ namespace Content.Client.Storage.UI
|
||||
{
|
||||
_entityManager = entityManager;
|
||||
_storage = _entityManager.System<SharedStorageSystem>();
|
||||
_item = _entityManager.System<ItemSystem>();
|
||||
SetSize = new Vector2(240, 320);
|
||||
Title = Loc.GetString("comp-storage-window-title");
|
||||
RectClipContent = true;
|
||||
@@ -69,7 +72,7 @@ namespace Content.Client.Storage.UI
|
||||
_information.SetMessage(Loc.GetString("comp-storage-window-weight",
|
||||
("weight", 0),
|
||||
("maxWeight", 0),
|
||||
("size", SharedItemSystem.GetItemSizeLocale(ItemSize.Normal))));
|
||||
("size", _item.GetItemSizeLocale(SharedStorageSystem.DefaultStorageMaxItemSize))));
|
||||
|
||||
vBox.AddChild(_information);
|
||||
|
||||
@@ -117,14 +120,14 @@ namespace Content.Client.Storage.UI
|
||||
_information.SetMarkup(Loc.GetString("comp-storage-window-weight",
|
||||
("weight", _storage.GetCumulativeItemSizes(uid, uid.Comp)),
|
||||
("maxWeight", uid.Comp.MaxTotalWeight),
|
||||
("size", SharedItemSystem.GetItemSizeLocale(_storage.GetMaxItemSize((uid, uid.Comp))))));
|
||||
("size", _item.GetItemSizeLocale(_storage.GetMaxItemSize((uid, uid.Comp))))));
|
||||
}
|
||||
else
|
||||
{
|
||||
_information.SetMarkup(Loc.GetString("comp-storage-window-slots",
|
||||
("itemCount", uid.Comp.Container.ContainedEntities.Count),
|
||||
("maxCount", uid.Comp.MaxSlots),
|
||||
("size", SharedItemSystem.GetItemSizeLocale(_storage.GetMaxItemSize((uid, uid.Comp))))));
|
||||
("size", _item.GetItemSizeLocale(_storage.GetMaxItemSize((uid, uid.Comp))))));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +170,7 @@ namespace Content.Client.Storage.UI
|
||||
{
|
||||
Align = Label.AlignMode.Right,
|
||||
Text = item?.Size != null
|
||||
? $"{SharedItemSystem.GetItemSizeWeight(item.Size)}"
|
||||
? $"{_item.GetItemSizeWeight(item.Size)}"
|
||||
: Loc.GetString("comp-storage-no-item-size")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user