target single-building transfers by hovering, not by footprint coincidence
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user