diff --git a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs index 14162c35c0..fe6200472f 100644 --- a/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs +++ b/osu.Game/Beatmaps/Drawables/DifficultyIcon.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; using osu.Game.Graphics.Containers; +using osu.Game.Rulesets; using osuTK; using osuTK.Graphics; @@ -16,15 +17,16 @@ namespace osu.Game.Beatmaps.Drawables { public class DifficultyIcon : DifficultyColouredContainer { - private readonly BeatmapInfo beatmap; + private readonly RulesetInfo ruleset; - public DifficultyIcon(BeatmapInfo beatmap) + public DifficultyIcon(BeatmapInfo beatmap, RulesetInfo ruleset = null) : base(beatmap) { if (beatmap == null) throw new ArgumentNullException(nameof(beatmap)); - this.beatmap = beatmap; + this.ruleset = ruleset ?? beatmap.Ruleset; + Size = new Vector2(20); } @@ -58,7 +60,7 @@ namespace osu.Game.Beatmaps.Drawables Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, // the null coalesce here is only present to make unit tests work (ruleset dlls aren't copied correctly for testing at the moment) - Icon = beatmap.Ruleset?.CreateInstance().CreateIcon() ?? new SpriteIcon { Icon = FontAwesome.fa_question_circle_o } + Icon = ruleset?.CreateInstance().CreateIcon() ?? new SpriteIcon { Icon = FontAwesome.fa_question_circle_o } } }; } diff --git a/osu.Game/Screens/Multi/Components/BeatmapTypeInfo.cs b/osu.Game/Screens/Multi/Components/BeatmapTypeInfo.cs index a06eaa35dc..04ac0cc4c3 100644 --- a/osu.Game/Screens/Multi/Components/BeatmapTypeInfo.cs +++ b/osu.Game/Screens/Multi/Components/BeatmapTypeInfo.cs @@ -9,6 +9,7 @@ using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Online.Chat; using osu.Game.Online.Multiplayer; +using osu.Game.Rulesets; using osuTK; namespace osu.Game.Screens.Multi.Components @@ -16,7 +17,7 @@ namespace osu.Game.Screens.Multi.Components public class BeatmapTypeInfo : CompositeDrawable { public readonly IBindable Beatmap = new Bindable(); - + public readonly IBindable Ruleset = new Bindable(); public readonly IBindable Type = new Bindable(); public BeatmapTypeInfo() @@ -56,6 +57,7 @@ namespace osu.Game.Screens.Multi.Components }; modeTypeInfo.Beatmap.BindTo(Beatmap); + modeTypeInfo.Ruleset.BindTo(Ruleset); modeTypeInfo.Type.BindTo(Type); beatmapTitle.Beatmap.BindTo(Beatmap); diff --git a/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs b/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs index 8104244084..aad409e2c7 100644 --- a/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs +++ b/osu.Game/Screens/Multi/Components/ModeTypeInfo.cs @@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Drawables; using osu.Game.Online.Multiplayer; +using osu.Game.Rulesets; using osuTK; namespace osu.Game.Screens.Multi.Components @@ -19,6 +20,7 @@ namespace osu.Game.Screens.Multi.Components private readonly Container rulesetContainer; public readonly IBindable Beatmap = new Bindable(); + public readonly IBindable Ruleset = new Bindable(); public readonly IBindable Type = new Bindable(); public ModeTypeInfo() @@ -47,6 +49,7 @@ namespace osu.Game.Screens.Multi.Components }; Beatmap.BindValueChanged(updateBeatmap); + Ruleset.BindValueChanged(_ => updateBeatmap(Beatmap.Value)); Type.BindValueChanged(v => gameTypeContainer.Child = new DrawableGameType(v) { Size = new Vector2(height) }); } @@ -55,7 +58,7 @@ namespace osu.Game.Screens.Multi.Components if (beatmap != null) { rulesetContainer.FadeIn(transition_duration); - rulesetContainer.Child = new DifficultyIcon(beatmap) { Size = new Vector2(height) }; + rulesetContainer.Child = new DifficultyIcon(beatmap, Ruleset.Value) { Size = new Vector2(height) }; } else rulesetContainer.FadeOut(transition_duration); diff --git a/osu.Game/Screens/Multi/Lounge/Components/DrawableRoom.cs b/osu.Game/Screens/Multi/Lounge/Components/DrawableRoom.cs index fb31864cc5..219121cb53 100644 --- a/osu.Game/Screens/Multi/Lounge/Components/DrawableRoom.cs +++ b/osu.Game/Screens/Multi/Lounge/Components/DrawableRoom.cs @@ -191,8 +191,9 @@ namespace osu.Game.Screens.Multi.Lounge.Components background.Beatmap.BindTo(bindings.CurrentBeatmap); modeTypeInfo.Beatmap.BindTo(bindings.CurrentBeatmap); - beatmapTitle.Beatmap.BindTo(bindings.CurrentBeatmap); + modeTypeInfo.Ruleset.BindTo(bindings.CurrentRuleset); modeTypeInfo.Type.BindTo(bindings.Type); + beatmapTitle.Beatmap.BindTo(bindings.CurrentBeatmap); participantInfo.Host.BindTo(bindings.Host); participantInfo.Participants.BindTo(bindings.Participants); participantInfo.ParticipantCount.BindTo(bindings.ParticipantCount); diff --git a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs index 47f915b739..47f5182c39 100644 --- a/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs +++ b/osu.Game/Screens/Multi/Lounge/Components/RoomInspector.cs @@ -174,9 +174,10 @@ namespace osu.Game.Screens.Multi.Lounge.Components participantCount.ParticipantCount.BindTo(bindings.ParticipantCount); participantCount.MaxParticipants.BindTo(bindings.MaxParticipants); + beatmapTypeInfo.Beatmap.BindTo(bindings.CurrentBeatmap); + beatmapTypeInfo.Ruleset.BindTo(bindings.CurrentRuleset); beatmapTypeInfo.Type.BindTo(bindings.Type); background.Beatmap.BindTo(bindings.CurrentBeatmap); - beatmapTypeInfo.Beatmap.BindTo(bindings.CurrentBeatmap); bindings.Status.BindValueChanged(displayStatus); bindings.Participants.BindValueChanged(p => participantsFlow.ChildrenEnumerable = p.Select(u => new UserTile(u))); diff --git a/osu.Game/Screens/Multi/Match/Components/Header.cs b/osu.Game/Screens/Multi/Match/Components/Header.cs index 4f4d5a1d4e..4cb6d7a4e0 100644 --- a/osu.Game/Screens/Multi/Match/Components/Header.cs +++ b/osu.Game/Screens/Multi/Match/Components/Header.cs @@ -112,6 +112,7 @@ namespace osu.Game.Screens.Multi.Match.Components }; beatmapTypeInfo.Beatmap.BindTo(bindings.CurrentBeatmap); + beatmapTypeInfo.Ruleset.BindTo(bindings.CurrentRuleset); beatmapTypeInfo.Type.BindTo(bindings.Type); background.Beatmap.BindTo(bindings.CurrentBeatmap); bindings.CurrentMods.BindValueChanged(m => modDisplay.Current.Value = m, true);