1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-17 08:42:56 +08:00

When adding a new combo colour, use the last colour as a starting point

Also opens the popover automatically because you always want to edit it.
This commit is contained in:
Dean Herbert 2024-10-04 18:43:39 +09:00
parent 2914a5b93b
commit ff2777a3b9
No known key found for this signature in database

View File

@ -3,6 +3,7 @@
using System;
using System.Collections.Specialized;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions;
@ -19,6 +20,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays;
using osu.Game.Resources.Localisation.Web;
using osuTK;
using osuTK.Graphics;
namespace osu.Game.Graphics.UserInterfaceV2
{
@ -76,7 +78,7 @@ namespace osu.Game.Graphics.UserInterfaceV2
Spacing = new Vector2(5),
Child = button = new RoundedButton
{
Action = () => Colours.Add(Colour4.White),
Action = addNewColour,
Size = new Vector2(70),
Text = "+",
}
@ -112,6 +114,16 @@ namespace osu.Game.Graphics.UserInterfaceV2
updateState();
}
private void addNewColour()
{
Color4 startingColour = Colours.Count > 0
? Colours.Last()
: Colour4.White;
Colours.Add(startingColour);
flow.OfType<ColourButton>().Last().TriggerClick();
}
private void updateState()
{
background.Colour = colourProvider.Background5;