Redesigned campaign buymenu to use a quantity field

Additionally sorts the bought items by name then type to attempt to mirror the tabs (Not perfect)
This commit is contained in:
Nilanth Animosus
2018-07-20 18:01:38 +01:00
parent 76f53c3544
commit cac1c48aa3
5 changed files with 167 additions and 96 deletions
@@ -1334,13 +1334,10 @@ namespace Barotrauma.Networking
{
if (sub == null) continue;
List<ItemPrefab> spawnList = new List<ItemPrefab>();
List<PurchasedItem> spawnList = new List<PurchasedItem>();
foreach (KeyValuePair<ItemPrefab, int> kvp in extraCargo)
{
for (int i = 0; i < kvp.Value; i++)
{
spawnList.Add(kvp.Key);
}
spawnList.Add(new PurchasedItem(kvp.Key, kvp.Value));
}
CargoManager.CreateItems(spawnList);