Rename radio button item to label

This commit is contained in:
Dean Herbert
2021-07-17 02:30:49 +09:00
parent eac9b1ec7e
commit 50eed26bd1
3 changed files with 8 additions and 8 deletions

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.Item == "HitCircle").Enabled.Value); AddAssert("Hitcircle button not clickable", () => !hitObjectComposer.ChildrenOfType<DrawableRadioButton>().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.Item == "HitCircle").Enabled.Value); 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.Item == "HitCircle").Click()); AddStep("Change to hitcircle", () => hitObjectComposer.ChildrenOfType<DrawableRadioButton>().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

@ -39,9 +39,9 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
public DrawableRadioButton(RadioButton button) public DrawableRadioButton(RadioButton button)
{ {
this.Button = button; Button = button;
Text = button.Item.ToString(); Text = button.Label;
Action = button.Select; Action = button.Select;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;

View File

@ -17,7 +17,7 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
/// <summary> /// <summary>
/// The item related to this button. /// The item related to this button.
/// </summary> /// </summary>
public string Item; public string Label;
/// <summary> /// <summary>
/// A function which creates a drawable icon to represent this item. If null, a sane default should be used. /// A function which creates a drawable icon to represent this item. If null, a sane default should be used.
@ -26,9 +26,9 @@ namespace osu.Game.Screens.Edit.Components.RadioButtons
private readonly Action action; private readonly Action action;
public RadioButton(string item, Action action, Func<Drawable> createIcon = null) public RadioButton(string label, Action action, Func<Drawable> createIcon = null)
{ {
Item = item; Label = label;
CreateIcon = createIcon; CreateIcon = createIcon;
this.action = action; this.action = action;
Selected = new BindableBool(); Selected = new BindableBool();