mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 15:43:22 +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.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
|
using osu.Game.Extensions;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Resources.Localisation.Web;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
|
|
||||||
@ -28,7 +29,13 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
AddTabItem(new RulesetFilterTabItemAny());
|
AddTabItem(new RulesetFilterTabItemAny());
|
||||||
|
|
||||||
foreach (var r in rulesets.AvailableRulesets)
|
foreach (var r in rulesets.AvailableRulesets)
|
||||||
|
{
|
||||||
|
// Don't display non-legacy rulesets
|
||||||
|
if (!r.IsLegacyRuleset())
|
||||||
|
continue;
|
||||||
|
|
||||||
AddItem(r);
|
AddItem(r);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,9 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
public partial class OverlayRulesetSelector : RulesetSelector
|
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()
|
public OverlayRulesetSelector()
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
|
using osu.Game.Extensions;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets
|
namespace osu.Game.Rulesets
|
||||||
{
|
{
|
||||||
@ -16,11 +17,16 @@ namespace osu.Game.Rulesets
|
|||||||
|
|
||||||
protected override Dropdown<RulesetInfo> CreateDropdown() => null;
|
protected override Dropdown<RulesetInfo> CreateDropdown() => null;
|
||||||
|
|
||||||
|
protected virtual bool LegacyOnly => false;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
foreach (var ruleset in Rulesets.AvailableRulesets)
|
foreach (var ruleset in Rulesets.AvailableRulesets)
|
||||||
{
|
{
|
||||||
|
if (!ruleset.IsLegacyRuleset() && LegacyOnly)
|
||||||
|
continue;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
AddItem(ruleset);
|
AddItem(ruleset);
|
||||||
|
Loading…
Reference in New Issue
Block a user