// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osu.Framework.Graphics.Sprites; namespace osu.Game.Graphics.UserInterface { /// /// An with three possible states. /// public abstract class TernaryStateMenuItem : StatefulMenuItem { /// /// Creates a new . /// /// The text to display. /// A function to inform what the next state should be when this item is clicked. /// The type of action which this performs. /// A delegate to be invoked when this is pressed. protected TernaryStateMenuItem(string text, Func nextStateFunction, MenuItemType type = MenuItemType.Standard, Action action = null) : base(text, nextStateFunction, type, action) { } public override IconUsage? GetIconForState(TernaryState state) { switch (state) { case TernaryState.Indeterminate: return FontAwesome.Solid.DotCircle; case TernaryState.True: return FontAwesome.Solid.Check; } return null; } } }