Implement T hotkey for temporary blueprint from selection

Add a TemporaryBlueprintRequestedEvent emitted by GameWorldView on the T
key. BlueprintPanel handles it by building a blueprint from the current
selection (reusing createBlueprintFromSelection) and entering placement
mode via BlueprintPlacementRequestedEvent, without adding it to the list
or persisting it. Right-click exits and discards the temporary blueprint
through the existing exit path. No-op when nothing placeable is selected.

Implements REQ-UI-BLUEPRINT-TEMP.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VGNNLeFWhVzvxkK9qVXP2K
This commit is contained in:
2026-07-09 14:47:53 +02:00
parent d4b9023d8f
commit 319d42d9c2
5 changed files with 36 additions and 1 deletions

View File

@@ -339,3 +339,17 @@ void BlueprintPanel::handleEvent(std::shared_ptr<const BlueprintModeExitedEvent>
{
clearActiveBlueprintButton();
}
void BlueprintPanel::handleEvent(std::shared_ptr<const TemporaryBlueprintRequestedEvent> /*event*/)
{
// Temporary blueprint (REQ-UI-BLUEPRINT-TEMP): build from the current selection and
// enter placement mode without adding it to the list or persisting it. If nothing
// player-placeable is selected, do nothing.
Blueprint bp = createBlueprintFromSelection();
if (bp.buildings.empty()) { return; }
// No saved blueprint is active while a temporary one is being placed.
clearActiveBlueprintButton();
EventManager::getInstance()->sendEventImmediately(
std::make_shared<BlueprintPlacementRequestedEvent>(std::move(bp)));
}