mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 02:22:56 +08:00
Make download buttons disappear instead of closing overlay.
- Also unbind event handlers - Remove unused field
This commit is contained in:
parent
df53b884ea
commit
97c5956083
@ -51,6 +51,7 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
title.Text = BeatmapSet.Metadata.Title;
|
title.Text = BeatmapSet.Metadata.Title;
|
||||||
artist.Text = BeatmapSet.Metadata.Artist;
|
artist.Text = BeatmapSet.Metadata.Artist;
|
||||||
|
|
||||||
|
downloadButtonsContainer.FadeIn();
|
||||||
noVideoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 0 : 1, transition_duration);
|
noVideoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 0 : 1, transition_duration);
|
||||||
videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration);
|
videoButtons.FadeTo(BeatmapSet.OnlineInfo.HasVideo ? 1 : 0, transition_duration);
|
||||||
|
|
||||||
@ -224,6 +225,20 @@ namespace osu.Game.Overlays.BeatmapSet
|
|||||||
{
|
{
|
||||||
tabsBg.Colour = colours.Gray3;
|
tabsBg.Colour = colours.Gray3;
|
||||||
this.beatmaps = beatmaps;
|
this.beatmaps = beatmaps;
|
||||||
|
|
||||||
|
beatmaps.BeatmapSetAdded += handleBeatmapAdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
beatmaps.BeatmapSetAdded -= handleBeatmapAdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void handleBeatmapAdd(BeatmapSetInfo beatmap)
|
||||||
|
{
|
||||||
|
if (beatmap.OnlineBeatmapSetID == BeatmapSet.OnlineBeatmapSetID)
|
||||||
|
downloadButtonsContainer.FadeOut(transition_duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void download(bool noVideo)
|
private void download(bool noVideo)
|
||||||
|
@ -24,8 +24,6 @@ namespace osu.Game.Overlays
|
|||||||
public const float X_PADDING = 40;
|
public const float X_PADDING = 40;
|
||||||
public const float RIGHT_WIDTH = 275;
|
public const float RIGHT_WIDTH = 275;
|
||||||
|
|
||||||
private BeatmapSetInfo currentBeatmap;
|
|
||||||
|
|
||||||
private readonly Header header;
|
private readonly Header header;
|
||||||
private readonly Info info;
|
private readonly Info info;
|
||||||
|
|
||||||
@ -87,16 +85,10 @@ namespace osu.Game.Overlays
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(APIAccess api, RulesetStore rulesets, BeatmapManager manager)
|
private void load(APIAccess api, RulesetStore rulesets)
|
||||||
{
|
{
|
||||||
this.api = api;
|
this.api = api;
|
||||||
this.rulesets = rulesets;
|
this.rulesets = rulesets;
|
||||||
|
|
||||||
manager.BeatmapSetAdded += beatmap =>
|
|
||||||
{
|
|
||||||
if (beatmap.OnlineBeatmapSetID == currentBeatmap.OnlineBeatmapSetID)
|
|
||||||
Hide();
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void PopIn()
|
protected override void PopIn()
|
||||||
@ -128,7 +120,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
public void ShowBeatmapSet(BeatmapSetInfo set)
|
public void ShowBeatmapSet(BeatmapSetInfo set)
|
||||||
{
|
{
|
||||||
currentBeatmap = header.BeatmapSet = info.BeatmapSet = set;
|
header.BeatmapSet = info.BeatmapSet = set;
|
||||||
Show();
|
Show();
|
||||||
scroll.ScrollTo(0);
|
scroll.ScrollTo(0);
|
||||||
}
|
}
|
||||||
|
@ -107,6 +107,12 @@ namespace osu.Game.Overlays.Direct
|
|||||||
beatmaps.BeatmapDownloadBegan += attachDownload;
|
beatmaps.BeatmapDownloadBegan += attachDownload;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
beatmaps.BeatmapDownloadBegan -= attachDownload;
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
Loading…
Reference in New Issue
Block a user