From a4aab7dbd153a7221adbcfcd2b23cc4140b5919a Mon Sep 17 00:00:00 2001 From: DamianX Date: Fri, 20 Sep 2019 20:39:54 +0200 Subject: [PATCH] Vending machines now show entity name rather than prototype ID (#355) --- Content.Client/VendingMachines/VendingMachineMenu.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Content.Client/VendingMachines/VendingMachineMenu.cs b/Content.Client/VendingMachines/VendingMachineMenu.cs index 8d2ff1b257..fa8cb8ac18 100644 --- a/Content.Client/VendingMachines/VendingMachineMenu.cs +++ b/Content.Client/VendingMachines/VendingMachineMenu.cs @@ -48,12 +48,14 @@ namespace Content.Client.VendingMachines _cachedInventory = inventory; foreach (VendingMachineInventoryEntry entry in inventory) { + var itemName = _prototypeManager.Index(entry.ID).Name; + Texture icon = null; if(_prototypeManager.TryIndex(entry.ID, out EntityPrototype prototype)) { icon = IconComponent.GetPrototypeIcon(prototype, _resourceCache).TextureFor(Direction.South); } - _items.AddItem($"{entry.ID} ({entry.Amount} left)", icon); + _items.AddItem($"{itemName} ({entry.Amount} left)", icon); } }