1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Merge pull request #22160 from EVAST9919/ruleset-selector-online

Don't display custom rulesets in online overlays
This commit is contained in:
Dean Herbert 2023-01-13 12:16:42 +09:00 committed by GitHub
commit 55f1c7c49d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View File

@ -6,6 +6,7 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Localisation;
using osu.Game.Extensions;
using osu.Game.Resources.Localisation.Web;
using osu.Game.Rulesets;
@ -28,7 +29,13 @@ namespace osu.Game.Overlays.BeatmapListing
AddTabItem(new RulesetFilterTabItemAny());
foreach (var r in rulesets.AvailableRulesets)
{
// Don't display non-legacy rulesets
if (!r.IsLegacyRuleset())
continue;
AddItem(r);
}
}
}

View File

@ -13,6 +13,9 @@ namespace osu.Game.Overlays
{
public partial class OverlayRulesetSelector : RulesetSelector
{
// Since this component is used in online overlays and currently web-side doesn't support non-legacy rulesets, let's disable them for now.
protected override bool LegacyOnly => true;
public OverlayRulesetSelector()
{
AutoSizeAxes = Axes.Both;

View File

@ -6,6 +6,7 @@
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Allocation;
using osu.Framework.Logging;
using osu.Game.Extensions;
namespace osu.Game.Rulesets
{
@ -16,11 +17,16 @@ namespace osu.Game.Rulesets
protected override Dropdown<RulesetInfo> CreateDropdown() => null;
protected virtual bool LegacyOnly => false;
[BackgroundDependencyLoader]
private void load()
{
foreach (var ruleset in Rulesets.AvailableRulesets)
{
if (!ruleset.IsLegacyRuleset() && LegacyOnly)
continue;
try
{
AddItem(ruleset);