Files
RP412/.gitignore
T
CydandClaude Opus 5 40b00ddde1 The game window remembers where you put it too
RP412MFDLAYOUT already kept the exploded view's display panes where they
were dragged. The main window is the one people move most, and it was
still being placed fresh every launch, so it joins them.

MFDSplitView_LoadLayout/SaveLayout become RPWindowLayout_Load/Save, with
Register/Forget taking any HWND rather than the module reaching into a
pane registry. Same file, same format, one more line in it.

What comes back depends on the window, so Register takes it as a flag:

  display panes    position only, as before. A pane's size follows its
                   content and its button banks, so an old size from a
                   different build must not distort it.
  the game window  position and size in the cockpit view. Nothing
                   derives that size - the cockpit fits itself to
                   whatever client area it is given - so a window sized
                   to suit a monitor should come back that way, and
                   half-restoring it would be the strange behaviour. In
                   the exploded view its size IS the render resolution
                   -res asked for, so there only the position returns.

Registered after the CockpitShellProc subclass is installed, on purpose:
the restore's WM_SIZE then runs LayoutCockpit again and the canvas
re-fits the restored client area. -fit does not register at all - it
owns the whole monitor, so there is no placement of the player's to
keep.

CockpitShellProc gained the WM_EXITSIZEMOVE hook the panes already had,
so dragging or resizing the shell writes the file immediately rather
than waiting for teardown.

Two hazards the panes were small enough to get away with and the game
window is not:

  - Save reads rcNormalPosition rather than GetWindowRect. A minimised
    window reports a nonsense rect and a maximised one reports the
    screen; since the file is rewritten whole, either would have
    replaced a good line with a useless one. rcNormalPosition is the
    restored placement whatever state the window is in.
  - Load drops any placement that intersects none of the monitors
    currently plugged in. Restoring the game window onto a display that
    is no longer there would leave nothing to drag back.

Verified by round trip in both views. Cockpit: dragged and resized to
240,120 1000x620, the file took it, a fresh launch in load mode came up
exactly there with a 984x581 client - and a screenshot confirms the
canvas re-fit it, displays at the corners and the map centred at the
bottom, nothing spilling. Exploded: the shell came back at 60,60 still
1280x720 from -res while Map came back at 777,333, which is the
size-flag split doing its job.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 09:00:33 -05:00

78 lines
1.3 KiB
Plaintext

# Visual Studio build artifacts
[Dd]ebug/
[Rr]elease/
[Dd]ebug*/
[Rr]elease*/
x64/
x86/
[Bb]in/
[Oo]bj/
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.suo
*.user
*.cachefile
*.sln.cache
*.vspscc
*.vssscc
*.pch
*.ilk
*.tlog
*.lastbuildstate
*.idb
*.pdb
*.obj
*.o
*.exe
*.dll
*.exp
*.map
# Visual Studio per-user / IDE state
.vs/
*.VC.db
*.VC.opendb
# Runtime / generated output
*.log
rpl4.log
# Where the game window and the exploded view's panes were last dragged
# to (RP412MFDLAYOUT). Per-machine by nature - it is screen coordinates
# on somebody's desk.
mfd_layout.cfg
# Build-output static libs that land in lib/ (the two committed dependency
# libs, OpenAL32.lib and libsndfile-1.lib, stay tracked).
/lib/Munga_L4.lib
/lib/DivLoader.lib
# Stale Subversion metadata
.svn/
# OS cruft
Thumbs.db
desktop.ini
.DS_Store
# Packaged runnable game (pack-dist.ps1 output)
/dist/
# Local cockpit-launcher experiments — deliberately untracked
assets/RP411/startrp-800x600.bat
assets/RP411/startrp-800x600.ps1
# Bundled game working copy: committed wholesale as runtime data (see
# docs/ASSETS.md). Re-include the binaries the global rules above would skip.
!assets/**/*.exe
!assets/**/*.dll
# ...but never the spool runtime output or Windows thumbnail caches.
assets/**/*.spl
assets/**/last.spl
# packaged releases (attached to Gitea releases, not tracked)
RedPlanet-*.zip