Remove double Enabled bindable from ReadyButton#37117
Open
LiquidPL wants to merge 1 commit intoppy:masterfrom
Open
Remove double Enabled bindable from ReadyButton#37117LiquidPL wants to merge 1 commit intoppy:masterfrom
Enabled bindable from ReadyButton#37117LiquidPL wants to merge 1 commit intoppy:masterfrom
Conversation
This commit attempts to refactor the online play ready buttons by removing the duplicated `Enabled` bindable that was causing confusion as to which one was responsible for actually disabling the button. This is accomplished by moving all the bindable updating logic to a virtual `UpdateEnabledState` method, which can be overriden by subclasses of `ReadyButton` to provide extra checks. Because of that, (and just generally because I think it's a bad idea that can cause some ugly race conditions), the state is no longer updated by outside components like in `MatchStateControl`. This is generally a thing that popped up during my work on the online play/footer cleanups, and I'm pushing it out earlier to get some feedback (I'm still not sure about the whole update flow - maybe it'd just be simpler if this weren't doing subclassing at all), and because it would distract from the actual footer changes once I'm ready to PR those.
LiquidPL
commented
Mar 26, 2026
Comment on lines
+51
to
+52
| Scheduler.AddDelayed(UpdateEnabledState, 1000, true); | ||
| UpdateEnabledState(); |
Contributor
Author
There was a problem hiding this comment.
Changed this to update the state every second instead of frame while cleaning this up. Might be leaning too much towards premature optimization but I dunno.
LiquidPL
commented
Mar 26, 2026
| } | ||
|
|
||
| readyButton.Enabled.Value = countdownButton.Enabled.Value = | ||
| countdownButton.Enabled.Value = |
Contributor
Author
There was a problem hiding this comment.
If we were to go with this, then I suppose that MultiplayerCountdownButton should have its own Enabled updating logic moved inside its class as well.
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.
This commit attempts to refactor the online play ready buttons by removing the duplicated
Enabledbindable that was causing confusion as to which one was responsible for actually disabling the button.This is accomplished by moving all the bindable updating logic to a virtual
UpdateEnabledStatemethod, which can be overriden by subclasses ofReadyButtonto provide extra checks. Because of that, (and just generally because I think it's a bad idea that can cause some ugly race conditions), the state is no longer updated by outside components like inMatchStateControl.This is generally a thing that popped up during my work on the online play/footer cleanups, and I'm pushing it out earlier to get some feedback (I'm still not sure about the whole update flow - maybe it'd just be simpler if this wasn't doing any subclassing at all), and because it would distract from the actual footer changes once I'm ready to PR those.