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
+10
View File
@@ -80,6 +80,16 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch (uMsg)
{
case WM_KEYDOWN:
// Backtick (`) toggles the SECONDARY cockpit displays (the MFD/radar
// panel that frames the 3D viewscreen) on/off, for an unobstructed
// view. Edge-triggered via lParam bit 30 (the previous key state) so
// auto-repeat while the key is held does not flicker the panel.
if (wParam == VK_OEM_3 && (lParam & (1 << 30)) == 0)
{
extern int gBTHideSecondaryDisplays;
gBTHideSecondaryDisplays = !gBTHideSecondaryDisplays;
}
return 0;
case WM_KEYUP:
// Drive keys are NOT read here: the engine's keyboard reader
// (L4CTRL.cpp:1506) GetMessage()s every WM_KEYUP / WM_CHAR out of the