The plasma glass is placeable too
It is a draggable top-level window whenever L4PLASMA=SCREEN, which makes it the last one still being placed fresh every launch. It joins mfd_layout.cfg under "Plasma Display", the caption it already carries - the same key-is-the-title rule the display panes follow. Position only, like the panes: the glass is 128x32 at L4PLASMASCALE, so its size is a setting rather than something to drag. It registers and loads at the point it creates its window rather than leaving that to SVGA16. The glass comes from the gauge renderer and the panes from the video mode, and nothing guarantees which is built first; loading in both places means whichever runs second simply re-applies a placement the first already has. Its window procedure picks up the same WM_EXITSIZEMOVE save the panes have, so a drag writes the file straight away, and the destructor forgets the window before destroying it. Verified by round trip in the exploded view: dragged to 640,880, the file took "Plasma Display=640,880,528,167" alongside the panes and the game window, and a fresh launch in load mode put it physically back at 640,880. The three load lines in the log - one window, then two, then eight - are the ordering doing its job. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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 <title>=<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
|
||||
|
||||
Reference in New Issue
Block a user