1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-08 06:22:55 +08:00

Add tooltips explaining multiplayer mod selection buttons

This commit is contained in:
Dean Herbert 2025-01-21 18:35:56 +09:00
parent c68a0bc7e3
commit f88102610d
No known key found for this signature in database
6 changed files with 28 additions and 4 deletions

View File

@ -24,6 +24,21 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString StartMatchWithCountdown(string humanReadableTime) => new TranslatableString(getKey(@"start_match_width_countdown"), @"Start match in {0}", humanReadableTime);
/// <summary>
/// "Choose the mods which all players should play with."
/// </summary>
public static LocalisableString RequiredModsButtonTooltip => new TranslatableString(getKey(@"required_mods_button_tooltip"), @"Choose the mods which all players should play with.");
/// <summary>
/// "Each player can choose their preferred mods from a selected list."
/// </summary>
public static LocalisableString FreeModsButtonTooltip => new TranslatableString(getKey(@"free_mods_button_tooltip"), @"Each player can choose their preferred mods from a selected list.");
/// <summary>
/// "Each player can choose their preferred difficulty, ruleset and mods."
/// </summary>
public static LocalisableString FreestyleButtonTooltip => new TranslatableString(getKey(@"freestyle_button_tooltip"), @"Each player can choose their preferred difficulty, ruleset and mods.");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -18,6 +18,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Select;
using osuTK;
using osu.Game.Localisation;
namespace osu.Game.Screens.OnlinePlay
{
@ -95,6 +96,8 @@ namespace osu.Game.Screens.OnlinePlay
SelectedColour = colours.Yellow;
DeselectedColour = SelectedColour.Opacity(0.5f);
Text = @"freemods";
TooltipText = MultiplayerMatchStrings.FreeModsButtonTooltip;
}
protected override void LoadComplete()

View File

@ -12,6 +12,7 @@ using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics;
using osu.Game.Graphics.Sprites;
using osu.Game.Screens.Select;
using osu.Game.Localisation;
namespace osu.Game.Screens.OnlinePlay
{
@ -72,6 +73,8 @@ namespace osu.Game.Screens.OnlinePlay
SelectedColour = colours.Yellow;
DeselectedColour = SelectedColour.Opacity(0.5f);
Text = @"freestyle";
TooltipText = MultiplayerMatchStrings.FreestyleButtonTooltip;
}
protected override void LoadComplete()

View File

@ -21,6 +21,7 @@ using osu.Game.Rulesets.Mods;
using osu.Game.Screens.Select;
using osu.Game.Users;
using osu.Game.Utils;
using osu.Game.Localisation;
namespace osu.Game.Screens.OnlinePlay
{
@ -196,14 +197,16 @@ namespace osu.Game.Screens.OnlinePlay
IsValidMod = IsValidMod
};
protected override IEnumerable<(FooterButton, OverlayContainer?)> CreateSongSelectFooterButtons()
protected override IEnumerable<(FooterButton button, OverlayContainer? overlay)> CreateSongSelectFooterButtons()
{
var baseButtons = base.CreateSongSelectFooterButtons().ToList();
baseButtons.Single(i => i.button is FooterButtonMods).button.TooltipText = MultiplayerMatchStrings.RequiredModsButtonTooltip;
freeModsFooterButton = new FooterButtonFreeMods(freeModSelect) { Current = FreeMods };
var freeStyleButton = new FooterButtonFreeStyle { Current = FreeStyle };
baseButtons.InsertRange(baseButtons.FindIndex(b => b.Item1 is FooterButtonMods) + 1, new (FooterButton, OverlayContainer?)[]
baseButtons.InsertRange(baseButtons.FindIndex(b => b.button is FooterButtonMods) + 1, new (FooterButton, OverlayContainer?)[]
{
(freeModsFooterButton, null),
(freeStyleButton, null)

View File

@ -45,7 +45,7 @@ namespace osu.Game.Screens.OnlinePlay
protected override FilterControl CreateFilterControl() => new DifficultySelectFilterControl(item);
protected override IEnumerable<(FooterButton, OverlayContainer?)> CreateSongSelectFooterButtons()
protected override IEnumerable<(FooterButton button, OverlayContainer? overlay)> CreateSongSelectFooterButtons()
{
// Required to create the drawable components.
base.CreateSongSelectFooterButtons();

View File

@ -415,7 +415,7 @@ namespace osu.Game.Screens.Select
/// Creates the buttons to be displayed in the footer.
/// </summary>
/// <returns>A set of <see cref="FooterButton"/> and an optional <see cref="OverlayContainer"/> which the button opens when pressed.</returns>
protected virtual IEnumerable<(FooterButton, OverlayContainer?)> CreateSongSelectFooterButtons() => new (FooterButton, OverlayContainer?)[]
protected virtual IEnumerable<(FooterButton button, OverlayContainer? overlay)> CreateSongSelectFooterButtons() => new (FooterButton, OverlayContainer?)[]
{
(ModsFooterButton = new FooterButtonMods { Current = Mods }, ModSelect),
(new FooterButtonRandom