Add local-user freemod configuration

This commit is contained in:
smoogipoo
2021-02-10 19:56:59 +09:00
parent 7827e991b2
commit 822c66033f
4 changed files with 29 additions and 8 deletions

View File

@ -51,6 +51,11 @@ namespace osu.Game.Overlays.Mods
/// </summary>
protected virtual bool Stacked => true;
/// <summary>
/// Whether configurable <see cref="Mod"/>s can be configured by the local user.
/// </summary>
protected virtual bool AllowConfiguration => true;
[NotNull]
private Func<Mod, bool> isValidMod = m => true;
@ -300,6 +305,7 @@ namespace osu.Game.Overlays.Mods
Text = "Customisation",
Action = () => ModSettingsContainer.ToggleVisibility(),
Enabled = { Value = false },
Alpha = AllowConfiguration ? 1 : 0,
Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft,
},
@ -509,7 +515,8 @@ namespace osu.Game.Overlays.Mods
OnModSelected(selectedMod);
if (selectedMod.RequiresConfiguration) ModSettingsContainer.Show();
if (selectedMod.RequiresConfiguration && AllowConfiguration)
ModSettingsContainer.Show();
}
else
{