Fix bootstrap config window race after map entry#934
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses a UI race in the client bootstrap flow where the Server Bootstrap Configuration window could reappear immediately after entering the generated map, potentially overlapping the scenario/game-start dialog. The changes make re-showing the bootstrap window more deliberate by adding a short post-map delay and gating the re-show on the absence of blocking dialogs, while also preventing the bootstrap-map-init wait from being re-armed during the post-init waiting phase.
Changes:
- Add a short post-map-enter window delay before re-showing the bootstrap configurator window.
- Prevent re-showing the bootstrap window directly from
OnBootstrapMapInitialized, and instead re-show only when no blocking dialogs (MessageBox/NodeTree) are present. - Avoid re-arming the bootstrap map-init wait while already in the post-init waiting phase, and reset the new delay state with other transient UI state.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Source/Client/Windows/BootstrapConfiguratorWindow.cs | Resets newly added post-map window delay as part of transient UI state reset. |
| Source/Client/Windows/BootstrapConfiguratorWindow.BootstrapFlow.cs | Introduces post-map window delay, refines window re-show conditions to avoid dialog overlap, and prevents re-arming map-init wait during post-init delay. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (postMapEnterWindowDelayRemaining > 0f || postMapEnterSaveDelayRemaining > 0f || awaitingControllablePawns) | ||
| { | ||
| postMapEnterWindowDelayRemaining -= Time.deltaTime; | ||
| if (postMapEnterWindowDelayRemaining <= 0f) | ||
| TryShowBootstrapWindow(); | ||
| } |
|
Not a fan of delays to control when things should appear, it'll vary on different computers. The real question is why is it appearing before it has completed setting the map, one thing should trigger the other. Not opposed to merging this but we should consider looking for a different solution than arbitrary timers. |
|
Not yet found a harmony hook for the OK in the landing message, since this should appear after that.. |
|
because at this point i dont even need to look for controllable pawn if i have a hook to the OK of the scenario message.. its just a "safety" workaround |
Problem
During server bootstrap, after entering the generated map the Server Bootstrap Configuration window could reappear too early. In practice it could show before, or on top of, the scenario/game-start dialog instead of waiting until that dialog had been acknowledged.
Cause
The bootstrap flow could re-show the config window immediately after map initialization, while the scenario dialog was still being opened or was still active. At the same time, the bootstrap-map-init arm path could still run during the post-init waiting phase.
Fix
Testing
dotnet build .\Source\Client\Multiplayer.csproj -c Release