fix selection panel contents
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "Building.h"
|
||||
#include "BuildingTarget.h"
|
||||
#include "GameConfig.h"
|
||||
#include "ProductionRules.h"
|
||||
|
||||
AutoProductionContent::AutoProductionContent(const SelectionContext& context,
|
||||
const SelectionRequest& request,
|
||||
@@ -19,6 +20,27 @@ BufferedBuildingContent::CycleInfo AutoProductionContent::getCycleInfo(
|
||||
// REQ-BLD-REPROCESSING), so its production section is always shown -- but only a
|
||||
// running cycle names a recipe, so while it is idle there is no cycle to describe.
|
||||
info.runsProduction = true;
|
||||
|
||||
if (target.building)
|
||||
{
|
||||
// What the building handles at all, so its buffers are not blank whenever it
|
||||
// happens to be between cycles (REQ-UI-SINGLE-SELECTION). This is the same union
|
||||
// of every recipe of its type that the simulation sized the buffers over, and
|
||||
// the locked ones among them are dropped when the card lists them.
|
||||
for (const RecipeDef* recipe :
|
||||
gatherCandidateRecipes(*getContext().config, *target.building))
|
||||
{
|
||||
for (const RecipeIngredient& ingredient : recipe->inputs)
|
||||
{
|
||||
info.handledInputs.push_back(ingredient.item);
|
||||
}
|
||||
for (const RecipeOutput& output : recipe->outputs)
|
||||
{
|
||||
info.handledOutputs.push_back(output.item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!target.building || !target.building->production.has_value())
|
||||
{
|
||||
return info;
|
||||
|
||||
Reference in New Issue
Block a user