mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Also only expose Expanded
state of BeatmapCard
as read-only
This commit is contained in:
@ -33,7 +33,7 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
|||||||
public const float TRANSITION_DURATION = 400;
|
public const float TRANSITION_DURATION = 400;
|
||||||
public const float CORNER_RADIUS = 10;
|
public const float CORNER_RADIUS = 10;
|
||||||
|
|
||||||
public Bindable<bool> Expanded { get; } = new BindableBool();
|
public IBindable<bool> Expanded { get; }
|
||||||
|
|
||||||
private const float width = 408;
|
private const float width = 408;
|
||||||
private const float height = 100;
|
private const float height = 100;
|
||||||
@ -64,9 +64,11 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private OverlayColourProvider colourProvider { get; set; } = null!;
|
private OverlayColourProvider colourProvider { get; set; } = null!;
|
||||||
|
|
||||||
public BeatmapCard(APIBeatmapSet beatmapSet)
|
public BeatmapCard(APIBeatmapSet beatmapSet, bool allowExpansion = true)
|
||||||
: base(HoverSampleSet.Submit)
|
: base(HoverSampleSet.Submit)
|
||||||
{
|
{
|
||||||
|
Expanded = new BindableBool { Disabled = !allowExpansion };
|
||||||
|
|
||||||
this.beatmapSet = beatmapSet;
|
this.beatmapSet = beatmapSet;
|
||||||
favouriteState = new Bindable<BeatmapSetFavouriteState>(new BeatmapSetFavouriteState(beatmapSet.HasFavourited, beatmapSet.FavouriteCount));
|
favouriteState = new Bindable<BeatmapSetFavouriteState>(new BeatmapSetFavouriteState(beatmapSet.HasFavourited, beatmapSet.FavouriteCount));
|
||||||
downloadTracker = new BeatmapDownloadTracker(beatmapSet);
|
downloadTracker = new BeatmapDownloadTracker(beatmapSet);
|
||||||
|
@ -228,10 +228,7 @@ namespace osu.Game.Screens.Play
|
|||||||
onlineBeatmapRequest.Success += beatmapSet => Schedule(() =>
|
onlineBeatmapRequest.Success += beatmapSet => Schedule(() =>
|
||||||
{
|
{
|
||||||
this.beatmapSet = beatmapSet;
|
this.beatmapSet = beatmapSet;
|
||||||
beatmapPanelContainer.Child = new BeatmapCard(this.beatmapSet)
|
beatmapPanelContainer.Child = new BeatmapCard(this.beatmapSet, allowExpansion: false);
|
||||||
{
|
|
||||||
Expanded = { Disabled = true }
|
|
||||||
};
|
|
||||||
checkForAutomaticDownload();
|
checkForAutomaticDownload();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user