Move select tool to an actual tool implementation

Also tidies up radio button action firing so calling Select actually fires the associated action in all cases.
This commit is contained in:
Dean Herbert
2020-01-28 15:00:45 +09:00
parent 01cf417569
commit e81d3c51ed
5 changed files with 44 additions and 37 deletions

View File

@ -9,7 +9,6 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface;
@ -37,8 +36,8 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
{
this.button = button;
Text = button.Text;
Action = button.Action;
Text = button.Item.ToString();
Action = button.Select;
RelativeSizeAxes = Axes.X;
@ -100,19 +99,6 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
bubble.Colour = button.Selected.Value ? selectedBubbleColour : defaultBubbleColour;
}
protected override bool OnClick(ClickEvent e)
{
if (button.Selected.Value)
return true;
if (!Enabled.Value)
return true;
button.Selected.Value = true;
return base.OnClick(e);
}
protected override SpriteText CreateText() => new OsuSpriteText
{
Depth = -1,