Rename radio button classes to be local to editor

This commit is contained in:
Dean Herbert 2021-07-19 16:57:12 +09:00
parent 50eed26bd1
commit bde35d9f21
5 changed files with 15 additions and 15 deletions

View File

@ -13,8 +13,8 @@ namespace osu.Game.Tests.Visual.Editing
{ {
public TestSceneEditorComposeRadioButtons() public TestSceneEditorComposeRadioButtons()
{ {
RadioButtonCollection collection; EditorRadioButtonCollection collection;
Add(collection = new RadioButtonCollection Add(collection = new EditorRadioButtonCollection
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,

View File

@ -72,10 +72,10 @@ namespace osu.Game.Tests.Visual.Editing
AddStep("clear all control points", () => editorBeatmap.ControlPointInfo.Clear()); AddStep("clear all control points", () => editorBeatmap.ControlPointInfo.Clear());
AddAssert("Tool is selection", () => hitObjectComposer.ChildrenOfType<ComposeBlueprintContainer>().First().CurrentTool is SelectTool); AddAssert("Tool is selection", () => hitObjectComposer.ChildrenOfType<ComposeBlueprintContainer>().First().CurrentTool is SelectTool);
AddAssert("Hitcircle button not clickable", () => !hitObjectComposer.ChildrenOfType<DrawableRadioButton>().First(d => d.Button.Label == "HitCircle").Enabled.Value); AddAssert("Hitcircle button not clickable", () => !hitObjectComposer.ChildrenOfType<EditorRadioButton>().First(d => d.Button.Label == "HitCircle").Enabled.Value);
AddStep("Add timing point", () => editorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint())); AddStep("Add timing point", () => editorBeatmap.ControlPointInfo.Add(0, new TimingControlPoint()));
AddAssert("Hitcircle button is clickable", () => hitObjectComposer.ChildrenOfType<DrawableRadioButton>().First(d => d.Button.Label == "HitCircle").Enabled.Value); AddAssert("Hitcircle button is clickable", () => hitObjectComposer.ChildrenOfType<EditorRadioButton>().First(d => d.Button.Label == "HitCircle").Enabled.Value);
AddStep("Change to hitcircle", () => hitObjectComposer.ChildrenOfType<DrawableRadioButton>().First(d => d.Button.Label == "HitCircle").Click()); AddStep("Change to hitcircle", () => hitObjectComposer.ChildrenOfType<EditorRadioButton>().First(d => d.Button.Label == "HitCircle").Click());
AddAssert("Tool changed", () => hitObjectComposer.ChildrenOfType<ComposeBlueprintContainer>().First().CurrentTool is HitCircleCompositionTool); AddAssert("Tool changed", () => hitObjectComposer.ChildrenOfType<ComposeBlueprintContainer>().First().CurrentTool is HitCircleCompositionTool);
} }

View File

@ -63,7 +63,7 @@ namespace osu.Game.Rulesets.Edit
private InputManager inputManager; private InputManager inputManager;
private RadioButtonCollection toolboxCollection; private EditorRadioButtonCollection toolboxCollection;
private FillFlowContainer togglesCollection; private FillFlowContainer togglesCollection;
@ -126,7 +126,7 @@ namespace osu.Game.Rulesets.Edit
{ {
new ToolboxGroup("toolbox (1-9)") new ToolboxGroup("toolbox (1-9)")
{ {
Child = toolboxCollection = new RadioButtonCollection { RelativeSizeAxes = Axes.X } Child = toolboxCollection = new EditorRadioButtonCollection { RelativeSizeAxes = Axes.X }
}, },
new ToolboxGroup("toggles (Q~P)") new ToolboxGroup("toggles (Q~P)")
{ {

View File

@ -18,10 +18,10 @@ using osuTK.Graphics;
namespace osu.Game.Screens.Edit.Components.RadioButtons namespace osu.Game.Screens.Edit.Components.RadioButtons
{ {
public class DrawableRadioButton : OsuButton, IHasTooltip public class EditorRadioButton : OsuButton, IHasTooltip
{ {
/// <summary> /// <summary>
/// Invoked when this <see cref="DrawableRadioButton"/> has been selected. /// Invoked when this <see cref="EditorRadioButton"/> has been selected.
/// </summary> /// </summary>
public Action<RadioButton> Selected; public Action<RadioButton> Selected;
@ -37,7 +37,7 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
[Resolved(canBeNull: true)] [Resolved(canBeNull: true)]
private EditorBeatmap editorBeatmap { get; set; } private EditorBeatmap editorBeatmap { get; set; }
public DrawableRadioButton(RadioButton button) public EditorRadioButton(RadioButton button)
{ {
Button = button; Button = button;

View File

@ -9,7 +9,7 @@ using osuTK;
namespace osu.Game.Screens.Edit.Components.RadioButtons namespace osu.Game.Screens.Edit.Components.RadioButtons
{ {
public class RadioButtonCollection : CompositeDrawable public class EditorRadioButtonCollection : CompositeDrawable
{ {
private IReadOnlyList<RadioButton> items; private IReadOnlyList<RadioButton> items;
@ -28,13 +28,13 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
} }
} }
private readonly FlowContainer<DrawableRadioButton> buttonContainer; private readonly FlowContainer<EditorRadioButton> buttonContainer;
public RadioButtonCollection() public EditorRadioButtonCollection()
{ {
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
InternalChild = buttonContainer = new FillFlowContainer<DrawableRadioButton> InternalChild = buttonContainer = new FillFlowContainer<EditorRadioButton>
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
@ -58,7 +58,7 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
currentlySelected = null; currentlySelected = null;
}; };
buttonContainer.Add(new DrawableRadioButton(button)); buttonContainer.Add(new EditorRadioButton(button));
} }
} }
} }