1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 14:12:55 +08:00

Disable customisation of freemods, move stacking to property

This commit is contained in:
smoogipoo 2021-02-01 18:11:20 +09:00
parent 3cd30d284e
commit 3e74f8fd9e
3 changed files with 21 additions and 22 deletions

View File

@ -39,6 +39,16 @@ namespace osu.Game.Overlays.Mods
protected readonly OsuSpriteText MultiplierLabel;
/// <summary>
/// Whether to allow customisation of mod settings.
/// </summary>
protected virtual bool AllowCustomisation => true;
/// <summary>
/// Whether mod icons should be stacked, or appear as individual buttons.
/// </summary>
protected virtual bool Stacked => true;
protected override bool BlockNonPositionalInput => false;
protected override bool DimMainContent => false;
@ -47,21 +57,6 @@ namespace osu.Game.Overlays.Mods
protected readonly ModSettingsContainer ModSettingsContainer;
private bool stacked = true;
/// <summary>
/// Whether mod icons should be stacked, or appear as individual buttons.
/// </summary>
public bool Stacked
{
get => stacked;
set
{
stacked = value;
updateAvailableMods();
}
}
[NotNull]
private Func<Mod, bool> isValidMod = m => true;
@ -307,6 +302,7 @@ namespace osu.Game.Overlays.Mods
CustomiseButton = new TriangleButton
{
Width = 180,
Alpha = AllowCustomisation ? 1 : 0,
Text = "Customisation",
Action = () => ModSettingsContainer.ToggleVisibility(),
Enabled = { Value = false },
@ -445,7 +441,7 @@ namespace osu.Game.Overlays.Mods
{
IEnumerable<Mod> modEnumeration = availableMods.Value[section.ModType];
if (!stacked)
if (!Stacked)
modEnumeration = ModValidation.FlattenMods(modEnumeration);
section.Mods = modEnumeration.Where(IsValidMod);

View File

@ -14,10 +14,9 @@ namespace osu.Game.Screens.OnlinePlay.Match
{
public class FreeModSelectOverlay : ModSelectOverlay
{
public FreeModSelectOverlay()
{
Stacked = false;
}
protected override bool AllowCustomisation => false;
protected override bool Stacked => false;
protected override ModSection CreateModSection(ModType type) => new FreeModSection(type);

View File

@ -210,10 +210,9 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
new Dimension(GridSizeMode.AutoSize),
}
},
userModsSelectOverlay = new SoloModSelectOverlay
userModsSelectOverlay = new UserModSelectOverlay
{
SelectedMods = { BindTarget = UserMods },
Stacked = false,
IsValidMod = _ => false
},
settingsOverlay = new MultiplayerMatchSettingsOverlay
@ -352,5 +351,10 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
if (client != null)
client.LoadRequested -= onLoadRequested;
}
private class UserModSelectOverlay : SoloModSelectOverlay
{
protected override bool Stacked => false;
}
}
}