allow to set the recipe already for construction sites

This commit is contained in:
2026-06-22 21:32:24 +02:00
parent e5017ab3c5
commit d271d65678
10 changed files with 233 additions and 89 deletions

View File

@@ -88,12 +88,12 @@ QString shipTooltip(const ShipDef& def)
} // namespace
std::vector<RecipeSelectionOption> buildRecipeSelectionOptions(
const Building& building, Simulation& sim, const GameConfig& config)
BuildingType type, Simulation& sim, const GameConfig& config)
{
std::vector<RecipeSelectionOption> options;
options.push_back({std::string(), QObject::tr("(None)"), QString()});
if (building.type == BuildingType::Shipyard)
if (type == BuildingType::Shipyard)
{
for (const ShipDef& def : config.ships.ships)
{
@@ -107,9 +107,9 @@ std::vector<RecipeSelectionOption> buildRecipeSelectionOptions(
{
for (const RecipeDef& recipe : config.recipes.recipes)
{
if (recipe.building != building.type) { continue; }
if ((building.type == BuildingType::Miner
|| building.type == BuildingType::Assembler)
if (recipe.building != type) { continue; }
if ((type == BuildingType::Miner
|| type == BuildingType::Assembler)
&& !sim.isRecipeUnlocked(recipe.id))
{
continue;