Repository navigation
Debounce the PLEASE WAIT overlay like the original - #17
Merged
Merged
Conversation
The original draws the waitmessage.img overlay only once its wait counter (DAT_0056d118: 0 when a request fires, +1 per GameTick, -1 idle) passes 40 ticks — the signed cmp eax,0x28 gate at 0x41363f — so a fast server reply never flashes the spinner. Our port showed the overlay for the entire request, flashing it on every LAN-fast connect. ServerSelectViewModel now tracks how long the current loading/connect has been in flight, re-arms on each transition into a busy state, and exposes showsWaitOverlay only after the ~0.67 s (40 ticks at 60 Hz) debounce; the screen draws on that instead of the raw busy state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The original client draws the
waitmessage.imgPLEASE WAIT overlay only once its wait counter passes 40 game ticks (~0.67 s at the 60 Hz tick): the counter (DAT_0056d118) is set to 0 when a request fires, incremented eachGameTick, reset to -1 by the reply handler, and the draw gate is the signedcmp eax, 0x28at 0x41363f. The debounce exists so a fast server reply never flashes the spinner. (Surfaced by the latest static-analysis work, which fixed a signed/unsigned bug in that very gate.)Our port drew the overlay for the entire request, so every LAN-fast connect briefly flashed it.
ServerSelectViewModelnow tracks how long the current loading/connect has been in flight (re-armed on each transition into a busy state, mirroring the counter reset on request-fire) and exposesshowsWaitOverlayonly past the 40-tick debounce;ServerSelectScreendraws on that instead of the raw busy state.Tests
waitOverlayIsDebounced: hidden inside the debounce window, shown past it, cleared immediately when the reply arrives, and re-armed from zero by the next request (connect after a row selection).Test plan
swift test— 567 tests passing