diff --git a/MUNGA_L4/L4MFDVIEW.h b/MUNGA_L4/L4MFDVIEW.h index d85fd1f..cfd2f75 100644 --- a/MUNGA_L4/L4MFDVIEW.h +++ b/MUNGA_L4/L4MFDVIEW.h @@ -194,7 +194,8 @@ protected: // // display panes position only. A pane's size follows its content and // its button banks, so an old size from a different -// build must not distort it. +// build must not distort it. The plasma glass registers +// the same way - its size is L4PLASMASCALE's business. // the game window position and size. Nothing derives that size - -res // only decides how sharp the scene is, and the cockpit // fits itself to whatever client area it is given - so diff --git a/MUNGA_L4/L4PLASMASCREEN.cpp b/MUNGA_L4/L4PLASMASCREEN.cpp index 4b13807..247c1ca 100644 --- a/MUNGA_L4/L4PLASMASCREEN.cpp +++ b/MUNGA_L4/L4PLASMASCREEN.cpp @@ -3,6 +3,7 @@ #include "l4plasmascreen.h" #include "l4app.h" +#include "l4mfdview.h" // RPWindowLayout_* namespace { @@ -45,6 +46,15 @@ namespace } break; + case WM_EXITSIZEMOVE: + // + // Dragged to a new spot. Write the whole arrangement now rather + // than trusting teardown, so a hard kill still leaves what was + // on screen. No-op unless RP412MFDLAYOUT is save. + // + RPWindowLayout_Save(); + return 0; + case WM_CLOSE: // The glass is part of the cockpit; just hide it. ShowWindow(hwnd, SW_HIDE); @@ -176,6 +186,7 @@ PlasmaScreen::~PlasmaScreen() } if (window != NULL) { + RPWindowLayout_Forget(window); RemovePropA((HWND) window, "PlasmaBitmapInfo"); RemovePropA((HWND) window, "PlasmaPixels"); DestroyWindow((HWND) window); @@ -275,6 +286,22 @@ void SetPropA((HWND) window, "PlasmaPixels", pixelBuffer->Data.MapPointer); ShowWindow((HWND) window, SW_SHOWNOACTIVATE); activeInstance = this; + + // + //----------------------------------------------------------- + // Join the saved layout. Position only, like the display + // panes: the glass is 128x32 at L4PLASMASCALE, so its size + // is a setting rather than something to drag. + // + // Loading here rather than leaving it to SVGA16 keeps this + // independent of which is built first - the glass comes from + // the gauge renderer, the panes from the video mode, and + // whichever runs second re-applies a placement the first + // already has. + //----------------------------------------------------------- + // + RPWindowLayout_Register(window, "Plasma Display", False); + RPWindowLayout_Load(); } else { diff --git a/pack-dist.ps1 b/pack-dist.ps1 index de9a1aa..aa4edc4 100644 --- a/pack-dist.ps1 +++ b/pack-dist.ps1 @@ -179,6 +179,8 @@ L4MFDSPLIT=1 # old one is never restored over them. Arrange everything once with # save, then leave it on load. # +# The plasma display window takes part too, under "Plasma Display". +# # Each line in mfd_layout.cfg reads =<x>,<y>,<w>,<h>, and you can # append ,noframe to take that window's title bar and border off - a # cockpit that fills the monitor edge to edge without -fit taking the