target single-building transfers by hovering, not by footprint coincidence

This commit is contained in:
2026-08-06 20:31:51 +02:00
parent 98deab932a
commit 3b37b0ecf8
6 changed files with 171 additions and 68 deletions

View File

@@ -632,12 +632,16 @@ void GameWorldView::placeBlueprintAtTile(QPoint center)
BlueprintGhostResolved GameWorldView::resolveBlueprintGhostHere(const BlueprintBuilding& building,
QPoint center) const
{
// The one-building test reads the blueprint as stored, before locked types are
// dropped, so the gesture behaves the same however much the player has unlocked
// (REQ-UI-BLUEPRINT-TRANSFER).
// A single-building blueprint hit-tests the cursor for its transfer target; a
// constellation does not (REQ-UI-BLUEPRINT-TRANSFER). `center` is the cursor tile.
// The size is read from the blueprint as stored, before locked types are dropped, so
// the gesture behaves the same however much the player has unlocked.
const std::optional<QPoint> hoverTile =
m_buildMode.getBlueprint().buildings.size() == 1 ? std::make_optional(center)
: std::nullopt;
return resolveBlueprintGhost(m_sim->getFactoryState(), m_sim->getConfig(),
building.type, center + building.offset, building.rotation,
m_buildMode.getBlueprint().buildings.size() == 1);
hoverTile);
}
std::string GameWorldView::unlockedRecipeId(const BlueprintBuilding& building) const