Allow to draw produced-item icons in recipe dialog and game world

This commit is contained in:
2026-07-23 20:54:04 +02:00
parent 8b71fe1a03
commit f766ae4a86
12 changed files with 258 additions and 29 deletions

View File

@@ -421,6 +421,14 @@ RecipesConfig ConfigLoader::loadRecipes(const std::string& path)
const toml::array& outputs = requireArray(mt["outputs"], file, elemPath + ".outputs");
def.outputs = parseRecipeOutputs(outputs, file, elemPath + ".outputs");
// Optional icon item id (REQ-UI-RECIPE-ICON); defaults to the first output
// in the UI when unset. Not validated against known items here — a missing
// icon is not an error (REQ-UI-ITEM-ICON).
if (mt.contains("icon"))
{
def.icon = requireString(mt["icon"], file, elemPath + ".icon");
}
cfg.recipes.push_back(std::move(def));
}