mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:03:13 +08:00
Update editor workflow and make edit button works.
This commit is contained in:
parent
f068f7c4bd
commit
b2dd9afcf3
@ -1,34 +1,38 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using osu.Game.Screens.Select;
|
||||
|
||||
namespace osu.Game.Screens.Edit
|
||||
{
|
||||
internal class Editor : ScreenWhiteBox
|
||||
{
|
||||
private WorkingBeatmap beatmap;
|
||||
public Editor(WorkingBeatmap workingBeatmap)
|
||||
{
|
||||
beatmap = workingBeatmap;
|
||||
}
|
||||
protected override IEnumerable<Type> PossibleChildren => new Type[] { typeof(EditSongSelect) };
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenCustom(@"Backgrounds/bg4");
|
||||
|
||||
protected override void OnResuming(Screen last)
|
||||
{
|
||||
Beatmap?.Track?.Stop();
|
||||
base.OnResuming(last);
|
||||
}
|
||||
|
||||
protected override void OnEntering(Screen last)
|
||||
{
|
||||
base.OnEntering(last);
|
||||
Background.Schedule(() => Background.FadeColour(Color4.DarkGray, 500));
|
||||
beatmap.Track?.Stop();
|
||||
Beatmap?.Track?.Stop();
|
||||
}
|
||||
|
||||
protected override bool OnExiting(Screen next)
|
||||
{
|
||||
Background.Schedule(() => Background.FadeColour(Color4.White, 500));
|
||||
beatmap.Track?.Start();
|
||||
Beatmap?.Track?.Start();
|
||||
return base.OnExiting(next);
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using osu.Game.Screens.Charts;
|
||||
using osu.Game.Screens.Direct;
|
||||
using osu.Game.Screens.Edit;
|
||||
using osu.Game.Screens.Multiplayer;
|
||||
using OpenTK;
|
||||
using osu.Game.Screens.Select;
|
||||
@ -44,7 +45,7 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
OnChart = delegate { Push(new ChartListing()); },
|
||||
OnDirect = delegate { Push(new OnlineListing()); },
|
||||
OnEdit = delegate { Push(new EditSongSelect()); },
|
||||
OnEdit = delegate { Push(new Editor()); },
|
||||
OnSolo = delegate { Push(new PlaySongSelect()); },
|
||||
OnMulti = delegate { Push(new Lobby()); },
|
||||
OnTest = delegate { Push(new TestBrowser()); },
|
||||
|
@ -2,13 +2,12 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Screens.Edit;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
{
|
||||
internal class EditSongSelect : SongSelect
|
||||
{
|
||||
public EditSongSelect() : base(false) { }
|
||||
protected override void OnSelected(WorkingBeatmap beatmap) => Push(new Editor(beatmap));
|
||||
protected override void OnSelected(WorkingBeatmap beatmap) => Exit();
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ using osu.Framework.Screens;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Overlays.Mods;
|
||||
using osu.Game.Screens.Edit;
|
||||
using osu.Game.Screens.Play;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
@ -36,7 +37,11 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
BeatmapOptions.AddButton(@"Remove", @"from unplayed", FontAwesome.fa_times_circle_o, colours.Purple, null, Key.Number1);
|
||||
BeatmapOptions.AddButton(@"Clear", @"local scores", FontAwesome.fa_eraser, colours.Purple, null, Key.Number2);
|
||||
BeatmapOptions.AddButton(@"Edit", @"Beatmap", FontAwesome.fa_pencil, colours.Yellow, null, Key.Number3);
|
||||
BeatmapOptions.AddButton(@"Edit", @"Beatmap", FontAwesome.fa_pencil, colours.Yellow, () =>
|
||||
{
|
||||
ValidForResume = false;
|
||||
Push(new Editor());
|
||||
}, Key.Number3);
|
||||
}
|
||||
|
||||
protected override void OnBeatmapChanged(WorkingBeatmap beatmap)
|
||||
|
Loading…
Reference in New Issue
Block a user