2021-05-20 18:34:53 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2021-05-20 18:34:53 +08:00
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace osu.Game.Graphics.UserInterface
|
|
|
|
{
|
2021-05-20 19:09:22 +08:00
|
|
|
/// <summary>
|
|
|
|
/// A ternary state menu item which will always set the item to <c>true</c> on click, even if already <c>true</c>.
|
|
|
|
/// </summary>
|
2021-05-20 18:34:53 +08:00
|
|
|
public class TernaryStateRadioMenuItem : TernaryStateMenuItem
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Creates a new <see cref="TernaryStateMenuItem"/>.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="text">The text to display.</param>
|
|
|
|
/// <param name="type">The type of action which this <see cref="TernaryStateMenuItem"/> performs.</param>
|
|
|
|
/// <param name="action">A delegate to be invoked when this <see cref="TernaryStateMenuItem"/> is pressed.</param>
|
|
|
|
public TernaryStateRadioMenuItem(string text, MenuItemType type = MenuItemType.Standard, Action<TernaryState> action = null)
|
|
|
|
: base(text, getNextState, type, action)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
private static TernaryState getNextState(TernaryState state) => TernaryState.True;
|
|
|
|
}
|
|
|
|
}
|