Closed elfl0rd closed 4 years ago
Requires more work that could cause performance issues. Or maybe @mirasrael has a good idea
for me - fine solution if this tooltip use same technology as ingredient icon in recipe. Heavy calculation is not needed.
(But maybe text not "available" maybe something like "resources in available storages" is better)
Yes, tooltip only is enough.
@gzatravkin can you make this use whatever the ingredient tooltip does to calculate available resources (refactor to use the same code path too)
Make it say something like (x available in storage) after the other numbers, if there are stored ones around
Nothing:
Can collect total items and tag using this code
var availableItems = this.DefaultInventory.NonEmptyStacks.ToDict();
var availableTags = new Dictionary<Tag, int>();
foreach (var entry in availableItems)
{
foreach (var tag in Item.Get(entry.Key).Tags())
{
availableTags.AddOrUpdate(tag, entry.Value, (oldVal, newVal) => oldVal + newVal);
}
}
Use something like this to describe ingredients
if (missingIngredient != null)
"[X:red] [Item] missing (Y total remaining)";
else
"Y [Item] total remaining ([Z:yellow if Z < Y:green otherwise] available in storage)";
Now I can't see how much I need.
what about "available resources"?