mirror of
https://github.com/ppy/osu.git
synced 2025-02-20 05:15:37 +08:00
Hook up BeatmapPanel "Edit" item
This commit is contained in:
parent
a154ee3a89
commit
d3109a5950
@ -31,6 +31,8 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
|
||||
public Action<BeatmapInfo> HideDifficultyRequested;
|
||||
|
||||
public Action<BeatmapInfo> EditRequested;
|
||||
|
||||
public BeatmapSetHeader Header;
|
||||
|
||||
public List<BeatmapPanel> BeatmapPanels;
|
||||
@ -87,7 +89,8 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
Alpha = 0,
|
||||
GainedSelection = panelGainedSelection,
|
||||
HideRequested = p => HideDifficultyRequested?.Invoke(p),
|
||||
StartRequested = p => { StartRequested?.Invoke(p.Beatmap); },
|
||||
StartRequested = p => StartRequested?.Invoke(p.Beatmap),
|
||||
EditRequested = p => EditRequested?.Invoke(p.Beatmap),
|
||||
RelativeSizeAxes = Axes.X,
|
||||
}).ToList();
|
||||
|
||||
|
@ -177,6 +177,8 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public Action<BeatmapSetInfo> RestoreRequested;
|
||||
|
||||
public Action<BeatmapInfo> EditRequested;
|
||||
|
||||
public Action<BeatmapInfo> HideDifficultyRequested;
|
||||
|
||||
public void SelectNext(int direction = 1, bool skipDifficulties = true)
|
||||
@ -347,6 +349,7 @@ namespace osu.Game.Screens.Select
|
||||
StartRequested = b => StartRequested?.Invoke(),
|
||||
DeleteRequested = b => DeleteRequested?.Invoke(b),
|
||||
RestoreHiddenRequested = s => RestoreRequested?.Invoke(s),
|
||||
EditRequested = b => EditRequested?.Invoke(b),
|
||||
HideDifficultyRequested = b => HideDifficultyRequested?.Invoke(b),
|
||||
State = BeatmapGroupState.Collapsed
|
||||
};
|
||||
|
@ -19,6 +19,7 @@ using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using osu.Game.Screens.Edit;
|
||||
using osu.Game.Screens.Select.Options;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
@ -108,6 +109,7 @@ namespace osu.Game.Screens.Select
|
||||
BeatmapsChanged = carouselBeatmapsLoaded,
|
||||
DeleteRequested = promptDelete,
|
||||
RestoreRequested = s => { foreach (var b in s.Beatmaps) manager.Restore(b); },
|
||||
EditRequested = editRequested,
|
||||
HideDifficultyRequested = b => manager.Hide(b),
|
||||
StartRequested = () => carouselRaisedStart(),
|
||||
});
|
||||
@ -195,6 +197,12 @@ namespace osu.Game.Screens.Select
|
||||
carousel.AllowSelection = !Beatmap.Disabled;
|
||||
}
|
||||
|
||||
private void editRequested(BeatmapInfo beatmap)
|
||||
{
|
||||
Beatmap.Value = manager.GetWorkingBeatmap(beatmap, Beatmap);
|
||||
Push(new Editor());
|
||||
}
|
||||
|
||||
private void onBeatmapRestored(BeatmapInfo b) => carousel.UpdateBeatmap(b);
|
||||
private void onBeatmapHidden(BeatmapInfo b) => carousel.UpdateBeatmap(b);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user