1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-22 17:07:40 +08:00

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()
{
RadioButtonCollection collection;
Add(collection = new RadioButtonCollection
EditorRadioButtonCollection collection;
Add(collection = new EditorRadioButtonCollection
{
Anchor = 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());
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()));
AddAssert("Hitcircle button is clickable", () => hitObjectComposer.ChildrenOfType<DrawableRadioButton>().First(d => d.Button.Label == "HitCircle").Enabled.Value);
AddStep("Change to hitcircle", () => hitObjectComposer.ChildrenOfType<DrawableRadioButton>().First(d => d.Button.Label == "HitCircle").Click());
AddAssert("Hitcircle button is clickable", () => hitObjectComposer.ChildrenOfType<EditorRadioButton>().First(d => d.Button.Label == "HitCircle").Enabled.Value);
AddStep("Change to hitcircle", () => hitObjectComposer.ChildrenOfType<EditorRadioButton>().First(d => d.Button.Label == "HitCircle").Click());
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 RadioButtonCollection toolboxCollection;
private EditorRadioButtonCollection toolboxCollection;
private FillFlowContainer togglesCollection;
@ -126,7 +126,7 @@ namespace osu.Game.Rulesets.Edit
{
new ToolboxGroup("toolbox (1-9)")
{
Child = toolboxCollection = new RadioButtonCollection { RelativeSizeAxes = Axes.X }
Child = toolboxCollection = new EditorRadioButtonCollection { RelativeSizeAxes = Axes.X }
},
new ToolboxGroup("toggles (Q~P)")
{

View File

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

View File

@ -9,7 +9,7 @@ using osuTK;
namespace osu.Game.Screens.Edit.Components.RadioButtons
{
public class RadioButtonCollection : CompositeDrawable
public class EditorRadioButtonCollection : CompositeDrawable
{
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;
InternalChild = buttonContainer = new FillFlowContainer<DrawableRadioButton>
InternalChild = buttonContainer = new FillFlowContainer<EditorRadioButton>
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
@ -58,7 +58,7 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
currentlySelected = null;
};
buttonContainer.Add(new DrawableRadioButton(button));
buttonContainer.Add(new EditorRadioButton(button));
}
}
}