show the tunnel end the click would actually place

The controls panel header read the type builder mode was entered with, so
tunnel mode always said Tunnel Entry even where the ghost had resolved to an
exit. Feed the header the same effective type the ghost and placement already
use.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ne3mejABZoLWKLh8fgpM3x
This commit is contained in:
2026-08-17 13:26:50 +02:00
parent 9c275e283c
commit fd0c246bc0
3 changed files with 11 additions and 3 deletions

View File

@@ -670,7 +670,7 @@ The controls panel tells the player which controls are available right now. It i
|---|---|---|---| |---|---|---|---|
| General | no build mode active, nothing selected | `GENERAL` | — | | General | no build mode active, nothing selected | `GENERAL` | — |
| Selection | no build mode active, at least one object selected | `SELECTION` | `<n> buildings` or `<n> objects` | | Selection | no build mode active, at least one object selected | `SELECTION` | `<n> buildings` or `<n> objects` |
| Build | builder mode active (REQ-BLD-BUILDER-MODE) | `BUILD MODE` | the building type's name | | Build | builder mode active (REQ-BLD-BUILDER-MODE) | `BUILD MODE` | the name of the building type that would be placed at the hovered position, so in tunnel mode it follows the resolved end and reads `Tunnel Entry` or `Tunnel Exit` (REQ-BLD-TUNNEL-MODE) |
| Blueprint | blueprint placement mode active (REQ-UI-BLUEPRINT-MODE) | `BLUEPRINT MODE` | the blueprint's name, or `Temporary` for a temporary blueprint (REQ-UI-BLUEPRINT-TEMP) | | Blueprint | blueprint placement mode active (REQ-UI-BLUEPRINT-MODE) | `BLUEPRINT MODE` | the blueprint's name, or `Temporary` for a temporary blueprint (REQ-UI-BLUEPRINT-TEMP) |
| Deconstruct | deconstruct mode active (REQ-UI-DECONSTRUCT-BUTTON) | `DECONSTRUCT MODE` | — | | Deconstruct | deconstruct mode active (REQ-UI-DECONSTRUCT-BUTTON) | `DECONSTRUCT MODE` | — |

View File

@@ -109,7 +109,10 @@ enum class ControlContextKind
struct ControlContext struct ControlContext
{ {
BuildMode mode = BuildMode::None; BuildMode mode = BuildMode::None;
BuildingType builderType = BuildingType::Belt; // while mode == Builder // While mode == Builder: the type a click would place at the current hover position,
// not the type the mode was entered with — tunnel mode resolves to either end
// (REQ-BLD-TUNNEL-MODE).
BuildingType builderType = BuildingType::Belt;
bool draggingBelt = false; bool draggingBelt = false;
// A single-building blueprint whose ghost is over a configuration-transfer target, // A single-building blueprint whose ghost is over a configuration-transfer target,
// so clicking hands over settings rather than placing (REQ-UI-BLUEPRINT-TRANSFER). // so clicking hands over settings rather than placing (REQ-UI-BLUEPRINT-TRANSFER).

View File

@@ -1138,7 +1138,12 @@ ControlContext GameWorldView::getControlContext() const
context.mode = m_buildMode.getMode(); context.mode = m_buildMode.getMode();
context.draggingBelt = m_buildMode.isDraggingBelt(); context.draggingBelt = m_buildMode.isDraggingBelt();
context.hoveredGhostIsTransfer = m_buildMode.isHoveredGhostTransfer(); context.hoveredGhostIsTransfer = m_buildMode.isHoveredGhostTransfer();
if (m_buildMode.isBuilderMode()) { context.builderType = m_buildMode.getBuilderType(); } // The type a click would actually place, so the panel agrees with the ghost when
// tunnel mode resolves to an exit (REQ-BLD-TUNNEL-MODE).
if (m_buildMode.isBuilderMode())
{
context.builderType = m_buildMode.getEffectiveBuilderType();
}
// Buildings win over field objects, so the two are never both non-empty // Buildings win over field objects, so the two are never both non-empty
// (REQ-UI-SELECTION-CATEGORIES). // (REQ-UI-SELECTION-CATEGORIES).