target single-building transfers by hovering, not by footprint coincidence
This commit is contained in:
@@ -79,14 +79,24 @@ struct BlueprintGhostResolved
|
||||
{
|
||||
BlueprintGhostAction action;
|
||||
std::optional<BuildingId> targetId; // set for CompatibleOverlap and Transfer
|
||||
// Where the ghost belongs on screen. The queried anchor and rotation, except at a
|
||||
// hovered transfer target, where the ghost snaps onto the target so it shows what the
|
||||
// click will act on (REQ-UI-BLUEPRINT-TRANSFER).
|
||||
QPoint ghostAnchor;
|
||||
Rotation ghostRotation;
|
||||
};
|
||||
|
||||
// Classifies one ghost of a blueprint against the current factory state
|
||||
// (REQ-UI-BLUEPRINT-OVERLAP, REQ-UI-BLUEPRINT-TRANSFER). `blueprintHoldsOneBuilding`
|
||||
// only widens the transfer rule to differently-facing targets; a same-facing target
|
||||
// transfers whatever the blueprint's size. It is the blueprint's stored size, counted
|
||||
// before locked types are dropped, so the gesture does not change behavior as the player
|
||||
// unlocks things.
|
||||
// (REQ-UI-BLUEPRINT-OVERLAP, REQ-UI-BLUEPRINT-TRANSFER).
|
||||
//
|
||||
// `hoverTile` is set only for a blueprint holding exactly one building, and is then the
|
||||
// tile under the cursor. That gesture is a copying tool rather than a layout, so it finds
|
||||
// its transfer target by hit-testing the cursor instead of by footprint coincidence --
|
||||
// without which a Shipyard could never be targeted at a different facing, its 4x2
|
||||
// footprint covering entirely different tiles once rotated. Pass nullopt for a
|
||||
// constellation, whose ghosts are judged purely by where the blueprint puts them. The
|
||||
// size is read from the blueprint as stored, before locked types are dropped, so the
|
||||
// gesture does not change behavior as the player unlocks things.
|
||||
//
|
||||
// Shared by the ghost coloring and the click path so a preview cannot disagree with what
|
||||
// the click then does -- the same reason resolveBeltDragPath is shared.
|
||||
@@ -94,7 +104,7 @@ BlueprintGhostResolved resolveBlueprintGhost(const FactoryState& state,
|
||||
const GameConfig& config,
|
||||
BuildingType type, QPoint anchor,
|
||||
Rotation rotation,
|
||||
bool blueprintHoldsOneBuilding);
|
||||
std::optional<QPoint> hoverTile);
|
||||
|
||||
// What a belt drag would do to one tile of its path (REQ-BLD-BELT-DRAG).
|
||||
enum class BeltTileAction
|
||||
|
||||
Reference in New Issue
Block a user