mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 14:17:26 +08:00
Roughly update design of editor buttons
This commit is contained in:
parent
4d99c7002b
commit
15f9697c9f
@ -8,13 +8,12 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Cursor;
|
||||
using osu.Framework.Graphics.Effects;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Localisation;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Overlays;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -30,9 +29,9 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
|
||||
public readonly RadioButton Button;
|
||||
|
||||
private Color4 defaultBackgroundColour;
|
||||
private Color4 defaultBubbleColour;
|
||||
private Color4 defaultIconColour;
|
||||
private Color4 selectedBackgroundColour;
|
||||
private Color4 selectedBubbleColour;
|
||||
private Color4 selectedIconColour;
|
||||
|
||||
private Drawable icon;
|
||||
|
||||
@ -50,20 +49,13 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
defaultBackgroundColour = colours.Gray3;
|
||||
defaultBubbleColour = defaultBackgroundColour.Darken(0.5f);
|
||||
selectedBackgroundColour = colours.BlueDark;
|
||||
selectedBubbleColour = selectedBackgroundColour.Lighten(0.5f);
|
||||
defaultBackgroundColour = colourProvider.Background3;
|
||||
selectedBackgroundColour = colourProvider.Background1;
|
||||
|
||||
Content.EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Radius = 2,
|
||||
Offset = new Vector2(0, 1),
|
||||
Colour = Color4.Black.Opacity(0.5f)
|
||||
};
|
||||
defaultIconColour = defaultBackgroundColour.Darken(0.5f);
|
||||
selectedIconColour = selectedBackgroundColour.Lighten(0.5f);
|
||||
|
||||
Add(icon = (Button.CreateIcon?.Invoke() ?? new Circle()).With(b =>
|
||||
{
|
||||
@ -98,7 +90,7 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
|
||||
return;
|
||||
|
||||
BackgroundColour = Button.Selected.Value ? selectedBackgroundColour : defaultBackgroundColour;
|
||||
icon.Colour = Button.Selected.Value ? selectedBubbleColour : defaultBubbleColour;
|
||||
icon.Colour = Button.Selected.Value ? selectedIconColour : defaultIconColour;
|
||||
}
|
||||
|
||||
protected override SpriteText CreateText() => new OsuSpriteText
|
||||
|
@ -6,12 +6,11 @@
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Extensions.Color4Extensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Effects;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Overlays;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -20,9 +19,9 @@ namespace osu.Game.Screens.Edit.Components.TernaryButtons
|
||||
internal class DrawableTernaryButton : OsuButton
|
||||
{
|
||||
private Color4 defaultBackgroundColour;
|
||||
private Color4 defaultBubbleColour;
|
||||
private Color4 defaultIconColour;
|
||||
private Color4 selectedBackgroundColour;
|
||||
private Color4 selectedBubbleColour;
|
||||
private Color4 selectedIconColour;
|
||||
|
||||
private Drawable icon;
|
||||
|
||||
@ -38,20 +37,13 @@ namespace osu.Game.Screens.Edit.Components.TernaryButtons
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
defaultBackgroundColour = colours.Gray3;
|
||||
defaultBubbleColour = defaultBackgroundColour.Darken(0.5f);
|
||||
selectedBackgroundColour = colours.BlueDark;
|
||||
selectedBubbleColour = selectedBackgroundColour.Lighten(0.5f);
|
||||
defaultBackgroundColour = colourProvider.Background3;
|
||||
selectedBackgroundColour = colourProvider.Background1;
|
||||
|
||||
Content.EdgeEffect = new EdgeEffectParameters
|
||||
{
|
||||
Type = EdgeEffectType.Shadow,
|
||||
Radius = 2,
|
||||
Offset = new Vector2(0, 1),
|
||||
Colour = Color4.Black.Opacity(0.5f)
|
||||
};
|
||||
defaultIconColour = defaultBackgroundColour.Darken(0.5f);
|
||||
selectedIconColour = selectedBackgroundColour.Lighten(0.5f);
|
||||
|
||||
Add(icon = (Button.CreateIcon?.Invoke() ?? new Circle()).With(b =>
|
||||
{
|
||||
@ -85,17 +77,17 @@ namespace osu.Game.Screens.Edit.Components.TernaryButtons
|
||||
switch (Button.Bindable.Value)
|
||||
{
|
||||
case TernaryState.Indeterminate:
|
||||
icon.Colour = selectedBubbleColour.Darken(0.5f);
|
||||
icon.Colour = selectedIconColour.Darken(0.5f);
|
||||
BackgroundColour = selectedBackgroundColour.Darken(0.5f);
|
||||
break;
|
||||
|
||||
case TernaryState.False:
|
||||
icon.Colour = defaultBubbleColour;
|
||||
icon.Colour = defaultIconColour;
|
||||
BackgroundColour = defaultBackgroundColour;
|
||||
break;
|
||||
|
||||
case TernaryState.True:
|
||||
icon.Colour = selectedBubbleColour;
|
||||
icon.Colour = selectedIconColour;
|
||||
BackgroundColour = selectedBackgroundColour;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user