give the selection cards their own parts instead of label blobs

This commit is contained in:
2026-08-07 18:43:23 +02:00
parent 2289277e12
commit 075e44d295
54 changed files with 1505 additions and 533 deletions

View File

@@ -3,7 +3,6 @@
#include "Building.h"
#include "BuildingTarget.h"
#include "GameConfig.h"
#include "SelectionNames.h"
AutoProductionContent::AutoProductionContent(const SelectionContext& context,
const SelectionRequest& request,
@@ -12,31 +11,21 @@ AutoProductionContent::AutoProductionContent(const SelectionContext& context,
{
}
void AutoProductionContent::refreshConfiguration()
{
const BuildingTarget target = resolveBuildingTarget(getContext(), getBuildingId());
if (!target.isValid())
{
return;
}
setBuildingIdentity(target.type, getBuildingTypeName(target.type));
}
BufferedBuildingContent::CycleInfo AutoProductionContent::getCycleInfo(
const Building& building) const
const BuildingTarget& target) const
{
CycleInfo info;
// An auto-recipe building always runs an implicit recipe (REQ-BLD-SMELTER,
// 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 time.
// running cycle names a recipe, so while it is idle there is no cycle to describe.
info.runsProduction = true;
if (!building.production.has_value())
if (!target.building || !target.building->production.has_value())
{
return info;
}
const RecipeDef* recipe = getContext().config->recipes.findRecipeDef(
building.production->recipeId, building.type);
target.building->production->recipeId, target.type);
if (!recipe)
{
return info;