From 658c23c92522cc634063b012062ffad85b8e5b6c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Apr 2021 13:15:17 +0900 Subject: [PATCH 01/13] Give more space to the parameter adjustment area --- osu.Game/Screens/Edit/Timing/TimingScreen.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Timing/TimingScreen.cs b/osu.Game/Screens/Edit/Timing/TimingScreen.cs index c5d2dd756a..74ca6bc6f9 100644 --- a/osu.Game/Screens/Edit/Timing/TimingScreen.cs +++ b/osu.Game/Screens/Edit/Timing/TimingScreen.cs @@ -32,7 +32,7 @@ namespace osu.Game.Screens.Edit.Timing ColumnDimensions = new[] { new Dimension(), - new Dimension(GridSizeMode.Absolute, 200), + new Dimension(GridSizeMode.Absolute, 350), }, Content = new[] { From 0c918410d07026a9b9bfd145ce1eb6ef0ed30a0a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Apr 2021 13:15:24 +0900 Subject: [PATCH 02/13] Make "add" button more visible --- osu.Game/Screens/Edit/Timing/TimingScreen.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Edit/Timing/TimingScreen.cs b/osu.Game/Screens/Edit/Timing/TimingScreen.cs index 74ca6bc6f9..d7a5442de1 100644 --- a/osu.Game/Screens/Edit/Timing/TimingScreen.cs +++ b/osu.Game/Screens/Edit/Timing/TimingScreen.cs @@ -106,9 +106,9 @@ namespace osu.Game.Screens.Edit.Timing }, new OsuButton { - Text = "+", + Text = "+ Add at current time", Action = addNew, - Size = new Vector2(30, 30), + Size = new Vector2(160, 30), Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, }, From 513e470b525c4948d793555beb0df0928b3b9019 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Apr 2021 13:24:53 +0900 Subject: [PATCH 03/13] Adjust grid spacing to allow attributes to use more width --- osu.Game/Screens/Edit/Timing/ControlPointTable.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs index dd51056bf1..6d4f3d1b3a 100644 --- a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs +++ b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs @@ -66,9 +66,7 @@ namespace osu.Game.Screens.Edit.Timing { var columns = new List { - new TableColumn(string.Empty, Anchor.Centre, new Dimension(GridSizeMode.AutoSize)), - new TableColumn("Time", Anchor.Centre, new Dimension(GridSizeMode.AutoSize)), - new TableColumn(), + new TableColumn("Time", Anchor.CentreLeft, new Dimension(GridSizeMode.Absolute, 120)), new TableColumn("Attributes", Anchor.CentreLeft), }; @@ -77,18 +75,11 @@ namespace osu.Game.Screens.Edit.Timing private Drawable[] createContent(int index, ControlPointGroup group) => new Drawable[] { - new OsuSpriteText - { - Text = $"#{index + 1}", - Font = OsuFont.GetFont(size: TEXT_SIZE, weight: FontWeight.Bold), - Margin = new MarginPadding(10) - }, new OsuSpriteText { Text = group.Time.ToEditorFormattedString(), Font = OsuFont.GetFont(size: TEXT_SIZE, weight: FontWeight.Bold) }, - null, new ControlGroupAttributes(group), }; From e143afb598c3d3c8c688f2341ef8320d03e91018 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Apr 2021 13:57:46 +0900 Subject: [PATCH 04/13] Split out rounded content screen from SetupScreen for use in other places --- .../Edit/RoundedContentEditorScreen.cs | 61 +++++++++++++++++++ osu.Game/Screens/Edit/Setup/SetupScreen.cs | 49 +++------------ .../Screens/Edit/Setup/SetupScreenHeader.cs | 2 +- osu.Game/Screens/Edit/Setup/SetupSection.cs | 2 +- osu.Game/Screens/Edit/Verify/VerifyScreen.cs | 9 ++- 5 files changed, 77 insertions(+), 46 deletions(-) create mode 100644 osu.Game/Screens/Edit/RoundedContentEditorScreen.cs diff --git a/osu.Game/Screens/Edit/RoundedContentEditorScreen.cs b/osu.Game/Screens/Edit/RoundedContentEditorScreen.cs new file mode 100644 index 0000000000..a55ae3f635 --- /dev/null +++ b/osu.Game/Screens/Edit/RoundedContentEditorScreen.cs @@ -0,0 +1,61 @@ +// Copyright (c) ppy Pty Ltd . 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.Graphics; +using osu.Game.Overlays; + +namespace osu.Game.Screens.Edit +{ + public class RoundedContentEditorScreen : EditorScreen + { + public const int HORIZONTAL_PADDING = 100; + + [Resolved] + private OsuColour colours { get; set; } + + [Cached] + protected readonly OverlayColourProvider ColourProvider; + + private Container roundedContent; + + protected override Container Content => roundedContent; + + public RoundedContentEditorScreen(EditorScreenMode mode) + : base(mode) + { + ColourProvider = new OverlayColourProvider(OverlayColourScheme.Blue); + } + + [BackgroundDependencyLoader] + private void load() + { + 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.Dark4, + RelativeSizeAxes = Axes.Both, + }, + roundedContent = new Container + { + RelativeSizeAxes = Axes.Both, + }, + } + } + }); + } + } +} diff --git a/osu.Game/Screens/Edit/Setup/SetupScreen.cs b/osu.Game/Screens/Edit/Setup/SetupScreen.cs index 70671b487c..15cb384573 100644 --- a/osu.Game/Screens/Edit/Setup/SetupScreen.cs +++ b/osu.Game/Screens/Edit/Setup/SetupScreen.cs @@ -3,24 +3,12 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; -using osu.Game.Graphics; using osu.Game.Graphics.Containers; -using osu.Game.Overlays; namespace osu.Game.Screens.Edit.Setup { - public class SetupScreen : EditorScreen + public class SetupScreen : RoundedContentEditorScreen { - public const int HORIZONTAL_PADDING = 100; - - [Resolved] - private OsuColour colours { get; set; } - - [Cached] - protected readonly OverlayColourProvider ColourProvider; - [Cached] private SectionsContainer sections = new SectionsContainer(); @@ -30,42 +18,25 @@ namespace osu.Game.Screens.Edit.Setup public SetupScreen() : base(EditorScreenMode.SongSetup) { - ColourProvider = new OverlayColourProvider(OverlayColourScheme.Blue); } [BackgroundDependencyLoader] private void load() { - Child = new Container + AddRange(new Drawable[] { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding(50), - Child = new Container + sections = new SectionsContainer { + FixedHeader = header, RelativeSizeAxes = Axes.Both, - Masking = true, - CornerRadius = 10, - Children = new Drawable[] + Children = new SetupSection[] { - new Box - { - Colour = ColourProvider.Dark4, - RelativeSizeAxes = Axes.Both, - }, - sections = new SectionsContainer - { - FixedHeader = header, - RelativeSizeAxes = Axes.Both, - Children = new SetupSection[] - { - new ResourcesSection(), - new MetadataSection(), - new DifficultySection(), - } - }, + new ResourcesSection(), + new MetadataSection(), + new DifficultySection(), } - } - }; + }, + }); } } } diff --git a/osu.Game/Screens/Edit/Setup/SetupScreenHeader.cs b/osu.Game/Screens/Edit/Setup/SetupScreenHeader.cs index 06aad69afa..10daacc359 100644 --- a/osu.Game/Screens/Edit/Setup/SetupScreenHeader.cs +++ b/osu.Game/Screens/Edit/Setup/SetupScreenHeader.cs @@ -93,7 +93,7 @@ namespace osu.Game.Screens.Edit.Setup public SetupScreenTabControl() { - TabContainer.Margin = new MarginPadding { Horizontal = SetupScreen.HORIZONTAL_PADDING }; + TabContainer.Margin = new MarginPadding { Horizontal = RoundedContentEditorScreen.HORIZONTAL_PADDING }; AddInternal(background = new Box { diff --git a/osu.Game/Screens/Edit/Setup/SetupSection.cs b/osu.Game/Screens/Edit/Setup/SetupSection.cs index de62c3a468..b3ae15900f 100644 --- a/osu.Game/Screens/Edit/Setup/SetupSection.cs +++ b/osu.Game/Screens/Edit/Setup/SetupSection.cs @@ -33,7 +33,7 @@ namespace osu.Game.Screens.Edit.Setup Padding = new MarginPadding { Vertical = 10, - Horizontal = SetupScreen.HORIZONTAL_PADDING + Horizontal = RoundedContentEditorScreen.HORIZONTAL_PADDING }; InternalChild = new FillFlowContainer diff --git a/osu.Game/Screens/Edit/Verify/VerifyScreen.cs b/osu.Game/Screens/Edit/Verify/VerifyScreen.cs index 550fbe2950..a2ee153951 100644 --- a/osu.Game/Screens/Edit/Verify/VerifyScreen.cs +++ b/osu.Game/Screens/Edit/Verify/VerifyScreen.cs @@ -7,16 +7,16 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; +using osu.Game.Overlays; using osu.Game.Rulesets.Edit; using osu.Game.Rulesets.Edit.Checks.Components; using osuTK; namespace osu.Game.Screens.Edit.Verify { - public class VerifyScreen : EditorScreen + public class VerifyScreen : RoundedContentEditorScreen { [Cached] private Bindable selectedIssue = new Bindable(); @@ -32,7 +32,6 @@ namespace osu.Game.Screens.Edit.Verify Child = new Container { RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding(20), Child = new GridContainer { RelativeSizeAxes = Axes.Both, @@ -70,7 +69,7 @@ namespace osu.Game.Screens.Edit.Verify private BeatmapVerifier generalVerifier; [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colours) { generalVerifier = new BeatmapVerifier(); rulesetVerifier = Beatmap.BeatmapInfo.Ruleset?.CreateInstance()?.CreateBeatmapVerifier(); @@ -81,7 +80,7 @@ namespace osu.Game.Screens.Edit.Verify { new Box { - Colour = colours.Gray0, + Colour = colours.Background2, RelativeSizeAxes = Axes.Both, }, new OsuScrollContainer From f4baff9e0495b3939b5970bdcdbc6f32fc114088 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Apr 2021 14:11:26 +0900 Subject: [PATCH 05/13] Make `TimingScreen` use rounded screen and adjust spacing/padding --- osu.Game/Screens/Edit/EditorTable.cs | 7 +-- .../Edit/Timing/ControlPointSettings.cs | 6 +-- osu.Game/Screens/Edit/Timing/Section.cs | 20 ++++----- osu.Game/Screens/Edit/Timing/TimingScreen.cs | 43 +++++++++---------- 4 files changed, 37 insertions(+), 39 deletions(-) diff --git a/osu.Game/Screens/Edit/EditorTable.cs b/osu.Game/Screens/Edit/EditorTable.cs index ef1c88db9a..9a793c8c97 100644 --- a/osu.Game/Screens/Edit/EditorTable.cs +++ b/osu.Game/Screens/Edit/EditorTable.cs @@ -9,6 +9,7 @@ using osu.Framework.Input.Events; using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; +using osu.Game.Overlays; using osuTK.Graphics; namespace osu.Game.Screens.Edit @@ -93,10 +94,10 @@ namespace osu.Game.Screens.Edit private Color4 colourSelected; [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colours) { - hoveredBackground.Colour = colourHover = colours.BlueDarker; - colourSelected = colours.YellowDarker; + hoveredBackground.Colour = colourHover = colours.Background3; + colourSelected = colours.Background1; } private bool selected; diff --git a/osu.Game/Screens/Edit/Timing/ControlPointSettings.cs b/osu.Game/Screens/Edit/Timing/ControlPointSettings.cs index c40061b97c..921fa675b3 100644 --- a/osu.Game/Screens/Edit/Timing/ControlPointSettings.cs +++ b/osu.Game/Screens/Edit/Timing/ControlPointSettings.cs @@ -6,15 +6,15 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Game.Graphics; using osu.Game.Graphics.Containers; +using osu.Game.Overlays; namespace osu.Game.Screens.Edit.Timing { public class ControlPointSettings : CompositeDrawable { [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colours) { RelativeSizeAxes = Axes.Both; @@ -22,7 +22,7 @@ namespace osu.Game.Screens.Edit.Timing { new Box { - Colour = colours.Gray3, + Colour = colours.Background4, RelativeSizeAxes = Axes.Both, }, new OsuScrollContainer diff --git a/osu.Game/Screens/Edit/Timing/Section.cs b/osu.Game/Screens/Edit/Timing/Section.cs index 5269fa9774..8659b7aff6 100644 --- a/osu.Game/Screens/Edit/Timing/Section.cs +++ b/osu.Game/Screens/Edit/Timing/Section.cs @@ -8,8 +8,9 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Beatmaps.ControlPoints; -using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; +using osu.Game.Overlays; +using osuTK; namespace osu.Game.Screens.Edit.Timing { @@ -23,7 +24,7 @@ namespace osu.Game.Screens.Edit.Timing protected Bindable ControlPoint { get; } = new Bindable(); - private const float header_height = 20; + private const float header_height = 50; [Resolved] protected EditorBeatmap Beatmap { get; private set; } @@ -35,7 +36,7 @@ namespace osu.Game.Screens.Edit.Timing protected IEditorChangeHandler ChangeHandler { get; private set; } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colours) { RelativeSizeAxes = Axes.X; AutoSizeDuration = 200; @@ -46,19 +47,17 @@ namespace osu.Game.Screens.Edit.Timing InternalChildren = new Drawable[] { - new Box - { - Colour = colours.Gray1, - RelativeSizeAxes = Axes.Both, - }, new Container { RelativeSizeAxes = Axes.X, Height = header_height, + Padding = new MarginPadding { Horizontal = 10 }, Children = new Drawable[] { checkbox = new OsuCheckbox { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, LabelText = typeof(T).Name.Replace(nameof(Beatmaps.ControlPoints.ControlPoint), string.Empty) } } @@ -72,12 +71,13 @@ namespace osu.Game.Screens.Edit.Timing { new Box { - Colour = colours.Gray2, + Colour = colours.Background3, RelativeSizeAxes = Axes.Both, }, Flow = new FillFlowContainer { - Padding = new MarginPadding(10), + Padding = new MarginPadding(20), + Spacing = new Vector2(20), RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, diff --git a/osu.Game/Screens/Edit/Timing/TimingScreen.cs b/osu.Game/Screens/Edit/Timing/TimingScreen.cs index d7a5442de1..0b446314e8 100644 --- a/osu.Game/Screens/Edit/Timing/TimingScreen.cs +++ b/osu.Game/Screens/Edit/Timing/TimingScreen.cs @@ -8,15 +8,14 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Game.Beatmaps.ControlPoints; -using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Graphics.UserInterface; -using osu.Game.Screens.Edit.Compose.Components.Timeline; +using osu.Game.Overlays; using osuTK; namespace osu.Game.Screens.Edit.Timing { - public class TimingScreen : EditorScreenWithTimeline + public class TimingScreen : RoundedContentEditorScreen { [Cached] private Bindable selectedGroup = new Bindable(); @@ -26,28 +25,26 @@ namespace osu.Game.Screens.Edit.Timing { } - protected override Drawable CreateMainContent() => new GridContainer + [BackgroundDependencyLoader] + private void load() { - RelativeSizeAxes = Axes.Both, - ColumnDimensions = new[] + Add(new GridContainer { - new Dimension(), - new Dimension(GridSizeMode.Absolute, 350), - }, - Content = new[] - { - new Drawable[] + RelativeSizeAxes = Axes.Both, + ColumnDimensions = new[] { - new ControlPointList(), - new ControlPointSettings(), + new Dimension(), + new Dimension(GridSizeMode.Absolute, 350), }, - } - }; - - protected override void OnTimelineLoaded(TimelineArea timelineArea) - { - base.OnTimelineLoaded(timelineArea); - timelineArea.Timeline.Zoom = timelineArea.Timeline.MinZoom; + Content = new[] + { + new Drawable[] + { + new ControlPointList(), + new ControlPointSettings(), + }, + } + }); } public class ControlPointList : CompositeDrawable @@ -70,7 +67,7 @@ namespace osu.Game.Screens.Edit.Timing private IEditorChangeHandler changeHandler { get; set; } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colours) { RelativeSizeAxes = Axes.Both; @@ -78,7 +75,7 @@ namespace osu.Game.Screens.Edit.Timing { new Box { - Colour = colours.Gray0, + Colour = colours.Background2, RelativeSizeAxes = Axes.Both, }, new OsuScrollContainer From a10a8680d0cedbb71666c6883f6ea4082997c48c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Apr 2021 15:06:07 +0900 Subject: [PATCH 06/13] Add new display for timing row attributes --- osu.Game/Beatmaps/Timing/TimeSignatures.cs | 5 ++ osu.Game/Screens/Edit/EditorTable.cs | 2 +- .../Screens/Edit/Timing/ControlPointTable.cs | 17 +++-- osu.Game/Screens/Edit/Timing/RowAttribute.cs | 68 ++++++++++++------- .../Timing/RowAttributes/EmptyRowAttribute.cs | 63 +++++++++++++++++ .../RowAttributes/TimingRowAttribute.cs | 45 ++++++++++++ 6 files changed, 170 insertions(+), 30 deletions(-) create mode 100644 osu.Game/Screens/Edit/Timing/RowAttributes/EmptyRowAttribute.cs create mode 100644 osu.Game/Screens/Edit/Timing/RowAttributes/TimingRowAttribute.cs diff --git a/osu.Game/Beatmaps/Timing/TimeSignatures.cs b/osu.Game/Beatmaps/Timing/TimeSignatures.cs index 147f6239b4..33e6342ae6 100644 --- a/osu.Game/Beatmaps/Timing/TimeSignatures.cs +++ b/osu.Game/Beatmaps/Timing/TimeSignatures.cs @@ -1,11 +1,16 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.ComponentModel; + namespace osu.Game.Beatmaps.Timing { public enum TimeSignatures { + [Description("4/4")] SimpleQuadruple = 4, + + [Description("3/4")] SimpleTriple = 3 } } diff --git a/osu.Game/Screens/Edit/EditorTable.cs b/osu.Game/Screens/Edit/EditorTable.cs index 9a793c8c97..5a34a79726 100644 --- a/osu.Game/Screens/Edit/EditorTable.cs +++ b/osu.Game/Screens/Edit/EditorTable.cs @@ -20,7 +20,7 @@ namespace osu.Game.Screens.Edit protected const float ROW_HEIGHT = 25; - protected const int TEXT_SIZE = 14; + public const int TEXT_SIZE = 14; protected readonly FillFlowContainer BackgroundFlow; diff --git a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs index 6d4f3d1b3a..a680a087b8 100644 --- a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs +++ b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs @@ -12,6 +12,7 @@ using osu.Game.Beatmaps.ControlPoints; using osu.Game.Extensions; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Screens.Edit.Timing.RowAttributes; using osuTK; using osuTK.Graphics; @@ -119,7 +120,12 @@ namespace osu.Game.Screens.Edit.Timing private void createChildren() { - fill.ChildrenEnumerable = controlPoints.Select(createAttribute).Where(c => c != null); + fill.ChildrenEnumerable = controlPoints + .Select(createAttribute) + .Where(c => c != null) + // arbitrary ordering to make timing points first. + // probably want to explicitly define order in the future. + .OrderByDescending(c => c.GetType().Name); } private Drawable createAttribute(ControlPoint controlPoint) @@ -129,20 +135,19 @@ namespace osu.Game.Screens.Edit.Timing switch (controlPoint) { case TimingControlPoint timing: - return new RowAttribute("timing", () => $"{60000 / timing.BeatLength:n1}bpm {timing.TimeSignature}", colour); + return new TimingRowAttribute(timing); case DifficultyControlPoint difficulty: - - return new RowAttribute("difficulty", () => $"{difficulty.SpeedMultiplier:n2}x", colour); + return new EmptyRowAttribute("difficulty", () => $"{difficulty.SpeedMultiplier:n2}x", colour); case EffectControlPoint effect: - return new RowAttribute("effect", () => string.Join(" ", + return new EmptyRowAttribute("effect", () => string.Join(" ", effect.KiaiMode ? "Kiai" : string.Empty, effect.OmitFirstBarLine ? "NoBarLine" : string.Empty ).Trim(), colour); case SampleControlPoint sample: - return new RowAttribute("sample", () => $"{sample.SampleBank} {sample.SampleVolume}%", colour); + return new EmptyRowAttribute("sample", () => $"{sample.SampleBank} {sample.SampleVolume}%", colour); } return null; diff --git a/osu.Game/Screens/Edit/Timing/RowAttribute.cs b/osu.Game/Screens/Edit/Timing/RowAttribute.cs index 2757e08026..55051a1bb2 100644 --- a/osu.Game/Screens/Edit/Timing/RowAttribute.cs +++ b/osu.Game/Screens/Edit/Timing/RowAttribute.cs @@ -1,33 +1,31 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Shapes; +using osu.Game.Beatmaps.ControlPoints; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; -using osuTK.Graphics; +using osu.Game.Overlays; +using osuTK; namespace osu.Game.Screens.Edit.Timing { - public class RowAttribute : CompositeDrawable, IHasTooltip + public class RowAttribute : CompositeDrawable { - private readonly string header; - private readonly Func content; - private readonly Color4 colour; + private readonly ControlPoint point; - public RowAttribute(string header, Func content, Color4 colour) + protected FillFlowContainer Content { get; private set; } + + public RowAttribute(ControlPoint point) { - this.header = header; - this.content = content; - this.colour = colour; + this.point = point; } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, OverlayColourProvider overlayColours) { AutoSizeAxes = Axes.X; @@ -43,21 +41,45 @@ namespace osu.Game.Screens.Edit.Timing { new Box { - Colour = colour, + Colour = overlayColours.Background4, RelativeSizeAxes = Axes.Both, }, - new OsuSpriteText + Content = new FillFlowContainer { - Padding = new MarginPadding(2), - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Font = OsuFont.Default.With(weight: FontWeight.SemiBold, size: 12), - Text = header, - Colour = colours.Gray0 - }, + RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, + Direction = FillDirection.Horizontal, + Margin = new MarginPadding { Right = 5 }, + Spacing = new Vector2(5), + Children = new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.Y, + AutoSizeAxes = Axes.X, + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Children = new Drawable[] + { + new Box + { + Colour = point.GetRepresentingColour(colours), + RelativeSizeAxes = Axes.Both, + }, + new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Padding = new MarginPadding(3), + Font = OsuFont.Default.With(weight: FontWeight.SemiBold, size: 12), + Text = point.GetType().Name.Replace("ControlPoint", string.Empty).ToLowerInvariant(), + Colour = colours.Gray0 + }, + }, + }, + }, + } }; } - - public string TooltipText => content(); } } diff --git a/osu.Game/Screens/Edit/Timing/RowAttributes/EmptyRowAttribute.cs b/osu.Game/Screens/Edit/Timing/RowAttributes/EmptyRowAttribute.cs new file mode 100644 index 0000000000..8a73853eb3 --- /dev/null +++ b/osu.Game/Screens/Edit/Timing/RowAttributes/EmptyRowAttribute.cs @@ -0,0 +1,63 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Cursor; +using osu.Framework.Graphics.Shapes; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osuTK.Graphics; + +namespace osu.Game.Screens.Edit.Timing.RowAttributes +{ + public class EmptyRowAttribute : CompositeDrawable, IHasTooltip + { + private readonly string header; + private readonly Func content; + private readonly Color4 colour; + + public EmptyRowAttribute(string header, Func content, Color4 colour) + { + this.header = header; + this.content = content; + this.colour = colour; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + AutoSizeAxes = Axes.X; + + Height = 20; + + Anchor = Anchor.CentreLeft; + Origin = Anchor.CentreLeft; + + Masking = true; + CornerRadius = 5; + + InternalChildren = new Drawable[] + { + new Box + { + Colour = colour, + RelativeSizeAxes = Axes.Both, + }, + new OsuSpriteText + { + Padding = new MarginPadding(2), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Font = OsuFont.Default.With(weight: FontWeight.SemiBold, size: 12), + Text = header, + Colour = colours.Gray0 + }, + }; + } + + public string TooltipText => content(); + } +} diff --git a/osu.Game/Screens/Edit/Timing/RowAttributes/TimingRowAttribute.cs b/osu.Game/Screens/Edit/Timing/RowAttributes/TimingRowAttribute.cs new file mode 100644 index 0000000000..07e041650c --- /dev/null +++ b/osu.Game/Screens/Edit/Timing/RowAttributes/TimingRowAttribute.cs @@ -0,0 +1,45 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Extensions; +using osu.Framework.Graphics; +using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Beatmaps.Timing; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; + +namespace osu.Game.Screens.Edit.Timing.RowAttributes +{ + internal class TimingRowAttribute : RowAttribute + { + private readonly BindableNumber beatLength; + private readonly Bindable timeSignature; + private OsuSpriteText text; + + public TimingRowAttribute(TimingControlPoint timing) + : base(timing) + { + timeSignature = timing.TimeSignatureBindable.GetBoundCopy(); + beatLength = timing.BeatLengthBindable.GetBoundCopy(); + } + + [BackgroundDependencyLoader] + private void load() + { + Content.Add(text = new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Font = OsuFont.GetFont(size: EditorTable.TEXT_SIZE, weight: FontWeight.Regular), + }); + + timeSignature.BindValueChanged(_ => updateText()); + beatLength.BindValueChanged(_ => updateText(), true); + } + + private void updateText() => + text.Text = $"{60000 / beatLength.Value:n1}bpm {timeSignature.Value.GetDescription()}"; + } +} From d3cebfb6fb63d0dabd62f695f58ce41e241b5b27 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Apr 2021 15:27:38 +0900 Subject: [PATCH 07/13] Use explicit label --- osu.Game/Screens/Edit/Timing/RowAttribute.cs | 6 ++++-- .../Screens/Edit/Timing/RowAttributes/TimingRowAttribute.cs | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Edit/Timing/RowAttribute.cs b/osu.Game/Screens/Edit/Timing/RowAttribute.cs index 55051a1bb2..4cfdeb06c3 100644 --- a/osu.Game/Screens/Edit/Timing/RowAttribute.cs +++ b/osu.Game/Screens/Edit/Timing/RowAttribute.cs @@ -16,12 +16,14 @@ namespace osu.Game.Screens.Edit.Timing public class RowAttribute : CompositeDrawable { private readonly ControlPoint point; + private readonly string label; protected FillFlowContainer Content { get; private set; } - public RowAttribute(ControlPoint point) + public RowAttribute(ControlPoint point, string label) { this.point = point; + this.label = label; } [BackgroundDependencyLoader] @@ -72,7 +74,7 @@ namespace osu.Game.Screens.Edit.Timing Origin = Anchor.CentreLeft, Padding = new MarginPadding(3), Font = OsuFont.Default.With(weight: FontWeight.SemiBold, size: 12), - Text = point.GetType().Name.Replace("ControlPoint", string.Empty).ToLowerInvariant(), + Text = label, Colour = colours.Gray0 }, }, diff --git a/osu.Game/Screens/Edit/Timing/RowAttributes/TimingRowAttribute.cs b/osu.Game/Screens/Edit/Timing/RowAttributes/TimingRowAttribute.cs index 07e041650c..c6e2649f8e 100644 --- a/osu.Game/Screens/Edit/Timing/RowAttributes/TimingRowAttribute.cs +++ b/osu.Game/Screens/Edit/Timing/RowAttributes/TimingRowAttribute.cs @@ -12,14 +12,14 @@ using osu.Game.Graphics.Sprites; namespace osu.Game.Screens.Edit.Timing.RowAttributes { - internal class TimingRowAttribute : RowAttribute + public class TimingRowAttribute : RowAttribute { private readonly BindableNumber beatLength; private readonly Bindable timeSignature; private OsuSpriteText text; public TimingRowAttribute(TimingControlPoint timing) - : base(timing) + : base(timing, "timing") { timeSignature = timing.TimeSignatureBindable.GetBoundCopy(); beatLength = timing.BeatLengthBindable.GetBoundCopy(); From 3aad0a8b9c6df9efe7381a5050fbd42c34ce8d37 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Apr 2021 15:57:27 +0900 Subject: [PATCH 08/13] Add new display for difficulty row attribute --- .../Screens/Edit/Timing/ControlPointTable.cs | 2 +- osu.Game/Screens/Edit/Timing/RowAttribute.cs | 8 ++-- .../RowAttributes/AttributeProgressBar.cs | 41 ++++++++++++++++ .../RowAttributes/DifficultyRowAttribute.cs | 48 +++++++++++++++++++ 4 files changed, 95 insertions(+), 4 deletions(-) create mode 100644 osu.Game/Screens/Edit/Timing/RowAttributes/AttributeProgressBar.cs create mode 100644 osu.Game/Screens/Edit/Timing/RowAttributes/DifficultyRowAttribute.cs diff --git a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs index a680a087b8..f71f31acb7 100644 --- a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs +++ b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs @@ -138,7 +138,7 @@ namespace osu.Game.Screens.Edit.Timing return new TimingRowAttribute(timing); case DifficultyControlPoint difficulty: - return new EmptyRowAttribute("difficulty", () => $"{difficulty.SpeedMultiplier:n2}x", colour); + return new DifficultyRowAttribute(difficulty); case EffectControlPoint effect: return new EmptyRowAttribute("effect", () => string.Join(" ", diff --git a/osu.Game/Screens/Edit/Timing/RowAttribute.cs b/osu.Game/Screens/Edit/Timing/RowAttribute.cs index 4cfdeb06c3..e46459892c 100644 --- a/osu.Game/Screens/Edit/Timing/RowAttribute.cs +++ b/osu.Game/Screens/Edit/Timing/RowAttribute.cs @@ -15,14 +15,16 @@ namespace osu.Game.Screens.Edit.Timing { public class RowAttribute : CompositeDrawable { - private readonly ControlPoint point; + protected readonly ControlPoint Point; + private readonly string label; protected FillFlowContainer Content { get; private set; } public RowAttribute(ControlPoint point, string label) { - this.point = point; + Point = point; + this.label = label; } @@ -65,7 +67,7 @@ namespace osu.Game.Screens.Edit.Timing { new Box { - Colour = point.GetRepresentingColour(colours), + Colour = Point.GetRepresentingColour(colours), RelativeSizeAxes = Axes.Both, }, new OsuSpriteText diff --git a/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeProgressBar.cs b/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeProgressBar.cs new file mode 100644 index 0000000000..9d7def4c33 --- /dev/null +++ b/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeProgressBar.cs @@ -0,0 +1,41 @@ +// Copyright (c) ppy Pty Ltd . 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.Game.Beatmaps.ControlPoints; +using osu.Game.Graphics; +using osu.Game.Graphics.UserInterface; +using osu.Game.Overlays; +using osuTK; + +namespace osu.Game.Screens.Edit.Timing.RowAttributes +{ + public class AttributeProgressBar : ProgressBar + { + private readonly ControlPoint controlPoint; + + public AttributeProgressBar(ControlPoint controlPoint) + : base(false) + { + this.controlPoint = controlPoint; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours, OverlayColourProvider overlayColours) + { + Anchor = Anchor.CentreLeft; + Origin = Anchor.CentreLeft; + + Masking = true; + + RelativeSizeAxes = Axes.None; + + Size = new Vector2(80, 8); + CornerRadius = Height / 2; + + BackgroundColour = overlayColours.Background6; + Colour = controlPoint.GetRepresentingColour(colours); + } + } +} diff --git a/osu.Game/Screens/Edit/Timing/RowAttributes/DifficultyRowAttribute.cs b/osu.Game/Screens/Edit/Timing/RowAttributes/DifficultyRowAttribute.cs new file mode 100644 index 0000000000..1fdd8c2708 --- /dev/null +++ b/osu.Game/Screens/Edit/Timing/RowAttributes/DifficultyRowAttribute.cs @@ -0,0 +1,48 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; + +namespace osu.Game.Screens.Edit.Timing.RowAttributes +{ + public class DifficultyRowAttribute : RowAttribute + { + private readonly BindableNumber speedMultiplier; + + private OsuSpriteText text; + + public DifficultyRowAttribute(DifficultyControlPoint difficulty) + : base(difficulty, "difficulty") + { + speedMultiplier = difficulty.SpeedMultiplierBindable.GetBoundCopy(); + } + + [BackgroundDependencyLoader] + private void load() + { + Content.AddRange(new Drawable[] + { + text = new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Width = 40, + Font = OsuFont.GetFont(size: EditorTable.TEXT_SIZE, weight: FontWeight.Regular), + }, + new AttributeProgressBar(Point) + { + Current = speedMultiplier, + } + }); + + speedMultiplier.BindValueChanged(_ => updateText(), true); + } + + private void updateText() => text.Text = $"{speedMultiplier.Value:n2}x"; + } +} From 6465a72060ab9cf3b7515bc288f56576b415bd1f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Apr 2021 16:23:26 +0900 Subject: [PATCH 09/13] Add bubbled word class for use in attribute rows --- .../RowAttributes/AttributeBubbledWord.cs | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 osu.Game/Screens/Edit/Timing/RowAttributes/AttributeBubbledWord.cs diff --git a/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeBubbledWord.cs b/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeBubbledWord.cs new file mode 100644 index 0000000000..3e956cbe92 --- /dev/null +++ b/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeBubbledWord.cs @@ -0,0 +1,71 @@ +// Copyright (c) ppy Pty Ltd . 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.Beatmaps.ControlPoints; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Overlays; + +namespace osu.Game.Screens.Edit.Timing.RowAttributes +{ + public class AttributeBubbledWord : CompositeDrawable + { + private readonly ControlPoint controlPoint; + + private OsuSpriteText textDrawable; + + private string text; + + public string Text + { + get => text; + set + { + if (value == text) + return; + + text = value; + if (textDrawable != null) + textDrawable.Text = text; + } + } + + public AttributeBubbledWord(ControlPoint controlPoint) + { + this.controlPoint = controlPoint; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours, OverlayColourProvider overlayColours) + { + AutoSizeAxes = Axes.X; + + Anchor = Anchor.CentreLeft; + Origin = Anchor.CentreLeft; + + Height = 12; + + InternalChildren = new Drawable[] + { + new Circle + { + Colour = controlPoint.GetRepresentingColour(colours), + RelativeSizeAxes = Axes.Both, + }, + textDrawable = new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Padding = new MarginPadding(3), + Font = OsuFont.Default.With(weight: FontWeight.SemiBold, size: 12), + Text = text, + Colour = colours.Gray0 + }, + }; + } + } +} From ec249a0edbf40c694f905539ddf03691a463d222 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Apr 2021 16:10:37 +0900 Subject: [PATCH 10/13] Add new display for sample row attribute --- .../Screens/Edit/Timing/ControlPointTable.cs | 2 +- .../RowAttributes/SampleRowAttribute.cs | 61 +++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 osu.Game/Screens/Edit/Timing/RowAttributes/SampleRowAttribute.cs diff --git a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs index f71f31acb7..17aa5bbefa 100644 --- a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs +++ b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs @@ -147,7 +147,7 @@ namespace osu.Game.Screens.Edit.Timing ).Trim(), colour); case SampleControlPoint sample: - return new EmptyRowAttribute("sample", () => $"{sample.SampleBank} {sample.SampleVolume}%", colour); + return new SampleRowAttribute(sample); } return null; diff --git a/osu.Game/Screens/Edit/Timing/RowAttributes/SampleRowAttribute.cs b/osu.Game/Screens/Edit/Timing/RowAttributes/SampleRowAttribute.cs new file mode 100644 index 0000000000..066b180423 --- /dev/null +++ b/osu.Game/Screens/Edit/Timing/RowAttributes/SampleRowAttribute.cs @@ -0,0 +1,61 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Game.Beatmaps.ControlPoints; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; + +namespace osu.Game.Screens.Edit.Timing.RowAttributes +{ + public class SampleRowAttribute : RowAttribute + { + private AttributeBubbledWord sampleText; + private OsuSpriteText volumeText; + + private readonly Bindable sampleBank; + private readonly BindableNumber volume; + + public SampleRowAttribute(SampleControlPoint sample) + : base(sample, "sample") + { + sampleBank = sample.SampleBankBindable.GetBoundCopy(); + volume = sample.SampleVolumeBindable.GetBoundCopy(); + } + + [BackgroundDependencyLoader] + private void load() + { + AttributeProgressBar progress; + + Content.AddRange(new Drawable[] + { + volumeText = new OsuSpriteText + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Width = 30, + Font = OsuFont.GetFont(size: EditorTable.TEXT_SIZE, weight: FontWeight.Regular), + }, + progress = new AttributeProgressBar(Point), + sampleText = new AttributeBubbledWord(Point), + }); + + volume.BindValueChanged(vol => + { + progress.Current.Value = vol.NewValue / 100f; + updateText(); + }, true); + + sampleBank.BindValueChanged(_ => updateText(), true); + } + + private void updateText() + { + volumeText.Text = $"{volume.Value}%"; + sampleText.Text = $"{sampleBank.Value}"; + } + } +} From f8b20ca8aa16a302c4cfaaeea318db7c4201c1aa Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Apr 2021 16:28:18 +0900 Subject: [PATCH 11/13] Add new display for effect row attribute --- .../Screens/Edit/Timing/ControlPointTable.cs | 8 +--- .../RowAttributes/EffectRowAttribute.cs | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 osu.Game/Screens/Edit/Timing/RowAttributes/EffectRowAttribute.cs diff --git a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs index 17aa5bbefa..1f06bc5bc7 100644 --- a/osu.Game/Screens/Edit/Timing/ControlPointTable.cs +++ b/osu.Game/Screens/Edit/Timing/ControlPointTable.cs @@ -14,7 +14,6 @@ using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Screens.Edit.Timing.RowAttributes; using osuTK; -using osuTK.Graphics; namespace osu.Game.Screens.Edit.Timing { @@ -130,8 +129,6 @@ namespace osu.Game.Screens.Edit.Timing private Drawable createAttribute(ControlPoint controlPoint) { - Color4 colour = controlPoint.GetRepresentingColour(colours); - switch (controlPoint) { case TimingControlPoint timing: @@ -141,10 +138,7 @@ namespace osu.Game.Screens.Edit.Timing return new DifficultyRowAttribute(difficulty); case EffectControlPoint effect: - return new EmptyRowAttribute("effect", () => string.Join(" ", - effect.KiaiMode ? "Kiai" : string.Empty, - effect.OmitFirstBarLine ? "NoBarLine" : string.Empty - ).Trim(), colour); + return new EffectRowAttribute(effect); case SampleControlPoint sample: return new SampleRowAttribute(sample); diff --git a/osu.Game/Screens/Edit/Timing/RowAttributes/EffectRowAttribute.cs b/osu.Game/Screens/Edit/Timing/RowAttributes/EffectRowAttribute.cs new file mode 100644 index 0000000000..e7fc57e2c9 --- /dev/null +++ b/osu.Game/Screens/Edit/Timing/RowAttributes/EffectRowAttribute.cs @@ -0,0 +1,38 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Bindables; +using osu.Framework.Graphics; +using osu.Game.Beatmaps.ControlPoints; + +namespace osu.Game.Screens.Edit.Timing.RowAttributes +{ + public class EffectRowAttribute : RowAttribute + { + private readonly Bindable kiaiMode; + private readonly Bindable omitBarLine; + private AttributeBubbledWord kiaiModeBubble; + private AttributeBubbledWord omitBarLineBubble; + + public EffectRowAttribute(EffectControlPoint effect) + : base(effect, "effect") + { + kiaiMode = effect.KiaiModeBindable.GetBoundCopy(); + omitBarLine = effect.OmitFirstBarLineBindable.GetBoundCopy(); + } + + [BackgroundDependencyLoader] + private void load() + { + Content.AddRange(new Drawable[] + { + kiaiModeBubble = new AttributeBubbledWord(Point) { Text = "kiai" }, + omitBarLineBubble = new AttributeBubbledWord(Point) { Text = "no barline" }, + }); + + kiaiMode.BindValueChanged(enabled => kiaiModeBubble.FadeTo(enabled.NewValue ? 1 : 0), true); + omitBarLine.BindValueChanged(enabled => omitBarLineBubble.FadeTo(enabled.NewValue ? 1 : 0), true); + } + } +} From 8da561a2a637582248b3309f41b63cc0a61b2ca9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Apr 2021 16:35:13 +0900 Subject: [PATCH 12/13] Soften colours and adjust padding slightly --- osu.Game/Screens/Edit/Timing/RowAttribute.cs | 2 +- .../Screens/Edit/Timing/RowAttributes/AttributeBubbledWord.cs | 4 ++-- .../Screens/Edit/Timing/RowAttributes/AttributeProgressBar.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Edit/Timing/RowAttribute.cs b/osu.Game/Screens/Edit/Timing/RowAttribute.cs index e46459892c..e184907751 100644 --- a/osu.Game/Screens/Edit/Timing/RowAttribute.cs +++ b/osu.Game/Screens/Edit/Timing/RowAttribute.cs @@ -77,7 +77,7 @@ namespace osu.Game.Screens.Edit.Timing Padding = new MarginPadding(3), Font = OsuFont.Default.With(weight: FontWeight.SemiBold, size: 12), Text = label, - Colour = colours.Gray0 + Colour = overlayColours.Background5, }, }, }, diff --git a/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeBubbledWord.cs b/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeBubbledWord.cs index 3e956cbe92..7d7ad61de2 100644 --- a/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeBubbledWord.cs +++ b/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeBubbledWord.cs @@ -60,10 +60,10 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - Padding = new MarginPadding(3), + Padding = new MarginPadding(6), Font = OsuFont.Default.With(weight: FontWeight.SemiBold, size: 12), Text = text, - Colour = colours.Gray0 + Colour = overlayColours.Background5, }, }; } diff --git a/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeProgressBar.cs b/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeProgressBar.cs index 9d7def4c33..6f7e790489 100644 --- a/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeProgressBar.cs +++ b/osu.Game/Screens/Edit/Timing/RowAttributes/AttributeProgressBar.cs @@ -35,7 +35,7 @@ namespace osu.Game.Screens.Edit.Timing.RowAttributes CornerRadius = Height / 2; BackgroundColour = overlayColours.Background6; - Colour = controlPoint.GetRepresentingColour(colours); + FillColour = controlPoint.GetRepresentingColour(colours); } } } From 1ebc5ac5cc2d33abb3233ca60e51f988f133d319 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 19 Apr 2021 16:36:00 +0900 Subject: [PATCH 13/13] Remove unused legacy class --- .../Timing/RowAttributes/EmptyRowAttribute.cs | 63 ------------------- 1 file changed, 63 deletions(-) delete mode 100644 osu.Game/Screens/Edit/Timing/RowAttributes/EmptyRowAttribute.cs diff --git a/osu.Game/Screens/Edit/Timing/RowAttributes/EmptyRowAttribute.cs b/osu.Game/Screens/Edit/Timing/RowAttributes/EmptyRowAttribute.cs deleted file mode 100644 index 8a73853eb3..0000000000 --- a/osu.Game/Screens/Edit/Timing/RowAttributes/EmptyRowAttribute.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using System; -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Cursor; -using osu.Framework.Graphics.Shapes; -using osu.Game.Graphics; -using osu.Game.Graphics.Sprites; -using osuTK.Graphics; - -namespace osu.Game.Screens.Edit.Timing.RowAttributes -{ - public class EmptyRowAttribute : CompositeDrawable, IHasTooltip - { - private readonly string header; - private readonly Func content; - private readonly Color4 colour; - - public EmptyRowAttribute(string header, Func content, Color4 colour) - { - this.header = header; - this.content = content; - this.colour = colour; - } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - AutoSizeAxes = Axes.X; - - Height = 20; - - Anchor = Anchor.CentreLeft; - Origin = Anchor.CentreLeft; - - Masking = true; - CornerRadius = 5; - - InternalChildren = new Drawable[] - { - new Box - { - Colour = colour, - RelativeSizeAxes = Axes.Both, - }, - new OsuSpriteText - { - Padding = new MarginPadding(2), - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - Font = OsuFont.Default.With(weight: FontWeight.SemiBold, size: 12), - Text = header, - Colour = colours.Gray0 - }, - }; - } - - public string TooltipText => content(); - } -}