1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 00:12:55 +08:00

Merge pull request #18396 from peppy/editor-tidy-up

Bring editor design metrics up-to-date
This commit is contained in:
Dan Balasescu 2022-05-25 12:24:05 +09:00 committed by GitHub
commit e5db8a6de3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 72 additions and 130 deletions

View File

@ -28,7 +28,7 @@ namespace osu.Game.Tests.Visual.Editing
private Triangle tickMarkerHead => tickSliderBar.ChildrenOfType<Triangle>().Single(); private Triangle tickMarkerHead => tickSliderBar.ChildrenOfType<Triangle>().Single();
[Cached] [Cached]
private readonly OverlayColourProvider overlayColour = new OverlayColourProvider(OverlayColourScheme.Green); private readonly OverlayColourProvider overlayColour = new OverlayColourProvider(OverlayColourScheme.Aquamarine);
[SetUp] [SetUp]
public void SetUp() => Schedule(() => public void SetUp() => Schedule(() =>

View File

@ -154,7 +154,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load(OverlayColourProvider? colourProvider, OsuColour osuColour) private void load(OverlayColourProvider? colourProvider, OsuColour osuColour)
{ {
background.Colour = colourProvider?.Background4 ?? Color4Extensions.FromHex(@"1c2125"); background.Colour = colourProvider?.Background5 ?? Color4Extensions.FromHex(@"1c2125");
descriptionText.Colour = osuColour.Yellow; descriptionText.Colour = osuColour.Yellow;
} }

View File

@ -72,6 +72,9 @@ namespace osu.Game.Overlays
case OverlayColourScheme.Green: case OverlayColourScheme.Green:
return 125 / 360f; return 125 / 360f;
case OverlayColourScheme.Aquamarine:
return 160 / 360f;
case OverlayColourScheme.Purple: case OverlayColourScheme.Purple:
return 255 / 360f; return 255 / 360f;
@ -94,5 +97,6 @@ namespace osu.Game.Overlays
Purple, Purple,
Blue, Blue,
Plum, Plum,
Aquamarine
} }
} }

View File

