keep an auto-recipe building's summary between its cycles
This commit is contained in:
@@ -41,13 +41,22 @@ BufferedBuildingContent::CycleInfo AutoProductionContent::getCycleInfo(
|
||||
}
|
||||
}
|
||||
|
||||
if (!target.building || !target.building->production.has_value())
|
||||
// Which recipe describes the cycle: the one running, or -- between cycles -- the one
|
||||
// that ran last. Dropping it while idle would take the summary row and the chips'
|
||||
// per-cycle amounts away and bring them back with every cycle, resizing the card in
|
||||
// step with the building's status (REQ-UI-RECIPE-SUMMARY). Only a building that has
|
||||
// never run has nothing to describe.
|
||||
if (target.building && target.building->production.has_value())
|
||||
{
|
||||
m_lastRecipeId = target.building->production->recipeId;
|
||||
}
|
||||
if (!target.building || m_lastRecipeId.empty())
|
||||
{
|
||||
return info;
|
||||
}
|
||||
|
||||
const RecipeDef* recipe = getContext().config->recipes.findRecipeDef(
|
||||
target.building->production->recipeId, target.type);
|
||||
const RecipeDef* recipe =
|
||||
getContext().config->recipes.findRecipeDef(m_lastRecipeId, target.type);
|
||||
if (!recipe)
|
||||
{
|
||||
return info;
|
||||
|
||||
Reference in New Issue
Block a user