v1.8.3 - a cursor that stays put
The mouse cursor no longer flickers while an overlay that frees it is open.
What was happening
The game does not blindly re-hide the cursor every frame - it decides once per frame what the cursor state should be, and writes it only when the live state disagrees. A mod setting Cursor.visible = true is therefore exactly what creates the disagreement: the game corrects it, the mod sets it again, and the two alternate at frame rate. Setting it from LateUpdate as well does not help, because the correction also re-locks the cursor and lock mode acts natively.
There is a second half to it that is easy to miss. The same correction swaps the cursor bitmap for a fully transparent one. A mod that forces only the property gets a cursor it cannot see, and never restores the image.
What changed
FreeCursorWhileShown now sets the game's own "show the cursor" flag rather than overruling it - once per change of state instead of once per frame. The game then wants the cursor visible too, so there is nothing to disagree about and it stops writing; the single write it did perform restored visibility, lock mode and bitmap together. The flag is released when no overlay wants it and when the plugin shuts down.
This was read out of the game's own code, which uses the same flag where its world needs a cursor mid-raid. It is reached by reflection, so this library still references nothing but BepInEx and Unity: a game without those types falls back to setting the properties directly, which flickers, and a flickering cursor still beats an unreachable window.
For mod authors doing this themselves: the flag is global and has no counter, so two mods using it will take the cursor from each other. If more than one of your mods needs it, register an input node whose ShouldLockCursor() returns ECursorResult.ShowCursor instead - the game's input tree takes the maximum across nodes, so those compose properly.
Also fixed
- A
Readyhandler that asks for its page immediately - the usual shape - could load that page twice, because the first navigation now waits for the channel shim and the mod's own call arrived in between.PageLoadedfired twice and the page's own scripts ran twice. - A page's buffered and retained state is dropped when a navigation actually starts, not when it is requested. The browser can accept a request that this library's own origin filter then refuses - a URL with no origin to trust, a host whose folder mapping failed - and the page on screen stays exactly where it was. Discarding its state at the moment of the request threw it away anyway. The synchronous rejection, the filter's refusal and a navigation to the page already showing now all follow from one rule.
- Retargeting means the browser had actually taken the previous page, not merely that a target had been recorded, so a page named while the browser is still starting no longer costs the state set up before it.
- If the game refuses to take the cursor back, the library stops believing it is holding it and falls back, instead of leaving the player without one.
Verification
Probe modes ready-load and generation, fault matrix rows 50-52, full matrix green across 38 modes. Both new checks were verified by watching them fail before the fix rather than only pass after it. Confirmed in game: the cursor stays still, with the game's own cursor image.
Installation
Extract Anvil-WebOverlay-v1.8.3.zip over the SPT folder. The demo plugin is optional and separate.