From 2a9edcbb4f0754563d484f3e8acd2f0d9ea38c37 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 2 Oct 2017 08:10:16 +0900 Subject: [PATCH 01/26] Add test case for the editor --- osu.Game/Tests/Visual/TestCaseEditor.cs | 47 +++++++++++++++++++++++++ osu.Game/osu.Game.csproj | 1 + 2 files changed, 48 insertions(+) create mode 100644 osu.Game/Tests/Visual/TestCaseEditor.cs diff --git a/osu.Game/Tests/Visual/TestCaseEditor.cs b/osu.Game/Tests/Visual/TestCaseEditor.cs new file mode 100644 index 0000000000..6114d1eb2e --- /dev/null +++ b/osu.Game/Tests/Visual/TestCaseEditor.cs @@ -0,0 +1,47 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using osu.Framework.Allocation; +using osu.Framework.MathUtils; +using osu.Game.Beatmaps; +using osu.Game.Screens.Edit; + +namespace osu.Game.Tests.Visual +{ + public class TestCaseEditor : OsuTestCase + { + public override IReadOnlyList RequiredTypes => new[] { typeof(Editor) }; + + private readonly Random rng; + + private BeatmapManager beatmaps; + private OsuGameBase osuGame; + + public TestCaseEditor() + { + rng = new Random(1337); + + Add(new Editor()); + AddStep("Next beatmap", nextBeatmap); + } + + [BackgroundDependencyLoader] + private void load(OsuGameBase osuGame, BeatmapManager beatmaps) + { + this.osuGame = osuGame; + this.beatmaps = beatmaps; + } + + private void nextBeatmap() + { + var sets = beatmaps.GetAllUsableBeatmapSets(); + if (sets.Count == 0) + return; + + BeatmapInfo info = sets[rng.Next(0, sets.Count)].Beatmaps[0]; + osuGame.Beatmap.Value = beatmaps.GetWorkingBeatmap(info); + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index c8e42a3ad3..9dfc2401ae 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -742,6 +742,7 @@ + From 8ed23a60e97601226c80a00f7a5fa36e1cdaa683 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 2 Oct 2017 09:10:40 +0900 Subject: [PATCH 02/26] Remove items from the editor menu bar --- osu.Game/Screens/Edit/Editor.cs | 146 +------------------------------- 1 file changed, 1 insertion(+), 145 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index d85026bb27..6395e6c3b1 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -36,151 +36,7 @@ namespace osu.Game.Screens.Edit { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - RelativeSizeAxes = Axes.Both, - Items = new[] - { - new EditorMenuBarItem("File") - { - Items = new[] - { - new EditorMenuItem("Clear all notes"), - new EditorMenuItem("Open difficulty..."), - new EditorMenuItem("Save"), - new EditorMenuItem("Create new difficulty..."), - new EditorMenuItemSpacer(), - new EditorMenuItem("Revert to saved"), - new EditorMenuItem("Revert to saved (full"), - new EditorMenuItemSpacer(), - new EditorMenuItem("Test beatmap"), - new EditorMenuItem("Open AiMod"), - new EditorMenuItemSpacer(), - new EditorMenuItem("Upload Beatmap..."), - new EditorMenuItem("Export package"), - new EditorMenuItem("Export map package"), - new EditorMenuItem("Import from..."), - new EditorMenuItemSpacer(), - new EditorMenuItem("Open song folder"), - new EditorMenuItem("Open .osu in Notepad"), - new EditorMenuItem("Open .osb in Notepad"), - new EditorMenuItemSpacer(), - new EditorMenuItem("Exit", MenuItemType.Standard, Exit) - } - }, - new EditorMenuBarItem("Edit") - { - Items = new[] - { - new EditorMenuItem("Undo"), - new EditorMenuItem("Redo"), - new EditorMenuItemSpacer(), - new EditorMenuItem("Cut"), - new EditorMenuItem("Copy"), - new EditorMenuItem("Paste"), - new EditorMenuItem("Delete"), - new EditorMenuItemSpacer(), - new EditorMenuItem("Select all"), - new EditorMenuItem("Clone"), - new EditorMenuItemSpacer(), - new EditorMenuItem("Reverse selection"), - new EditorMenuItem("Flip horizontally"), - new EditorMenuItem("Flip vertically"), - new EditorMenuItem("Rotate 90deg clockwise"), - new EditorMenuItem("Rotate 90deg anticlockwise"), - new EditorMenuItem("Rotate by..."), - new EditorMenuItem("Scale by..."), - new EditorMenuItemSpacer(), - new EditorMenuItem("Reset selected objects' samples"), - new EditorMenuItem("Reset all samples", MenuItemType.Destructive), - new EditorMenuItem("Reset combo colours", MenuItemType.Destructive), - new EditorMenuItem("Reset breaks", MenuItemType.Destructive), - new EditorMenuItemSpacer(), - new EditorMenuItem("Nudge backward"), - new EditorMenuItem("Nudge forward") - } - }, - new EditorMenuBarItem("View") - { - Items = new[] - { - new EditorMenuItem("Compose"), - new EditorMenuItem("Design"), - new EditorMenuItem("Timing"), - new EditorMenuItemSpacer(), - new EditorMenuItem("Song setup..."), - new EditorMenuItem("Timing setup..."), - new EditorMenuItemSpacer(), - new EditorMenuItem("Volume"), - new EditorMenuItem("Grid level"), - new EditorMenuItem("Show video"), - new EditorMenuItem("Show sample name"), - new EditorMenuItem("Snaking sliders"), - new EditorMenuItem("Hit animations"), - new EditorMenuItem("Follow points"), - new EditorMenuItem("Stacking") - } - }, - new EditorMenuBarItem("Compose") - { - Items = new[] - { - new EditorMenuItem("Snap divisor"), - new EditorMenuItem("Audio rate"), - new EditorMenuItem("Grid snapping"), - new EditorMenuItemSpacer(), - new EditorMenuItem("Create polygon cricles..."), - new EditorMenuItem("Convert slider to stream"), - new EditorMenuItem("Enable live mapping mode"), - new EditorMenuItem("Sample import") - } - }, - new EditorMenuBarItem("Design") - { - Items = new[] - { - new EditorMenuItem("Move all elements in time...") - } - }, - new EditorMenuBarItem("Timing") - { - Items = new[] - { - new EditorMenuItem("Time signature"), - new EditorMenuItem("Metronome clicks"), - new EditorMenuItemSpacer(), - new EditorMenuItem("Add timing section"), - new EditorMenuItem("Add inheriting section"), - new EditorMenuItem("Reset current section"), - new EditorMenuItem("Delete timing section"), - new EditorMenuItem("Resnap current section"), - new EditorMenuItemSpacer(), - new EditorMenuItem("Timing setup..."), - new EditorMenuItemSpacer(), - new EditorMenuItem("Resnap all notes", MenuItemType.Destructive), - new EditorMenuItem("Move all notes in time...", MenuItemType.Destructive), - new EditorMenuItem("Recalculate slider lengths", MenuItemType.Destructive), - new EditorMenuItem("Delete all timing sections", MenuItemType.Destructive), - new EditorMenuItemSpacer(), - new EditorMenuItem("Set current position as preview point") - } - }, - new EditorMenuBarItem("Web") - { - Items = new[] - { - new EditorMenuItem("This Beatmap's information page"), - new EditorMenuItem("This Beatmap's thread"), - new EditorMenuItem("Quick reply") - } - }, - new EditorMenuBarItem("Help") - { - Items = new[] - { - new EditorMenuItem("Show in-game help"), - new EditorMenuItem("View FAQ") - } - } - } + RelativeSizeAxes = Axes.Both } } }); From 7b1ef53f36fc60877bfacbe729ef72e71942a316 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 2 Oct 2017 09:24:25 +0900 Subject: [PATCH 03/26] Expose a mode change event from EditorMenuBar --- osu.Game/Screens/Edit/Menus/EditorMenuBar.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs index 616cabbab2..4c9b3c84b3 100644 --- a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs +++ b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs @@ -11,11 +11,19 @@ using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using OpenTK; using OpenTK.Graphics; +using System; namespace osu.Game.Screens.Edit.Menus { public class EditorMenuBar : OsuMenu { + /// + /// Invaoked when the selected mode has changed. + /// + public event Action ModeChanged; + + private readonly ScreenSelectionTabControl tabControl; + public EditorMenuBar() : base(Direction.Horizontal, true) { @@ -26,13 +34,21 @@ namespace osu.Game.Screens.Edit.Menus AddRangeInternal(new Drawable[] { - new ScreenSelectionTabControl + tabControl = new ScreenSelectionTabControl { Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, X = -15 } }); + + tabControl.Current.ValueChanged += v => ModeChanged?.Invoke(v); + } + + protected override void LoadComplete() + { + base.LoadComplete(); + tabControl.Current.TriggerChange(); } protected override Framework.Graphics.UserInterface.Menu CreateSubMenu() => new SubMenu(); From 221902f4fefe2c94e0d546b0ecab4065bc198f33 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 2 Oct 2017 09:26:16 +0900 Subject: [PATCH 04/26] Restructure Editor construction --- osu.Game/Screens/Edit/Editor.cs | 68 +++++++++++++++++---------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 6395e6c3b1..8b6c0f0bf5 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -26,57 +26,61 @@ namespace osu.Game.Screens.Edit public Editor() { - Add(new Container + EditorMenuBar menuBar; + SummaryTimeline timeline; + + Children = new[] { - RelativeSizeAxes = Axes.X, - Height = 40, - Children = new Drawable[] + new Container { - new EditorMenuBar + Name = "Top bar", + RelativeSizeAxes = Axes.X, + Height = 40, + Child = menuBar = new EditorMenuBar { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, RelativeSizeAxes = Axes.Both } - } - }); - - SummaryTimeline summaryTimeline; - Add(new Container - { - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - RelativeSizeAxes = Axes.X, - Height = 60, - Children = new Drawable[] + }, + new Container { - bottomBackground = new Box { RelativeSizeAxes = Axes.Both }, - new Container + Name = "Bottom bar", + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + RelativeSizeAxes = Axes.X, + Height = 60, + Children = new Drawable[] { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 10 }, - Child = new FillFlowContainer + bottomBackground = new Box { RelativeSizeAxes = Axes.Both }, + new Container { - Name = "Bottom bar", RelativeSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - Spacing = new Vector2(10, 0), - Children = new[] + Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 10, Right = 10 }, + Child = new FillFlowContainer { - summaryTimeline = new SummaryTimeline + Name = "Bottom bar", + RelativeSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(10, 0), + Children = new[] { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - RelativeSizeAxes = Axes.Both, - Width = 0.65f + timeline = new SummaryTimeline + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Width = 0.65f + } } } } } + }, } - }); + }; - summaryTimeline.Beatmap.BindTo(Beatmap); + timeline.Beatmap.BindTo(Beatmap); } [BackgroundDependencyLoader] From c2d63eb0bd9f239084f12de5c51aabab9e7477d8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 2 Oct 2017 09:26:41 +0900 Subject: [PATCH 05/26] Add EditorScreen + screen changing functionality --- osu.Game/Screens/Edit/Editor.cs | 24 +++++++++++ osu.Game/Screens/Edit/Screens/EditorScreen.cs | 40 +++++++++++++++++++ osu.Game/Tests/Visual/TestCaseEditor.cs | 3 +- osu.Game/osu.Game.csproj | 1 + 4 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 osu.Game/Screens/Edit/Screens/EditorScreen.cs diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 8b6c0f0bf5..7f5ad0aa0a 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -13,6 +13,7 @@ using osu.Game.Screens.Edit.Menus; using osu.Game.Screens.Edit.Components.Timelines.Summary; using OpenTK; using osu.Framework.Allocation; +using osu.Game.Screens.Edit.Screens; namespace osu.Game.Screens.Edit { @@ -23,6 +24,9 @@ namespace osu.Game.Screens.Edit internal override bool ShowOverlays => false; private readonly Box bottomBackground; + private readonly Container modeContainer; + + private EditorScreen currentScreen; public Editor() { @@ -77,10 +81,16 @@ namespace osu.Game.Screens.Edit } } }, + modeContainer = new Container + { + Name = "Screen container", + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Top = 40, Bottom = 60 } } }; timeline.Beatmap.BindTo(Beatmap); + menuBar.ModeChanged += onModeChanged; } [BackgroundDependencyLoader] @@ -89,6 +99,20 @@ namespace osu.Game.Screens.Edit bottomBackground.Colour = colours.Gray2; } + private void onModeChanged(EditorScreenMode mode) + { + currentScreen?.Exit(); + + switch (mode) + { + default: + currentScreen = new EditorScreen(); + break; + } + + modeContainer.Add(currentScreen); + } + protected override void OnResuming(Screen last) { Beatmap.Value.Track?.Stop(); diff --git a/osu.Game/Screens/Edit/Screens/EditorScreen.cs b/osu.Game/Screens/Edit/Screens/EditorScreen.cs new file mode 100644 index 0000000000..49921a0025 --- /dev/null +++ b/osu.Game/Screens/Edit/Screens/EditorScreen.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using OpenTK.Graphics; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.MathUtils; + +namespace osu.Game.Screens.Edit.Screens +{ + public class EditorScreen : CompositeDrawable + { + private readonly Container content; + + public EditorScreen() + { + Anchor = Anchor.Centre; + Origin = Anchor.Centre; + RelativeSizeAxes = Axes.Both; + + InternalChild = content = new Container { RelativeSizeAxes = Axes.Both }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + this.ScaleTo(0.5f).FadeTo(0) + .Then() + .ScaleTo(1f, 500, Easing.OutQuint).FadeTo(1f, 500, Easing.OutQuint); + } + + public void Exit() + { + this.ScaleTo(1.5f, 500).FadeOut(500f).Expire(); + } + } +} diff --git a/osu.Game/Tests/Visual/TestCaseEditor.cs b/osu.Game/Tests/Visual/TestCaseEditor.cs index 6114d1eb2e..6f7d05d299 100644 --- a/osu.Game/Tests/Visual/TestCaseEditor.cs +++ b/osu.Game/Tests/Visual/TestCaseEditor.cs @@ -7,12 +7,13 @@ using osu.Framework.Allocation; using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Screens.Edit; +using osu.Game.Screens.Edit.Screens; namespace osu.Game.Tests.Visual { public class TestCaseEditor : OsuTestCase { - public override IReadOnlyList RequiredTypes => new[] { typeof(Editor) }; + public override IReadOnlyList RequiredTypes => new[] { typeof(Editor), typeof(EditorScreen) }; private readonly Random rng; diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 9dfc2401ae..94bd4862af 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -618,6 +618,7 @@ + From 2a310f02bcf0326f81d996ec72cd3076b1488436 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 2 Oct 2017 09:27:27 +0900 Subject: [PATCH 06/26] modeContainer -> screenContainer --- osu.Game/Screens/Edit/Editor.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 7f5ad0aa0a..33b1f04cba 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -24,7 +24,7 @@ namespace osu.Game.Screens.Edit internal override bool ShowOverlays => false; private readonly Box bottomBackground; - private readonly Container modeContainer; + private readonly Container screenContainer; private EditorScreen currentScreen; @@ -81,7 +81,7 @@ namespace osu.Game.Screens.Edit } } }, - modeContainer = new Container + screenContainer = new Container { Name = "Screen container", RelativeSizeAxes = Axes.Both, @@ -110,7 +110,7 @@ namespace osu.Game.Screens.Edit break; } - modeContainer.Add(currentScreen); + screenContainer.Add(currentScreen); } protected override void OnResuming(Screen last) From 6018b4e5e4b606e0c7fd65720153f7e6bfbaa34c Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 2 Oct 2017 09:34:51 +0900 Subject: [PATCH 07/26] Make EditorScreen a Container --- osu.Game/Screens/Edit/Screens/EditorScreen.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Screens/EditorScreen.cs b/osu.Game/Screens/Edit/Screens/EditorScreen.cs index 49921a0025..ecc7ee1e7c 100644 --- a/osu.Game/Screens/Edit/Screens/EditorScreen.cs +++ b/osu.Game/Screens/Edit/Screens/EditorScreen.cs @@ -10,8 +10,9 @@ using osu.Framework.MathUtils; namespace osu.Game.Screens.Edit.Screens { - public class EditorScreen : CompositeDrawable + public class EditorScreen : Container { + protected override Container Content => content; private readonly Container content; public EditorScreen() From 91cede79c28e763110e0657f1108494f4144b953 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 2 Oct 2017 10:07:34 +0900 Subject: [PATCH 08/26] Mask the editor screens --- osu.Game/Screens/Edit/Editor.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 33b1f04cba..05443420ef 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -81,11 +81,16 @@ namespace osu.Game.Screens.Edit } } }, - screenContainer = new Container + new Container { Name = "Screen container", RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = 40, Bottom = 60 } + Padding = new MarginPadding { Top = 40, Bottom = 60 }, + Child = screenContainer = new Container + { + RelativeSizeAxes = Axes.Both, + Masking = true + } } }; From af4c6276e46b82b7a6779d2424b2dcad4284323e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 2 Oct 2017 10:09:10 +0900 Subject: [PATCH 09/26] Adjust transforms of EditorScreen --- osu.Game/Screens/Edit/Screens/EditorScreen.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/EditorScreen.cs b/osu.Game/Screens/Edit/Screens/EditorScreen.cs index ecc7ee1e7c..8c4f6e7dbe 100644 --- a/osu.Game/Screens/Edit/Screens/EditorScreen.cs +++ b/osu.Game/Screens/Edit/Screens/EditorScreen.cs @@ -30,12 +30,12 @@ namespace osu.Game.Screens.Edit.Screens this.ScaleTo(0.5f).FadeTo(0) .Then() - .ScaleTo(1f, 500, Easing.OutQuint).FadeTo(1f, 500, Easing.OutQuint); + .ScaleTo(1f, 500, Easing.OutQuint).FadeTo(1f, 250, Easing.OutQuint); } public void Exit() { - this.ScaleTo(1.5f, 500).FadeOut(500f).Expire(); + this.ScaleTo(1.5f, 500).FadeOut(250).Expire(); } } } From 69b61a62a53ac1a23c1f5dafc1264fce51294a99 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 2 Oct 2017 10:09:21 +0900 Subject: [PATCH 10/26] Implement base Compose screen --- osu.Game/Screens/Edit/Editor.cs | 4 ++ .../Screens/Edit/Screens/Compose/Compose.cs | 42 +++++++++++++++++++ osu.Game/osu.Game.csproj | 1 + 3 files changed, 47 insertions(+) create mode 100644 osu.Game/Screens/Edit/Screens/Compose/Compose.cs diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 05443420ef..06b2a6de64 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -14,6 +14,7 @@ using osu.Game.Screens.Edit.Components.Timelines.Summary; using OpenTK; using osu.Framework.Allocation; using osu.Game.Screens.Edit.Screens; +using osu.Game.Screens.Edit.Screens.Compose; namespace osu.Game.Screens.Edit { @@ -110,6 +111,9 @@ namespace osu.Game.Screens.Edit switch (mode) { + case EditorScreenMode.Compose: + currentScreen = new Compose(); + break; default: currentScreen = new EditorScreen(); break; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Compose.cs b/osu.Game/Screens/Edit/Screens/Compose/Compose.cs new file mode 100644 index 0000000000..6da7fc900d --- /dev/null +++ b/osu.Game/Screens/Edit/Screens/Compose/Compose.cs @@ -0,0 +1,42 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK.Graphics; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; + +namespace osu.Game.Screens.Edit.Screens.Compose +{ + public class Compose : EditorScreen + { + public Compose() + { + Children = new[] + { + new Container + { + Name = "Timeline", + RelativeSizeAxes = Axes.X, + Height = 110, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black.Opacity(0.5f) + }, + new Container + { + Name = "Content", + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Horizontal = 17, Vertical = 10 } + } + } + } + }; + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 94bd4862af..9a8536bbc2 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -619,6 +619,7 @@ + From 7211dd201546ae7293971431bd9c8a067137d56b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 2 Oct 2017 10:11:43 +0900 Subject: [PATCH 11/26] Remove unnecessary usings --- osu.Game/Screens/Edit/Editor.cs | 1 - osu.Game/Screens/Edit/Screens/Compose/Compose.cs | 1 - osu.Game/Screens/Edit/Screens/EditorScreen.cs | 4 ---- osu.Game/Tests/Visual/TestCaseEditor.cs | 1 - 4 files changed, 7 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 06b2a6de64..8a11a50fd6 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -8,7 +8,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Graphics; -using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Edit.Menus; using osu.Game.Screens.Edit.Components.Timelines.Summary; using OpenTK; diff --git a/osu.Game/Screens/Edit/Screens/Compose/Compose.cs b/osu.Game/Screens/Edit/Screens/Compose/Compose.cs index 6da7fc900d..2fe40dd010 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Compose.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Compose.cs @@ -6,7 +6,6 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Game.Graphics; namespace osu.Game.Screens.Edit.Screens.Compose { diff --git a/osu.Game/Screens/Edit/Screens/EditorScreen.cs b/osu.Game/Screens/Edit/Screens/EditorScreen.cs index 8c4f6e7dbe..c456ad6a51 100644 --- a/osu.Game/Screens/Edit/Screens/EditorScreen.cs +++ b/osu.Game/Screens/Edit/Screens/EditorScreen.cs @@ -1,12 +1,8 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using OpenTK; -using OpenTK.Graphics; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; -using osu.Framework.MathUtils; namespace osu.Game.Screens.Edit.Screens { diff --git a/osu.Game/Tests/Visual/TestCaseEditor.cs b/osu.Game/Tests/Visual/TestCaseEditor.cs index 6f7d05d299..6da5e514b2 100644 --- a/osu.Game/Tests/Visual/TestCaseEditor.cs +++ b/osu.Game/Tests/Visual/TestCaseEditor.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using osu.Framework.Allocation; -using osu.Framework.MathUtils; using osu.Game.Beatmaps; using osu.Game.Screens.Edit; using osu.Game.Screens.Edit.Screens; From cf44868bcdd090d0b43313545b9e0c5646b42e5e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 4 Oct 2017 15:02:11 +0900 Subject: [PATCH 12/26] Give EditorScreen a Beatmap --- osu.Game/Screens/Edit/Editor.cs | 1 + osu.Game/Screens/Edit/Screens/EditorScreen.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 8a11a50fd6..ca072ed73e 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -118,6 +118,7 @@ namespace osu.Game.Screens.Edit break; } + currentScreen.Beatmap.BindTo(Beatmap); screenContainer.Add(currentScreen); } diff --git a/osu.Game/Screens/Edit/Screens/EditorScreen.cs b/osu.Game/Screens/Edit/Screens/EditorScreen.cs index c456ad6a51..509c61a530 100644 --- a/osu.Game/Screens/Edit/Screens/EditorScreen.cs +++ b/osu.Game/Screens/Edit/Screens/EditorScreen.cs @@ -1,13 +1,17 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Game.Beatmaps; namespace osu.Game.Screens.Edit.Screens { public class EditorScreen : Container { + public readonly Bindable Beatmap = new Bindable(); + protected override Container Content => content; private readonly Container content; From 357a4673373a3dd1e0fc1da0bc5b01e3ba998c7d Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 4 Oct 2017 19:24:19 +0900 Subject: [PATCH 13/26] Implement design mode --- osu.Game/Screens/Edit/Editor.cs | 4 ++ .../Screens/Edit/Screens/Design/Design.cs | 52 +++++++++++++++++++ osu.Game/osu.Game.csproj | 1 + 3 files changed, 57 insertions(+) create mode 100644 osu.Game/Screens/Edit/Screens/Design/Design.cs diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index ca072ed73e..036243e668 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -14,6 +14,7 @@ using OpenTK; using osu.Framework.Allocation; using osu.Game.Screens.Edit.Screens; using osu.Game.Screens.Edit.Screens.Compose; +using osu.Game.Screens.Edit.Screens.Design; namespace osu.Game.Screens.Edit { @@ -113,6 +114,9 @@ namespace osu.Game.Screens.Edit case EditorScreenMode.Compose: currentScreen = new Compose(); break; + case EditorScreenMode.Design: + currentScreen = new Design(); + break; default: currentScreen = new EditorScreen(); break; diff --git a/osu.Game/Screens/Edit/Screens/Design/Design.cs b/osu.Game/Screens/Edit/Screens/Design/Design.cs new file mode 100644 index 0000000000..e527d7dad9 --- /dev/null +++ b/osu.Game/Screens/Edit/Screens/Design/Design.cs @@ -0,0 +1,52 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics.Sprites; +using OpenTK.Graphics; + +namespace osu.Game.Screens.Edit.Screens.Design +{ + internal class Design : EditorScreen + { + public Design() + { + Add(new Container + { + RelativeSizeAxes = Axes.Both, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.35f + }, + new Container + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + AutoSizeAxes = Axes.Both, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + Alpha = 0.5f + }, + new Container + { + AutoSizeAxes = Axes.Both, + Padding = new MarginPadding(20), + Child = new OsuSpriteText { Text = "Design screen" } + } + } + } + } + }); + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 9a8536bbc2..39fd968763 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -618,6 +618,7 @@ + From e2824d4732c1c177619820ae231223991520ff5f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 4 Oct 2017 19:26:26 +0900 Subject: [PATCH 14/26] Reduce harshness of scale for now Though I don't feel like we should worry about this much just yet until we have actual designs and can see how it looks. It's very well possible that we use different transitions here... --- osu.Game/Screens/Edit/Screens/EditorScreen.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/EditorScreen.cs b/osu.Game/Screens/Edit/Screens/EditorScreen.cs index 509c61a530..152c00a48d 100644 --- a/osu.Game/Screens/Edit/Screens/EditorScreen.cs +++ b/osu.Game/Screens/Edit/Screens/EditorScreen.cs @@ -28,14 +28,14 @@ namespace osu.Game.Screens.Edit.Screens { base.LoadComplete(); - this.ScaleTo(0.5f).FadeTo(0) + this.ScaleTo(0.75f).FadeTo(0) .Then() .ScaleTo(1f, 500, Easing.OutQuint).FadeTo(1f, 250, Easing.OutQuint); } public void Exit() { - this.ScaleTo(1.5f, 500).FadeOut(250).Expire(); + this.ScaleTo(1.25f, 500).FadeOut(250).Expire(); } } } From 34eede0d04dd887e472846163027d36b52f1bbc5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 4 Oct 2017 19:36:55 +0900 Subject: [PATCH 15/26] Re-namespace EditorScreenMode --- osu.Game/Screens/Edit/Menus/EditorMenuBar.cs | 2 +- .../Edit/Menus/ScreenSelectionTabControl.cs | 14 +------------- .../Screens/Edit/Screens/EditorScreenMode.cs | 19 +++++++++++++++++++ osu.Game/osu.Game.csproj | 1 + 4 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 osu.Game/Screens/Edit/Screens/EditorScreenMode.cs diff --git a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs index 4c9b3c84b3..34a96b0a6e 100644 --- a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs +++ b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs @@ -11,7 +11,7 @@ using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using OpenTK; using OpenTK.Graphics; -using System; +using osu.Game.Screens.Edit.Screens; namespace osu.Game.Screens.Edit.Menus { diff --git a/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs b/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs index 652ef1d61f..f5e47464ae 100644 --- a/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs +++ b/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs @@ -9,8 +9,8 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; +using osu.Game.Screens.Edit.Screens; using OpenTK; -using System.ComponentModel; namespace osu.Game.Screens.Edit.Menus { @@ -70,16 +70,4 @@ namespace osu.Game.Screens.Edit.Menus } } } - - public enum EditorScreenMode - { - [Description("compose")] - Compose, - [Description("design")] - Design, - [Description("timing")] - Timing, - [Description("song")] - SongSetup - } } diff --git a/osu.Game/Screens/Edit/Screens/EditorScreenMode.cs b/osu.Game/Screens/Edit/Screens/EditorScreenMode.cs new file mode 100644 index 0000000000..6489bb305b --- /dev/null +++ b/osu.Game/Screens/Edit/Screens/EditorScreenMode.cs @@ -0,0 +1,19 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.ComponentModel; + +namespace osu.Game.Screens.Edit.Screens +{ + public enum EditorScreenMode + { + [Description("compose")] + Compose, + [Description("design")] + Design, + [Description("timing")] + Timing, + [Description("song")] + SongSetup + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 39fd968763..f1ba54cba3 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -613,6 +613,7 @@ + From 8a52fdc8fa5abc503c6399cb214a7c0d97a39092 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 4 Oct 2017 19:37:17 +0900 Subject: [PATCH 16/26] Use a bindable for the current screen in EditorMenuBar Replaces the current Action. --- osu.Game/Screens/Edit/Editor.cs | 2 +- osu.Game/Screens/Edit/Menus/EditorMenuBar.cs | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 036243e668..4fca38a6c6 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -96,7 +96,7 @@ namespace osu.Game.Screens.Edit }; timeline.Beatmap.BindTo(Beatmap); - menuBar.ModeChanged += onModeChanged; + menuBar.Mode.ValueChanged += onModeChanged; } [BackgroundDependencyLoader] diff --git a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs index 34a96b0a6e..a4348b4489 100644 --- a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs +++ b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs @@ -11,16 +11,14 @@ using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using OpenTK; using OpenTK.Graphics; +using osu.Framework.Configuration; using osu.Game.Screens.Edit.Screens; namespace osu.Game.Screens.Edit.Menus { public class EditorMenuBar : OsuMenu { - /// - /// Invaoked when the selected mode has changed. - /// - public event Action ModeChanged; + public readonly Bindable Mode = new Bindable(); private readonly ScreenSelectionTabControl tabControl; @@ -42,7 +40,7 @@ namespace osu.Game.Screens.Edit.Menus } }); - tabControl.Current.ValueChanged += v => ModeChanged?.Invoke(v); + tabControl.Current.BindTo(Mode); } protected override void LoadComplete() From 3557737a18ae303f76adc8919654ed0f2d17e56e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 6 Oct 2017 23:20:56 +0800 Subject: [PATCH 17/26] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 5f19dd913d..ef889b4ec7 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 5f19dd913dfc69013a3b9cf30ccfd9c44881a321 +Subproject commit ef889b4ec7e6175d52d64411c15f4f195fd16209 From 19c663da110cf62ceda4cf4df8f608c7f1917e41 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 6 Oct 2017 23:41:49 +0800 Subject: [PATCH 18/26] Remove scale effect on editor screen switches --- osu.Game/Screens/Edit/Screens/EditorScreen.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/EditorScreen.cs b/osu.Game/Screens/Edit/Screens/EditorScreen.cs index 152c00a48d..ac248930d8 100644 --- a/osu.Game/Screens/Edit/Screens/EditorScreen.cs +++ b/osu.Game/Screens/Edit/Screens/EditorScreen.cs @@ -28,14 +28,14 @@ namespace osu.Game.Screens.Edit.Screens { base.LoadComplete(); - this.ScaleTo(0.75f).FadeTo(0) + this.FadeTo(0) .Then() - .ScaleTo(1f, 500, Easing.OutQuint).FadeTo(1f, 250, Easing.OutQuint); + .FadeTo(1f, 250, Easing.OutQuint); } public void Exit() { - this.ScaleTo(1.25f, 500).FadeOut(250).Expire(); + this.FadeOut(250).Expire(); } } } From fc99860f4eb60d5bbaca12771409bfb383997b9f Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 7 Oct 2017 00:48:31 +0900 Subject: [PATCH 19/26] Remove EditorMenuBarItem --- osu.Game/Screens/Edit/Menus/EditorMenuBarItem.cs | 15 --------------- osu.Game/Tests/Visual/TestCaseEditorMenuBar.cs | 7 ++++--- osu.Game/osu.Game.csproj | 1 - 3 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 osu.Game/Screens/Edit/Menus/EditorMenuBarItem.cs diff --git a/osu.Game/Screens/Edit/Menus/EditorMenuBarItem.cs b/osu.Game/Screens/Edit/Menus/EditorMenuBarItem.cs deleted file mode 100644 index 201bc6e5c3..0000000000 --- a/osu.Game/Screens/Edit/Menus/EditorMenuBarItem.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Graphics.UserInterface; - -namespace osu.Game.Screens.Edit.Menus -{ - public class EditorMenuBarItem : MenuItem - { - public EditorMenuBarItem(string text) - : base(text) - { - } - } -} diff --git a/osu.Game/Tests/Visual/TestCaseEditorMenuBar.cs b/osu.Game/Tests/Visual/TestCaseEditorMenuBar.cs index b0c21b6b8c..0d0f2609ef 100644 --- a/osu.Game/Tests/Visual/TestCaseEditorMenuBar.cs +++ b/osu.Game/Tests/Visual/TestCaseEditorMenuBar.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Edit.Menus; @@ -28,7 +29,7 @@ namespace osu.Game.Tests.Visual RelativeSizeAxes = Axes.Both, Items = new[] { - new EditorMenuBarItem("File") + new MenuItem("File") { Items = new[] { @@ -55,7 +56,7 @@ namespace osu.Game.Tests.Visual new EditorMenuItem("Exit"), } }, - new EditorMenuBarItem("Timing") + new MenuItem("Timing") { Items = new[] { @@ -78,7 +79,7 @@ namespace osu.Game.Tests.Visual new EditorMenuItem("Set Current Position as Preview Point"), } }, - new EditorMenuBarItem("Testing") + new MenuItem("Testing") { Items = new[] { diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 84d1ae56fc..ff5c492fc7 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -623,7 +623,6 @@ - From a154ee3a8984b2c3a3106c0a88d45283feea4246 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 7 Oct 2017 00:51:30 +0900 Subject: [PATCH 20/26] Add File -> Exit to editor menu --- osu.Game/Screens/Edit/Editor.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 4fca38a6c6..2756a163e7 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -12,6 +12,8 @@ using osu.Game.Screens.Edit.Menus; using osu.Game.Screens.Edit.Components.Timelines.Summary; using OpenTK; using osu.Framework.Allocation; +using osu.Framework.Graphics.UserInterface; +using osu.Game.Graphics.UserInterface; using osu.Game.Screens.Edit.Screens; using osu.Game.Screens.Edit.Screens.Compose; using osu.Game.Screens.Edit.Screens.Design; @@ -45,7 +47,17 @@ namespace osu.Game.Screens.Edit { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - RelativeSizeAxes = Axes.Both + RelativeSizeAxes = Axes.Both, + Items = new[] + { + new MenuItem("File") + { + Items = new[] + { + new EditorMenuItem("Exit", MenuItemType.Standard, Exit) + } + } + } } }, new Container From d3109a5950468c09bd13b2143815960b44018ea5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 7 Oct 2017 00:59:14 +0900 Subject: [PATCH 21/26] Hook up BeatmapPanel "Edit" item --- osu.Game/Beatmaps/Drawables/BeatmapGroup.cs | 5 ++++- osu.Game/Screens/Select/BeatmapCarousel.cs | 3 +++ osu.Game/Screens/Select/SongSelect.cs | 8 ++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs index 9c62289bfa..d1682a392d 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapGroup.cs @@ -31,6 +31,8 @@ namespace osu.Game.Beatmaps.Drawables public Action HideDifficultyRequested; + public Action EditRequested; + public BeatmapSetHeader Header; public List 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(); diff --git a/osu.Game/Screens/Select/BeatmapCarousel.cs b/osu.Game/Screens/Select/BeatmapCarousel.cs index abd288baf2..c72f599955 100644 --- a/osu.Game/Screens/Select/BeatmapCarousel.cs +++ b/osu.Game/Screens/Select/BeatmapCarousel.cs @@ -177,6 +177,8 @@ namespace osu.Game.Screens.Select public Action RestoreRequested; + public Action EditRequested; + public Action 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 }; diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 836ed465c3..b11613634a 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -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); From 837d1ba12e6a83e4a5e10adca5d1e57bf664267a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 7 Oct 2017 01:38:13 +0900 Subject: [PATCH 22/26] Remove rounded corners on the editor menu bar --- osu.Game/Screens/Edit/Menus/EditorMenuBar.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs index a4348b4489..fdaac81c68 100644 --- a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs +++ b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs @@ -27,6 +27,7 @@ namespace osu.Game.Screens.Edit.Menus { RelativeSizeAxes = Axes.X; + MaskingContainer.CornerRadius = 0; ItemsContainer.Padding = new MarginPadding { Left = 100 }; BackgroundColour = OsuColour.FromHex("111"); From 38ae9d905e44c0a132046bbd2151f0c6847f2cb5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 7 Oct 2017 01:42:45 +0900 Subject: [PATCH 23/26] Fix bindable binding to make the editor load a screen by default again --- osu.Game/Screens/Edit/Menus/EditorMenuBar.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs index fdaac81c68..17b2e64d8e 100644 --- a/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs +++ b/osu.Game/Screens/Edit/Menus/EditorMenuBar.cs @@ -20,8 +20,6 @@ namespace osu.Game.Screens.Edit.Menus { public readonly Bindable Mode = new Bindable(); - private readonly ScreenSelectionTabControl tabControl; - public EditorMenuBar() : base(Direction.Horizontal, true) { @@ -31,6 +29,7 @@ namespace osu.Game.Screens.Edit.Menus ItemsContainer.Padding = new MarginPadding { Left = 100 }; BackgroundColour = OsuColour.FromHex("111"); + ScreenSelectionTabControl tabControl; AddRangeInternal(new Drawable[] { tabControl = new ScreenSelectionTabControl @@ -41,13 +40,13 @@ namespace osu.Game.Screens.Edit.Menus } }); - tabControl.Current.BindTo(Mode); + Mode.BindTo(tabControl.Current); } protected override void LoadComplete() { base.LoadComplete(); - tabControl.Current.TriggerChange(); + Mode.TriggerChange(); } protected override Framework.Graphics.UserInterface.Menu CreateSubMenu() => new SubMenu(); From d432ab7510072781da6b4f1cb7559e127ff67333 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 7 Oct 2017 01:44:20 +0900 Subject: [PATCH 24/26] Reorder screen tab control items --- osu.Game/Screens/Edit/Screens/EditorScreenMode.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Edit/Screens/EditorScreenMode.cs b/osu.Game/Screens/Edit/Screens/EditorScreenMode.cs index 6489bb305b..578d888193 100644 --- a/osu.Game/Screens/Edit/Screens/EditorScreenMode.cs +++ b/osu.Game/Screens/Edit/Screens/EditorScreenMode.cs @@ -7,13 +7,13 @@ namespace osu.Game.Screens.Edit.Screens { public enum EditorScreenMode { + [Description("setup")] + SongSetup, [Description("compose")] Compose, [Description("design")] Design, [Description("timing")] Timing, - [Description("song")] - SongSetup } } From c0b394811ff00cab3d55f0ade5d6165a0c955fd0 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 7 Oct 2017 01:46:54 +0900 Subject: [PATCH 25/26] Make compose mode the default Hopefully we can keep this at a ScreenSelectionTabControl level, but it may need to be moved to the Editor at some point. I'm leaving that for a future change however, if it's needed. --- osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs b/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs index f5e47464ae..dae2e4b320 100644 --- a/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs +++ b/osu.Game/Screens/Edit/Menus/ScreenSelectionTabControl.cs @@ -33,6 +33,8 @@ namespace osu.Game.Screens.Edit.Menus Height = 1, Colour = Color4.White.Opacity(0.2f), }); + + Current.Value = EditorScreenMode.Compose; } [BackgroundDependencyLoader] From 10abaa866b06491d740c7649cf34311116bd855c Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Sat, 7 Oct 2017 01:56:11 +0900 Subject: [PATCH 26/26] Put screens below the top and bottom bars of the editor --- osu.Game/Screens/Edit/Editor.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/osu.Game/Screens/Edit/Editor.cs b/osu.Game/Screens/Edit/Editor.cs index 2756a163e7..b47a3263b7 100644 --- a/osu.Game/Screens/Edit/Editor.cs +++ b/osu.Game/Screens/Edit/Editor.cs @@ -38,6 +38,17 @@ namespace osu.Game.Screens.Edit Children = new[] { + new Container + { + Name = "Screen container", + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Top = 40, Bottom = 60 }, + Child = screenContainer = new Container + { + RelativeSizeAxes = Axes.Both, + Masking = true + } + }, new Container { Name = "Top bar", @@ -94,17 +105,6 @@ namespace osu.Game.Screens.Edit } } }, - new Container - { - Name = "Screen container", - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = 40, Bottom = 60 }, - Child = screenContainer = new Container - { - RelativeSizeAxes = Axes.Both, - Masking = true - } - } }; timeline.Beatmap.BindTo(Beatmap);