@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Edit
{ {
AddInternal(RightSideToolboxContainer = new ExpandingToolboxContainer(130, 250) AddInternal(RightSideToolboxContainer = new ExpandingToolboxContainer(130, 250)
{ {
Padding = new MarginPadding { Right = 10 }, Padding = new MarginPadding(10),
Alpha = DistanceSpacingMultiplier.Disabled ? 0 : 1, Alpha = DistanceSpacingMultiplier.Disabled ? 0 : 1,
Anchor = Anchor.TopRight, Anchor = Anchor.TopRight,
Origin = Anchor.TopRight, Origin = Anchor.TopRight,

View File

@ -114,9 +114,9 @@ namespace osu.Game.Rulesets.Edit
.WithChild(BlueprintContainer = CreateBlueprintContainer()) .WithChild(BlueprintContainer = CreateBlueprintContainer())
} }
}, },
new ExpandingToolboxContainer(80, 200) new ExpandingToolboxContainer(90, 200)
{ {
Padding = new MarginPadding { Left = 10 }, Padding = new MarginPadding(10),
Children = new Drawable[] Children = new Drawable[]
{ {
new EditorToolboxGroup("toolbox (1-9)") new EditorToolboxGroup("toolbox (1-9)")

View File

@ -2,12 +2,12 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays;
using osuTK; using osuTK;
namespace osu.Game.Screens.Edit.Compose.Components.Timeline namespace osu.Game.Screens.Edit.Compose.Components.Timeline
@ -27,10 +27,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load(OverlayColourProvider colourProvider)
{ {
Masking = true; Masking = true;
CornerRadius = 5;
OsuCheckbox waveformCheckbox; OsuCheckbox waveformCheckbox;
OsuCheckbox controlPointsCheckbox; OsuCheckbox controlPointsCheckbox;
@ -41,7 +40,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Color4Extensions.FromHex("111") Colour = colourProvider.Background5
}, },
new GridContainer new GridContainer
{ {
@ -55,12 +54,13 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{ {
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X, AutoSizeAxes = Axes.X,
Name = @"Toggle controls",
Children = new Drawable[] Children = new Drawable[]
{ {
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Color4Extensions.FromHex("222") Colour = colourProvider.Background2,
}, },
new FillFlowContainer new FillFlowContainer
{ {
@ -94,12 +94,13 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{ {
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
AutoSizeAxes = Axes.X, AutoSizeAxes = Axes.X,
Name = @"Zoom controls",
Children = new Drawable[] Children = new Drawable[]
{ {
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Color4Extensions.FromHex("333") Colour = colourProvider.Background3,
}, },
new Container<TimelineButton> new Container<TimelineButton>
{ {

View File

@ -140,7 +140,7 @@ namespace osu.Game.Screens.Edit
public readonly EditorClipboard Clipboard = new EditorClipboard(); public readonly EditorClipboard Clipboard = new EditorClipboard();
[Cached] [Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue); private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Aquamarine);
public Editor(EditorLoader loader = null) public Editor(EditorLoader loader = null)
{ {
@ -777,6 +777,7 @@ namespace osu.Game.Screens.Edit
if ((currentScreen = screenContainer.SingleOrDefault(s => s.Type == e.NewValue)) != null) if ((currentScreen = screenContainer.SingleOrDefault(s => s.Type == e.NewValue)) != null)
{ {
screenContainer.ChangeChildDepth(currentScreen, lastScreen?.Depth + 1 ?? 0); screenContainer.ChangeChildDepth(currentScreen, lastScreen?.Depth + 1 ?? 0);
currentScreen.Show(); currentScreen.Show();
return; return;
} }

View File

@ -1,53 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Overlays;
namespace osu.Game.Screens.Edit
{
public class EditorRoundedScreen : EditorScreen
{
public const int HORIZONTAL_PADDING = 100;
private Container roundedContent;
protected override Container<Drawable> Content => roundedContent;
public EditorRoundedScreen(EditorScreenMode mode)
: base(mode)
{
}
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
base.Content.Add(new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding(50),
Child = new Container
{
RelativeSizeAxes = Axes.Both,
Masking = true,
CornerRadius = 10,
Children = new Drawable[]
{
new Box
{
Colour = colourProvider.Background3,
RelativeSizeAxes = Axes.Both,
},
roundedContent = new Container
{
RelativeSizeAxes = Axes.Both,
},
}
}
});
}
}
}

View File

@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Overlays; using osu.Game.Overlays;
using osuTK;
namespace osu.Game.Screens.Edit namespace osu.Game.Screens.Edit
{ {
@ -22,7 +23,7 @@ namespace osu.Game.Screens.Edit
{ {
new Box new Box
{ {
Colour = colours.Background4, Colour = colours.Background6,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}, },
new OsuScrollContainer new OsuScrollContainer
@ -33,6 +34,8 @@ namespace osu.Game.Screens.Edit
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Padding = new MarginPadding(10),
Spacing = new Vector2(10),
Children = CreateSections() Children = CreateSections()
}, },
} }

View File

@ -33,17 +33,9 @@ namespace osu.Game.Screens.Edit
InternalChild = content = new PopoverContainer { RelativeSizeAxes = Axes.Both }; InternalChild = content = new PopoverContainer { RelativeSizeAxes = Axes.Both };
} }
protected override void PopIn() protected override void PopIn() => this.FadeIn();
{
this.ScaleTo(1f, 200, Easing.OutQuint)
.FadeIn(200, Easing.OutQuint);
}
protected override void PopOut() protected override void PopOut() => this.FadeOut();
{
this.ScaleTo(0.98f, 200, Easing.OutQuint)
.FadeOut(200, Easing.OutQuint);
}
#region Clipboard operations #region Clipboard operations

View File

@ -3,21 +3,19 @@
using JetBrains.Annotations; using JetBrains.Annotations;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays;
using osu.Game.Screens.Edit.Compose.Components; using osu.Game.Screens.Edit.Compose.Components;
using osu.Game.Screens.Edit.Compose.Components.Timeline; using osu.Game.Screens.Edit.Compose.Components.Timeline;
using osuTK.Graphics;
namespace osu.Game.Screens.Edit namespace osu.Game.Screens.Edit
{ {
public abstract class EditorScreenWithTimeline : EditorScreen public abstract class EditorScreenWithTimeline : EditorScreen
{ {
private const float vertical_margins = 10; private const float padding = 10;
private const float horizontal_margins = 20;
private readonly BindableBeatDivisor beatDivisor = new BindableBeatDivisor(); private readonly BindableBeatDivisor beatDivisor = new BindableBeatDivisor();
@ -33,7 +31,7 @@ namespace osu.Game.Screens.Edit
private LoadingSpinner spinner; private LoadingSpinner spinner;
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load([CanBeNull] BindableBeatDivisor beatDivisor) private void load(OverlayColourProvider colourProvider, [CanBeNull] BindableBeatDivisor beatDivisor)
{ {
if (beatDivisor != null) if (beatDivisor != null)
this.beatDivisor.BindTo(beatDivisor); this.beatDivisor.BindTo(beatDivisor);
@ -60,14 +58,14 @@ namespace osu.Game.Screens.Edit
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Color4.Black.Opacity(0.5f) Colour = colourProvider.Background4
}, },
new Container new Container
{ {
Name = "Timeline content", Name = "Timeline content",
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = horizontal_margins, Vertical = vertical_margins }, Padding = new MarginPadding { Horizontal = padding, Top = padding },
Child = new GridContainer Child = new GridContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
@ -106,12 +104,6 @@ namespace osu.Game.Screens.Edit
Name = "Main content", Name = "Main content",
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Depth = float.MaxValue, Depth = float.MaxValue,
Padding = new MarginPadding
{
Horizontal = horizontal_margins,
Top = vertical_margins,
Bottom = vertical_margins
},
Child = spinner = new LoadingSpinner(true) Child = spinner = new LoadingSpinner(true)
{ {
State = { Value = Visibility.Visible }, State = { Value = Visibility.Visible },
@ -133,18 +125,10 @@ namespace osu.Game.Screens.Edit
mainContent.Add(content); mainContent.Add(content);
content.FadeInFromZero(300, Easing.OutQuint); content.FadeInFromZero(300, Easing.OutQuint);
LoadComponentAsync(new TimelineArea(CreateTimelineContent()), t => LoadComponentAsync(new TimelineArea(CreateTimelineContent()), timelineContainer.Add);
{
timelineContainer.Add(t);
OnTimelineLoaded(t);
});
}); });
} }
protected virtual void OnTimelineLoaded(TimelineArea timelineArea)
{
}
protected abstract Drawable CreateMainContent(); protected abstract Drawable CreateMainContent();
protected virtual Drawable CreateTimelineContent() => new Container(); protected virtual Drawable CreateTimelineContent() => new Container();

View File

@ -4,11 +4,13 @@
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Overlays;
namespace osu.Game.Screens.Edit.Setup namespace osu.Game.Screens.Edit.Setup
{ {
public class SetupScreen : EditorRoundedScreen public class SetupScreen : EditorScreen
{ {
[Cached] [Cached]
private SectionsContainer<SetupSection> sections { get; } = new SetupScreenSectionsContainer(); private SectionsContainer<SetupSection> sections { get; } = new SetupScreenSectionsContainer();
@ -22,7 +24,7 @@ namespace osu.Game.Screens.Edit.Setup
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(EditorBeatmap beatmap) private void load(EditorBeatmap beatmap, OverlayColourProvider colourProvider)
{ {
var sectionsEnumerable = new List<SetupSection> var sectionsEnumerable = new List<SetupSection>
{ {
@ -37,6 +39,12 @@ namespace osu.Game.Screens.Edit.Setup
if (rulesetSpecificSection != null) if (rulesetSpecificSection != null)
sectionsEnumerable.Add(rulesetSpecificSection); sectionsEnumerable.Add(rulesetSpecificSection);
Add(new Box
{
Colour = colourProvider.Background2,
RelativeSizeAxes = Axes.Both,
});
Add(sections.With(s => Add(sections.With(s =>
{ {
s.RelativeSizeAxes = Axes.Both; s.RelativeSizeAxes = Axes.Both;

View File

@ -93,7 +93,7 @@ namespace osu.Game.Screens.Edit.Setup
public SetupScreenTabControl() public SetupScreenTabControl()
{ {
TabContainer.Margin = new MarginPadding { Horizontal = EditorRoundedScreen.HORIZONTAL_PADDING }; TabContainer.Margin = new MarginPadding { Horizontal = 100 };
AddInternal(background = new Box AddInternal(background = new Box
{ {

View File

@ -40,7 +40,7 @@ namespace osu.Game.Screens.Edit.Setup
Padding = new MarginPadding Padding = new MarginPadding
{ {
Vertical = 10, Vertical = 10,
Horizontal = EditorRoundedScreen.HORIZONTAL_PADDING Horizontal = 100
}; };
InternalChild = new FillFlowContainer InternalChild = new FillFlowContainer

View File

@ -44,9 +44,15 @@ namespace osu.Game.Screens.Edit.Timing
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Masking = true; Masking = true;
CornerRadius = 5;
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
new Box
{
Colour = colours.Background4,
RelativeSizeAxes = Axes.Both,
},
new Container new Container
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
@ -69,11 +75,6 @@ namespace osu.Game.Screens.Edit.Timing
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Children = new Drawable[] Children = new Drawable[]
{ {
new Box
{
Colour = colours.Background3,
RelativeSizeAxes = Axes.Both,
},
Flow = new FillFlowContainer Flow = new FillFlowContainer
{ {
Padding = new MarginPadding(20), Padding = new MarginPadding(20),

View File

@ -11,6 +11,7 @@ using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterfaceV2; using osu.Game.Graphics.UserInterfaceV2;
using osu.Game.Overlays.Settings; using osu.Game.Overlays.Settings;
using osu.Game.Utils; using osu.Game.Utils;
using osuTK;
namespace osu.Game.Screens.Edit.Timing namespace osu.Game.Screens.Edit.Timing
{ {
@ -33,6 +34,7 @@ namespace osu.Game.Screens.Edit.Timing
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Spacing = new Vector2(20),
Children = new Drawable[] Children = new Drawable[]
{ {
textBox = new LabelledTextBox textBox = new LabelledTextBox

View File

@ -16,7 +16,7 @@ using osuTK;
namespace osu.Game.Screens.Edit.Timing namespace osu.Game.Screens.Edit.Timing
{ {
public class TimingScreen : EditorRoundedScreen public class TimingScreen : EditorScreenWithTimeline
{ {
[Cached] [Cached]
private Bindable<ControlPointGroup> selectedGroup = new Bindable<ControlPointGroup>(); private Bindable<ControlPointGroup> selectedGroup = new Bindable<ControlPointGroup>();
@ -26,27 +26,23 @@ namespace osu.Game.Screens.Edit.Timing
{ {
} }
[BackgroundDependencyLoader] protected override Drawable CreateMainContent() => new GridContainer
private void load()
{ {
Add(new GridContainer RelativeSizeAxes = Axes.Both,
ColumnDimensions = new[]
{ {
RelativeSizeAxes = Axes.Both, new Dimension(),
ColumnDimensions = new[] new Dimension(GridSizeMode.Absolute, 350),
},
Content = new[]
{
new Drawable[]
{ {
new Dimension(), new ControlPointList(),
new Dimension(GridSizeMode.Absolute, 350), new ControlPointSettings(),
}, },
Content = new[] }
{ };
new Drawable[]
{
new ControlPointList(),
new ControlPointSettings(),
},
}
});
}
public class ControlPointList : CompositeDrawable public class ControlPointList : CompositeDrawable
{ {
@ -77,12 +73,12 @@ namespace osu.Game.Screens.Edit.Timing
{ {
new Box new Box
{ {
Colour = colours.Background3, Colour = colours.Background4,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}, },
new Box new Box
{ {
Colour = colours.Background2, Colour = colours.Background3,
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
Width = ControlPointTable.TIMING_COLUMN_WIDTH + margins, Width = ControlPointTable.TIMING_COLUMN_WIDTH + margins,
}, },

View File

@ -11,7 +11,7 @@ using osu.Game.Rulesets.Edit.Checks.Components;
namespace osu.Game.Screens.Edit.Verify namespace osu.Game.Screens.Edit.Verify
{ {
[Cached] [Cached]
public class VerifyScreen : EditorRoundedScreen public class VerifyScreen : EditorScreen
{ {
public readonly Bindable<Issue> SelectedIssue = new Bindable<Issue>(); public readonly Bindable<Issue> SelectedIssue = new Bindable<Issue>();
@ -32,7 +32,6 @@ namespace osu.Game.Screens.Edit.Verify
InterpretedDifficulty.Default = BeatmapDifficultyCache.GetDifficultyRating(EditorBeatmap.BeatmapInfo.StarRating); InterpretedDifficulty.Default = BeatmapDifficultyCache.GetDifficultyRating(EditorBeatmap.BeatmapInfo.StarRating);
InterpretedDifficulty.SetDefault(); InterpretedDifficulty.SetDefault();
IssueList = new IssueList();
Child = new Container Child = new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
@ -48,7 +47,7 @@ namespace osu.Game.Screens.Edit.Verify
{ {
new Drawable[] new Drawable[]
{ {
IssueList, IssueList = new IssueList(),
new IssueSettings(), new IssueSettings(),
}, },
} }

View File

@ -5,6 +5,7 @@ using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Overlays;
using osu.Game.Screens.Edit; using osu.Game.Screens.Edit;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
@ -15,6 +16,9 @@ namespace osu.Game.Tests.Visual
/// </summary> /// </summary>
public abstract class EditorClockTestScene : OsuManualInputManagerTestScene public abstract class EditorClockTestScene : OsuManualInputManagerTestScene
{ {
[Cached]
private readonly OverlayColourProvider overlayColour = new OverlayColourProvider(OverlayColourScheme.Aquamarine);
protected readonly BindableBeatDivisor BeatDivisor = new BindableBeatDivisor(); protected readonly BindableBeatDivisor BeatDivisor = new BindableBeatDivisor();
protected new readonly EditorClock Clock; protected new readonly EditorClock Clock;