alandtse / alandtse/imgui-vr-helper
Add an exclusive 'live tool' client mode for unpaused interactive overlays
- 主要语言
- C++
- 星标
- 0
- 派生
- 2
- 平均合并
- 1 天 18 小时
- 30 天内合并 PR
- 11
描述
## Summary
Add an explicit **"live tool" client mode** for interactive overlays that run while the
game is **unpaused** and that **own the screen exclusively** for the duration of a
mod-driven session — distinct from the existing pause-time settings-overlay model.
## Motivation
The helper today is built around **pause-time settings overlays** (à la Community Shaders):
the controller shell is pause-gated (`onlyOpenWhilePaused`, `HelperImpl.cpp` `OverlayOpenAllowed`),
you summon it while paused, tweak a client's panel via the picker, and close.
A **live VR tool** is a different interaction paradigm. PhotoMode (SKSE photo mode ported to
VR) is the driving example: the user flies a free camera through a *running, unpaused* world
while interacting with a panel (sliders, tabs). For that client:
- "Hold the interactive overlay for the whole session" is **correct** (not sticky/bad).
- The pause-gated picker shouldn't apply mid-session — you're *in* the tool; you exit it,
*then* switch clients.
- The world must be **unpaused** so the tool (camera, etc.) actually works.
Trying to drive a live tool through the pause-settings model causes friction: focus that's
either too sticky (picker can't switch) or too transient (closing the menu drops the tool),
and the game staying paused.
## What already works (no change needed)
- `RequestFocus` is **not** pause-gated (`HelperImpl.cpp` ~L749) — a client can take the
interactive overlay programmatically while running.
- Once a client is focused, the overlay **stays open even unpaused**
(`OverlayOpenAllowed`: `currentFocus != 0 → true`, ~L91-97).
- `InSceneOverlay` composites the focused client's panel every frame, independent of the
helper's own settings UI (~L760-767).
So a live unpaused interactive overlay is already *possible*. What's missing is an explicit
**role** so the helper and the client agree on the semantics, instead of each mod hand-rolling
it (and risking the picker fighting the session).
## Proposed design
A new client flag, e.g. `kClientFlag_LiveTool` (name TBD), in `ImGuiVRHelperTypes.h`, with
these semantics when a client connects with it and currently holds focus:
1. **Mod-managed lifecycle** — the client enters via `RequestFocus()` and exits via
`ReleaseFocus()`; the helper does not auto-grant/revoke based on its own pause-gated shell.
2. **Runs unpaused** — no pause gate; the overlay composites and receives input while the
game runs (already true for `RequestFocus`, make it contractual for this flag).
3. **Exclusive** — while a live-tool client holds focus, the helper **suppresses its own
picker/shell open** (the controller toggle is a no-op, or shows a "release first"
toast), so navigation can't steal focus mid-session. Releasing focus restores normal
shell/picker behavior.
4. **Clean handback** — `ReleaseFocus()` from the tool returns full control to the shell.
### Impl touchpoints
- `ImGuiVRHelperTypes.h`: add the flag.
- `HelperImpl`: store the active client's flags; in the overlay-open/toggle path
(~L901-935) and `OverlayOpenAllowed`, special-case a focused live-tool client
(suppress shell open / picker switch).
- Optionally surface it in the SDK (`ImGuiVRHelperClientSDK.h`) docs and `Connect()` examples.
## Current workaround in PhotoMode (for reference)
Until this exists, PhotoMode implements it client-side ("Option A"):
- On activate (VR): `RequestFocus()` once, close any open `PausesGame()` menus (so the world
runs), spawn its content.
- On exit: `ReleaseFocus()`, plus an on-panel "Exit Photo Mode" button (VR has no Escape).
- Per frame: only `PumpInput()` — it does **not** re-request focus, so the picker can still
take focus to switch away (which the client treats as "exit").
This works, but every live-tool mod re-implementing it (and racing the picker) is exactly
what an explicit mode would standardize.
## Acceptance criteria
- [ ] A client can declare itself a live tool and run an interactive, unpaused overlay.
- [ ] While a live-tool client holds focus, the helper's picker/shell can't switch away
until the client releases focus.
- [ ] Releasing focus cleanly restores normal shell behavior.
- [ ] Existing pause-time settings clients (HUD / RendersOnFocus) are unaffected.
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。