2022-03-27 21:07:52 +00: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.
|
|
|
|
|
|
|
|
using System;
|
2022-05-04 20:17:40 +00:00
|
|
|
using osu.Game.Overlays;
|
2022-05-06 20:36:08 +00:00
|
|
|
using System.Collections.Generic;
|
2022-05-06 14:31:59 +00:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2022-03-27 21:07:52 +00:00
|
|
|
using osu.Game.Overlays.Mods;
|
|
|
|
using osu.Game.Rulesets.Mods;
|
|
|
|
using osuTK.Input;
|
2022-05-07 08:17:24 +00:00
|
|
|
using osu.Game.Localisation;
|
2022-03-27 21:07:52 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Screens.OnlinePlay
|
|
|
|
{
|
|
|
|
public class FreeModSelectScreen : ModSelectScreen
|
|
|
|
{
|
|
|
|
protected override bool ShowTotalMultiplier => false;
|
|
|
|
|
|
|
|
public new Func<Mod, bool> IsValidMod
|
|
|
|
{
|
|
|
|
get => base.IsValidMod;
|
2022-04-17 20:16:59 +00:00
|
|
|
set => base.IsValidMod = m => m.UserPlayable && value.Invoke(m);
|
2022-03-27 21:07:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public FreeModSelectScreen()
|
2022-05-04 20:17:40 +00:00
|
|
|
: base(OverlayColourScheme.Plum)
|
2022-03-27 21:07:52 +00:00
|
|
|
{
|
|
|
|
IsValidMod = _ => true;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override ModColumn CreateModColumn(ModType modType, Key[] toggleKeys = null) => new ModColumn(modType, true, toggleKeys);
|
2022-05-06 14:31:59 +00:00
|
|
|
|
2022-05-06 20:36:08 +00:00
|
|
|
protected override IEnumerable<ShearedButton> CreateFooterButtons() => new[]
|
2022-05-06 14:31:59 +00:00
|
|
|
{
|
2022-05-07 10:23:48 +00:00
|
|
|
new ShearedButton(BUTTON_WIDTH)
|
2022-05-06 14:31:59 +00:00
|
|
|
{
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
Origin = Anchor.BottomLeft,
|
2022-05-07 08:17:24 +00:00
|
|
|
Text = CommonStrings.SelectAll,
|
2022-05-06 14:31:59 +00:00
|
|
|
Action = SelectAll
|
|
|
|
},
|
2022-05-07 10:23:48 +00:00
|
|
|
new ShearedButton(BUTTON_WIDTH)
|
2022-05-06 14:31:59 +00:00
|
|
|
{
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
Origin = Anchor.BottomLeft,
|
2022-05-07 08:17:24 +00:00
|
|
|
Text = CommonStrings.DeselectAll,
|
2022-05-06 14:31:59 +00:00
|
|
|
Action = DeselectAll
|
|
|
|
}
|
|
|
|
};
|
2022-03-27 21:07:52 +00:00
|
|
|
}
|
|
|
|
}
|