mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 14:57:52 +08:00
Merge pull request #22160 from EVAST9919/ruleset-selector-online
Don't display custom rulesets in online overlays
This commit is contained in:
commit
55f1c7c49d
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user