Fix minsizes for all windows that needed it (#3648)

* fix minsizes

* fix scanner height, minsize->setsize for some
This commit is contained in:
mirrorcult
2021-03-15 01:38:08 -07:00
committed by GitHub
parent fe43402ef2
commit e4169ecf0d
15 changed files with 30 additions and 16 deletions

View File

@@ -23,7 +23,7 @@ namespace Content.Client.VendingMachines
public VendingMachineMenu(VendingMachineBoundUserInterface owner)
{
SetSize = MinSize = (300, 450);
SetSize = (300, 450);
IoCManager.InjectDependencies(this);
Owner = owner;
@@ -42,17 +42,25 @@ namespace Content.Client.VendingMachines
{
_items.Clear();
_cachedInventory = inventory;
var longestEntry = "";
foreach (VendingMachineInventoryEntry entry in inventory)
{
var itemName = _prototypeManager.Index<EntityPrototype>(entry.ID).Name;
if (itemName.Length > longestEntry.Length)
{
longestEntry = itemName;
}
Texture? icon = null;
if(_prototypeManager.TryIndex(entry.ID, out EntityPrototype? prototype))
{
icon = SpriteComponent.GetPrototypeIcon(prototype, _resourceCache).Default;
}
_items.AddItem($"{itemName} ({entry.Amount} left)", icon);
}
SetSize = ((longestEntry.Length + 8) * 12, _items.Count * 40 + 50);
}
public void ItemSelected(ItemList.ItemListSelectedEventArgs args)