mirror of
https://github.com/osukey/osukey.git
synced 2025-06-29 23:28:00 +09:00
Add constructors to RadioButton
This commit is contained in:
parent
ead7456978
commit
73e41f9dde
@ -22,11 +22,11 @@ namespace osu.Game.Tests.Visual
|
|||||||
Width = 150,
|
Width = 150,
|
||||||
Items = new[]
|
Items = new[]
|
||||||
{
|
{
|
||||||
new RadioButton { Text = "Item 1", Action = () => { } },
|
new RadioButton("Item 1", () => { }),
|
||||||
new RadioButton { Text = "Item 2", Action = () => { } },
|
new RadioButton("Item 2", () => { }),
|
||||||
new RadioButton { Text = "Item 3", Action = () => { } },
|
new RadioButton("Item 3", () => { }),
|
||||||
new RadioButton { Text = "Item 4", Action = () => { } },
|
new RadioButton("Item 4", () => { }),
|
||||||
new RadioButton { Text = "Item 5", Action = () => { } }
|
new RadioButton("Item 5", () => { })
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ using System;
|
|||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Screens.Compose.RadioButtons
|
namespace osu.Game.Screens.Edit.Screens.Compose.RadioButtons
|
||||||
{
|
{
|
||||||
public class RadioButton
|
public struct RadioButton
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The text that should be displayed in this button.
|
/// 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.
|
/// The <see cref="Action"/> that should be invoked when this button is selected.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Action Action;
|
public Action Action;
|
||||||
|
|
||||||
|
public RadioButton(string text)
|
||||||
|
{
|
||||||
|
Text = text;
|
||||||
|
Action = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public RadioButton(string text, Action action)
|
||||||
|
{
|
||||||
|
Text = text;
|
||||||
|
Action = action;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user