Cockpit: backtick (\`) toggles the secondary displays

Add a hide/show toggle for the single-window cockpit's secondary displays --
the five MFDs + radar panel (and their button banks) that frame the 3D
viewscreen -- so the player can get an unobstructed full-window view.

- L4VB16.cpp: gBTHideSecondaryDisplays gates BTDrawCockpitPanel (early return
  skips the whole instrument composite; the primary 3D view already fills the
  window, so nothing else changes).
- btl4main.cpp WndProc: '`' (VK_OEM_3) flips it, edge-triggered on lParam bit 30
  so auto-repeat while held doesn't flicker. Handled in WM_KEYDOWN, which the
  engine keyboard reader does not steal (it consumes WM_KEYUP/WM_CHAR).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-17 10:08:03 -05:00
co-authored by Claude Opus 4.8
parent 2e475f4575
commit 2b238a835c
2 changed files with 18 additions and 0 deletions
+8
View File
@@ -650,10 +650,18 @@ int BTCockpitButtonAt(int px, int py, int clientW, int clientH)
return -1;
}
// Backtick (`) toggle: hide the SECONDARY cockpit displays -- the MFD/radar
// panel (and its button banks) that frame the 3D viewscreen -- for an
// unobstructed view. Flipped from the main WndProc (btl4main.cpp) on the '`'
// key; read here so the composite simply skips itself when hidden. The primary
// 3D viewscreen already fills the window, so hiding the panel needs nothing else.
int gBTHideSecondaryDisplays = 0;
//
void BTDrawCockpitPanel(LPDIRECT3DDEVICE9 device)
{
if (!DevCockpitPanel() || device == NULL) return;
if (gBTHideSecondaryDisplays) return; // '`' hid the instrument panel
IDirect3DSurface9 *rt = NULL;
if (FAILED(device->GetRenderTarget(0, &rt)) || rt == NULL) return;
D3DSURFACE_DESC d;