From 352a758f5ce14f4c6cdf9198b6e6a79948538939 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 10 Dec 2018 13:18:03 +0900 Subject: [PATCH] Replace 3 occurrences of SpriteText.Current --- osu.Game/Screens/Multi/Components/DrawableRoom.cs | 10 ++++------ osu.Game/Screens/Multi/Components/RoomInspector.cs | 9 +++++---- osu.Game/Screens/Multi/Screens/Match/Info.cs | 13 ++++--------- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/Multi/Components/DrawableRoom.cs b/osu.Game/Screens/Multi/Components/DrawableRoom.cs index 43a9b6ad06..9425457670 100644 --- a/osu.Game/Screens/Multi/Components/DrawableRoom.cs +++ b/osu.Game/Screens/Multi/Components/DrawableRoom.cs @@ -108,6 +108,7 @@ namespace osu.Game.Screens.Multi.Components ParticipantInfo participantInfo; BeatmapTitle beatmapTitle; ModeTypeInfo modeTypeInfo; + OsuSpriteText name; Children = new Drawable[] { @@ -166,11 +167,7 @@ namespace osu.Game.Screens.Multi.Components Spacing = new Vector2(5f), Children = new Drawable[] { - new OsuSpriteText - { - TextSize = 18, - Current = nameBind - }, + name = new OsuSpriteText { TextSize = 18 }, participantInfo = new ParticipantInfo(), }, }, @@ -217,7 +214,8 @@ namespace osu.Game.Screens.Multi.Components background.Beatmap.BindTo(beatmap); - beatmapBind.ValueChanged += b => beatmap.Value = beatmaps.GetWorkingBeatmap(b); + beatmapBind.BindValueChanged(b => beatmap.Value = beatmaps.GetWorkingBeatmap(b)); + nameBind.BindValueChanged(n => name.Text = n); nameBind.BindTo(Room.Name); hostBind.BindTo(Room.Host); diff --git a/osu.Game/Screens/Multi/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Components/RoomInspector.cs index d282264ed6..48d1c1b93c 100644 --- a/osu.Game/Screens/Multi/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Components/RoomInspector.cs @@ -131,7 +131,6 @@ namespace osu.Game.Screens.Multi.Components Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, TextSize = 30, - Current = nameBind }, }, }, @@ -204,9 +203,11 @@ namespace osu.Game.Screens.Multi.Components }, }; - statusBind.ValueChanged += displayStatus; - beatmapBind.ValueChanged += b => beatmap.Value = beatmaps.GetWorkingBeatmap(b); - participantsBind.ValueChanged += p => participantsFlow.ChildrenEnumerable = p.Select(u => new UserTile(u)); + statusBind.BindValueChanged(displayStatus); + beatmapBind.BindValueChanged(b => beatmap.Value = beatmaps.GetWorkingBeatmap(b)); + participantsBind.BindValueChanged(p => participantsFlow.ChildrenEnumerable = p.Select(u => new UserTile(u))); + + nameBind.BindValueChanged(n => name.Text = n); background.Beatmap.BindTo(beatmap); diff --git a/osu.Game/Screens/Multi/Screens/Match/Info.cs b/osu.Game/Screens/Multi/Screens/Match/Info.cs index 9600a878a6..d479765159 100644 --- a/osu.Game/Screens/Multi/Screens/Match/Info.cs +++ b/osu.Game/Screens/Multi/Screens/Match/Info.cs @@ -42,6 +42,7 @@ namespace osu.Game.Screens.Multi.Screens.Match Height = HEIGHT; BeatmapTypeInfo beatmapTypeInfo; + OsuSpriteText name; Children = new Drawable[] { @@ -69,15 +70,8 @@ namespace osu.Game.Screens.Multi.Screens.Match Direction = FillDirection.Vertical, Children = new Drawable[] { - new OsuSpriteText - { - TextSize = 30, - Current = Name - }, - availabilityStatus = new OsuSpriteText - { - TextSize = 14, - }, + name = new OsuSpriteText { TextSize = 30 }, + availabilityStatus = new OsuSpriteText { TextSize = 14 }, }, }, beatmapTypeInfo = new BeatmapTypeInfo @@ -104,6 +98,7 @@ namespace osu.Game.Screens.Multi.Screens.Match Availability.BindValueChanged(_ => updateAvailabilityStatus()); Status.BindValueChanged(_ => updateAvailabilityStatus()); + Name.BindValueChanged(n => name.Text = n); } [BackgroundDependencyLoader]