// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Bindables; using osu.Game.Rulesets.Mods; namespace osu.Game.Overlays.Mods { /// /// Wrapper class used to store the current state of a mod shown on the . /// Used primarily to decouple data from drawable logic. /// public class ModState { /// /// The mod that whose state this instance describes. /// public Mod Mod { get; } /// /// Whether the mod is currently selected. /// public BindableBool Active { get; } = new BindableBool(); public BindableBool Preselected { get; } = new BindableBool(); /// /// Whether the mod requires further customisation. /// This flag is read by the to determine if the customisation panel should be opened after a mod change /// and cleared after reading. /// public bool PendingConfiguration { get; set; } /// /// Whether the mod is currently valid for selection. /// This can be in scenarios such as the free mod select overlay, where not all mods are selectable /// regardless of search criteria imposed by the user selecting. /// public BindableBool ValidForSelection { get; } = new BindableBool(true); /// /// Whether the mod is matching the current textual filter. /// public BindableBool MatchingTextFilter { get; } = new BindableBool(true); /// /// Whether the matches all applicable filters and visible for the user to select. /// public bool Visible => MatchingTextFilter.Value && ValidForSelection.Value; public ModState(Mod mod) { Mod = mod; } } }