1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-20 05:19:55 +08:00
Files
osu-lazer/osu.Game/Screens/Select/ISongSelect.cs
T
Bartłomiej Dach 6b10ef8709 Disable presenting scores in online song selects (#36826)
RFC. Closes https://github.com/ppy/osu/issues/36815 I guess.

Song select V1 completely disabled the ability to view a score outside
of solo play in ways that are very easy to let fly under the radar:


https://github.com/ppy/osu/blob/5fc836d1f09cebf983313c9b91a5c252890c607a/osu.Game/Screens/Select/Leaderboards/BeatmapLeaderboard.cs#L26
https://github.com/ppy/osu/blob/46db3ad96d0e1cd6ba4176b9b474cb79a338965d/osu.Game/Screens/Select/PlaySongSelect.cs#L47-L53

therefore the issue this is trying to close would never even manifest
there.

The direct cause of the issue is that the results screen is pushed to
the relevant online screen's *substack* of screens rather than the
game-global parent stack. That means that when the back button is
pressed, the following logic fires:


https://github.com/ppy/osu/blob/6fa4a7152f144ed2524f20ecf7cfd26492bbe61d/osu.Game/Screens/OnlinePlay/OnlinePlayScreen.cs#L174-L189

This logic fires *on the parent screen* even though *the child screen*
is the one the user is attempting to back out of. And none of the
exemptions for the screen substack inside of the above method fire
because the subscreen is not an `IOnlinePlaySubScreen` (it's
`SoloResultsScreen` in this case).

Now the direct cause here is probably fixable, although possibly not
without some significant pulling of footer-shaped teeth. *However*, I
kind of question as to why viewing scores should be permitted on online
song selects in the first place - it kind of distracts from the primary
purpose of the screens which is to *just pick a map already*.
2026-03-06 00:19:10 +09:00

75 lines
2.7 KiB
C#

// 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.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Beatmaps;
using osu.Game.Graphics.UserInterface;
using osu.Game.Scoring;
namespace osu.Game.Screens.Select
{
/// <summary>
/// Actions exposed by song select which are used by subcomponents to perform top-level operations.
/// </summary>
[Cached]
public interface ISongSelect
{
/// <summary>
/// Requests the user for confirmation to delete the given beatmap set.
/// </summary>
void Delete(BeatmapSetInfo beatmapBeatmapSetInfo);
/// <summary>
/// Immediately restores any hidden beatmaps in the provided beatmap set.
/// </summary>
void RestoreAllHidden(BeatmapSetInfo beatmapSet);
/// <summary>
/// Opens the manage collections dialog.
/// </summary>
void ManageCollections();
/// <summary>
/// Whether <see cref="PresentScore"/> can be performed by this screen.
/// If <see langword="false"/>, <see cref="PresentScore"/> will have no effect.
/// </summary>
bool CanPresentScore { get; }
/// <summary>
/// Opens results screen with the given score.
/// This assumes active beatmap and ruleset selection matches the score.
/// </summary>
void PresentScore(ScoreInfo score, ScorePresentType presentType = ScorePresentType.Results);
/// <summary>
/// Set the current filter text query to the provided string.
/// </summary>
void Search(string query);
/// <summary>
/// Gets relevant actionable items for beatmap context menus, based on the type of song select.
/// </summary>
IEnumerable<OsuMenuItem> GetForwardActions(BeatmapInfo beatmap);
/// <summary>
/// Temporarily bypasses filters and shows all difficulties of the given beatmapset.
/// </summary>
/// <param name="beatmapSet">The beatmapset.</param>
void ScopeToBeatmapSet(BeatmapSetInfo beatmapSet);
/// <summary>
/// Removes the beatmapset scope and reverts the previously selected filters.
/// </summary>
void UnscopeBeatmapSet();
/// <summary>
/// Contains the currently scoped beatmapset. Used by external consumers for displaying its state.
/// Cannot be used to change the value, any changes must be done through <see cref="ScopeToBeatmapSet"/>
/// or <see cref="UnscopeBeatmapSet"/>.
/// </summary>
IBindable<BeatmapSetInfo?> ScopedBeatmapSet { get; }
}
}