Replace the bare-bones stock map with a full Dear ImGui in-game overlay (M key). The overlay shares the same toolbar and compass as the OS popout window: Follow, Pop Out, Gear, rotation compass. Pop Out button is now in the bottom toolbar where it is actually visible. Pressing it (or F10) closes the overlay, waits 0.5 s for the camera to release, then opens the OS popout window. Closing the popout restores the overlay if it was running when the launch was triggered. Pressing M while the popout is open closes the popout and reopens the overlay. Harmony patches intercept MapWindow.Toggle and Show so base-game "Show on map" links and the map hotkey both route through the S3 overlay. MapBypass lets internal S3 calls through without triggering the patch recursively. Camera ownership is enforced in LateUpdate so no base-game script can reset targetTexture before the camera renders. Object.Destroy replaces Release() on both RT teardown paths so the D3D address stays live until end-of-frame and cannot be recycled into a new RT mid-frame.
17 lines
834 B
C
17 lines
834 B
C
#pragma once
|
|
#include "popout_window.h"
|
|
|
|
// Custom WM_APP message for thread-safe topmost toggling (pump thread handles it).
|
|
static constexpr UINT WM_RRPOPOUT_SET_TOPMOST = WM_APP + 1;
|
|
|
|
int CreatePopoutWindow(const wchar_t* title, int width, int height);
|
|
void DestroyPopoutWindow(int handle);
|
|
PopoutWindow* GetPopoutWindow(int handle);
|
|
void GetPopoutWindowSize(int handle, int* w, int* h);
|
|
int PollPopoutInputEvents(int handle, InputEvent* outEvents, int maxEvents);
|
|
|
|
// A registered PopoutWindow with no OS window/thread — used as a shared UI-state
|
|
// holder for the in-game overlay so it can reuse all the popout's state exports
|
|
// (status text, loco/location lists, rotation, follow, etc.) and BuildMapUI.
|
|
int CreateHeadlessWindow();
|
|
int GetOrCreateOverlayStateHandle();
|