mirror of
https://github.com/osukey/osukey.git
synced 2025-05-20 04:57:38 +09:00
Remove redundant boolean
This commit is contained in:
parent
52558c5cf6
commit
34b2553b95
@ -260,9 +260,6 @@ namespace osu.Game.Beatmaps
|
|||||||
if (beatmapInfo?.BeatmapSet == null || beatmapInfo == DefaultBeatmap?.BeatmapInfo)
|
if (beatmapInfo?.BeatmapSet == null || beatmapInfo == DefaultBeatmap?.BeatmapInfo)
|
||||||
return DefaultBeatmap;
|
return DefaultBeatmap;
|
||||||
|
|
||||||
var info = beatmapInfo;
|
|
||||||
beatmapInfo = QueryBeatmap(p => info.OnlineBeatmapID == p.OnlineBeatmapID) ?? beatmapInfo;
|
|
||||||
|
|
||||||
if (beatmapInfo.Metadata == null)
|
if (beatmapInfo.Metadata == null)
|
||||||
beatmapInfo.Metadata = beatmapInfo.BeatmapSet.Metadata;
|
beatmapInfo.Metadata = beatmapInfo.BeatmapSet.Metadata;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
namespace osu.Game.Beatmaps.Drawables
|
namespace osu.Game.Beatmaps.Drawables
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Display a beatmap background from an online source
|
/// Display a baetmap background from a local source, but fallback to online source if not available.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class UpdateableBeatmapBackgroundSprite : ModelBackedDrawable<BeatmapInfo>
|
public class UpdateableBeatmapBackgroundSprite : ModelBackedDrawable<BeatmapInfo>
|
||||||
{
|
{
|
||||||
@ -20,13 +20,10 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
|
|
||||||
private readonly BeatmapSetCoverType beatmapSetCoverType;
|
private readonly BeatmapSetCoverType beatmapSetCoverType;
|
||||||
|
|
||||||
private readonly bool fallback;
|
public UpdateableBeatmapBackgroundSprite(BeatmapSetCoverType beatmapSetCoverType = BeatmapSetCoverType.Cover)
|
||||||
|
|
||||||
public UpdateableBeatmapBackgroundSprite(bool fallback = false, BeatmapSetCoverType beatmapSetCoverType = BeatmapSetCoverType.Cover)
|
|
||||||
{
|
{
|
||||||
Beatmap.BindValueChanged(b => Model = b.NewValue);
|
Beatmap.BindValueChanged(b => Model = b.NewValue);
|
||||||
this.beatmapSetCoverType = beatmapSetCoverType;
|
this.beatmapSetCoverType = beatmapSetCoverType;
|
||||||
this.fallback = fallback;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Drawable CreateDrawable(BeatmapInfo model)
|
protected override Drawable CreateDrawable(BeatmapInfo model)
|
||||||
@ -39,7 +36,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
|
|
||||||
if (model?.BeatmapSet?.OnlineInfo != null)
|
if (model?.BeatmapSet?.OnlineInfo != null)
|
||||||
drawable = new BeatmapSetCover(model.BeatmapSet, beatmapSetCoverType);
|
drawable = new BeatmapSetCover(model.BeatmapSet, beatmapSetCoverType);
|
||||||
else if (fallback && localBeatmap.BeatmapInfo.ID != 0)
|
else if (localBeatmap.BeatmapInfo.ID != 0)
|
||||||
{
|
{
|
||||||
// Fall back to local background if one exists
|
// Fall back to local background if one exists
|
||||||
drawable = new BeatmapBackgroundSprite(localBeatmap);
|
drawable = new BeatmapBackgroundSprite(localBeatmap);
|
||||||
|
@ -9,6 +9,13 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
{
|
{
|
||||||
public class MultiplayerBackgroundSprite : MultiplayerComposite
|
public class MultiplayerBackgroundSprite : MultiplayerComposite
|
||||||
{
|
{
|
||||||
|
private readonly BeatmapSetCoverType beatmapSetCoverType;
|
||||||
|
|
||||||
|
public MultiplayerBackgroundSprite(BeatmapSetCoverType beatmapSetCoverType = BeatmapSetCoverType.Cover)
|
||||||
|
{
|
||||||
|
this.beatmapSetCoverType = beatmapSetCoverType;
|
||||||
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
@ -19,6 +26,6 @@ namespace osu.Game.Screens.Multi.Components
|
|||||||
CurrentItem.BindValueChanged(item => sprite.Beatmap.Value = item.NewValue?.Beatmap, true);
|
CurrentItem.BindValueChanged(item => sprite.Beatmap.Value = item.NewValue?.Beatmap, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual UpdateableBeatmapBackgroundSprite CreateBackgroundSprite() => new UpdateableBeatmapBackgroundSprite { RelativeSizeAxes = Axes.Both };
|
protected virtual UpdateableBeatmapBackgroundSprite CreateBackgroundSprite() => new UpdateableBeatmapBackgroundSprite(beatmapSetCoverType) { RelativeSizeAxes = Axes.Both };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
Width = cover_width,
|
Width = cover_width,
|
||||||
Masking = true,
|
Masking = true,
|
||||||
Margin = new MarginPadding { Left = side_strip_width },
|
Margin = new MarginPadding { Left = side_strip_width },
|
||||||
Child = new MultiplayerListSprite { RelativeSizeAxes = Axes.Both }
|
Child = new MultiplayerBackgroundSprite(BeatmapSetCoverType.List) { RelativeSizeAxes = Axes.Both }
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
@ -203,11 +203,6 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
this.FadeInFromZero(transition_duration);
|
this.FadeInFromZero(transition_duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MultiplayerListSprite : MultiplayerBackgroundSprite
|
|
||||||
{
|
|
||||||
protected override UpdateableBeatmapBackgroundSprite CreateBackgroundSprite() => new UpdateableBeatmapBackgroundSprite(beatmapSetCoverType: BeatmapSetCoverType.List) { RelativeSizeAxes = Axes.Both };
|
|
||||||
}
|
|
||||||
|
|
||||||
private class RoomName : OsuSpriteText
|
private class RoomName : OsuSpriteText
|
||||||
{
|
{
|
||||||
[Resolved(typeof(Room), nameof(Online.Multiplayer.Room.Name))]
|
[Resolved(typeof(Room), nameof(Online.Multiplayer.Room.Name))]
|
||||||
|
@ -132,15 +132,10 @@ namespace osu.Game.Screens.Multi.Match.Components
|
|||||||
|
|
||||||
private class HeaderBackgroundSprite : MultiplayerBackgroundSprite
|
private class HeaderBackgroundSprite : MultiplayerBackgroundSprite
|
||||||
{
|
{
|
||||||
protected override UpdateableBeatmapBackgroundSprite CreateBackgroundSprite() => new BackgroundSprite(true) { RelativeSizeAxes = Axes.Both };
|
protected override UpdateableBeatmapBackgroundSprite CreateBackgroundSprite() => new BackgroundSprite { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
private class BackgroundSprite : UpdateableBeatmapBackgroundSprite
|
private class BackgroundSprite : UpdateableBeatmapBackgroundSprite
|
||||||
{
|
{
|
||||||
public BackgroundSprite(bool fallback = false, BeatmapSetCoverType beatmapSetCoverType = BeatmapSetCoverType.Cover)
|
|
||||||
: base(fallback, beatmapSetCoverType)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override double FadeDuration => 200;
|
protected override double FadeDuration => 200;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user