mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:43:01 +08:00
use runOnceImmediately instead of duplicating logic
This commit is contained in:
parent
591277e0f9
commit
f7dde53f9b
@ -88,9 +88,7 @@ namespace osu.Game.Overlays.Comments
|
||||
{
|
||||
Height = 40,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
PlaceholderText = GetTextBoxPlaceholder(API.IsLoggedIn),
|
||||
Current = Current,
|
||||
ReadOnly = !API.IsLoggedIn
|
||||
Current = Current
|
||||
},
|
||||
new Container
|
||||
{
|
||||
@ -126,7 +124,6 @@ namespace osu.Game.Overlays.Comments
|
||||
Spacing = new Vector2(5, 0),
|
||||
Child = commitButton = new EditorButton
|
||||
{
|
||||
Text = GetCommitButtonText(API.IsLoggedIn),
|
||||
Action = () => commitOrLogIn(Current.Value)
|
||||
}
|
||||
},
|
||||
@ -152,7 +149,7 @@ namespace osu.Game.Overlays.Comments
|
||||
{
|
||||
base.LoadComplete();
|
||||
Current.BindValueChanged(_ => updateCommitButtonState(), true);
|
||||
User.BindValueChanged(_ => updateStateForLoggedIn());
|
||||
User.BindValueChanged(_ => updateStateForLoggedIn(), true);
|
||||
}
|
||||
|
||||
protected abstract void OnCommit(string text);
|
||||
|
Loading…
Reference in New Issue
Block a user