mirror of
https://github.com/ppy/osu.git
synced 2026-05-18 06:29:52 +08:00
Add constructors to RadioButton
This commit is contained in:
@@ -22,11 +22,11 @@ namespace osu.Game.Tests.Visual
|
||||
Width = 150,
|
||||
Items = new[]
|
||||
{
|
||||
new RadioButton { Text = "Item 1", Action = () => { } },
|
||||
new RadioButton { Text = "Item 2", Action = () => { } },
|
||||
new RadioButton { Text = "Item 3", Action = () => { } },
|
||||
new RadioButton { Text = "Item 4", Action = () => { } },
|
||||
new RadioButton { Text = "Item 5", Action = () => { } }
|
||||
new RadioButton("Item 1", () => { }),
|
||||
new RadioButton("Item 2", () => { }),
|
||||
new RadioButton("Item 3", () => { }),
|
||||
new RadioButton("Item 4", () => { }),
|
||||
new RadioButton("Item 5", () => { })
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Screens.Compose.RadioButtons
|
||||
{
|
||||
public class RadioButton
|
||||
public struct RadioButton
|
||||
{
|
||||
/// <summary>
|
||||
/// The text that should be displayed in this button.
|
||||
@@ -16,5 +16,17 @@ namespace osu.Game.Screens.Edit.Screens.Compose.RadioButtons
|
||||
/// The <see cref="Action"/> that should be invoked when this button is selected.
|
||||
/// </summary>
|
||||
public Action Action;
|
||||
|
||||
public RadioButton(string text)
|
||||
{
|
||||
Text = text;
|
||||
Action = null;
|
||||
}
|
||||
|
||||
public RadioButton(string text, Action action)
|
||||
{
|
||||
Text = text;
|
||||
Action = action;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user