1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 07:43:00 +08:00

Adapt changes to fit master

This commit is contained in:
Robin Oger 2023-05-27 12:29:14 +02:00
parent d5bfbe2b89
commit a01577cba5
4 changed files with 14 additions and 19 deletions

View File

@ -34,16 +34,6 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString PausedHeader => new TranslatableString(getKey(@"paused_header"), @"paused");
/// <summary>
/// "You're dead, try again?"
/// </summary>
public static LocalisableString FailedDescription => new TranslatableString(getKey(@"failed_description"), @"You're dead, try again?");
/// <summary>
/// "You're not going to do what i think you're going to do, are ya?"
/// </summary>
public static LocalisableString PausedDescription => new TranslatableString(getKey(@"paused_description"), @"You're not going to do what i think you're going to do, are ya?");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -15,6 +15,8 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Localisation;
using osu.Game.Localisation;
namespace osu.Game.Screens.Play
{
@ -22,13 +24,13 @@ namespace osu.Game.Screens.Play
{
public Func<Task<ScoreInfo>> SaveReplay;
public override string Header => "failed";
public override LocalisableString Header => GameplayMenuOverlayStrings.FailedHeader;
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
AddButton("Retry", colours.YellowDark, () => OnRetry?.Invoke());
AddButton("Quit", new Color4(170, 27, 39, 255), () => OnQuit?.Invoke());
AddButton(GameplayMenuOverlayStrings.Retry, colours.YellowDark, () => OnRetry?.Invoke());
AddButton(GameplayMenuOverlayStrings.Quit, new Color4(170, 27, 39, 255), () => OnQuit?.Invoke());
// from #10339 maybe this is a better visual effect
Add(new Container
{

View File

@ -12,6 +12,7 @@ using osu.Framework.Graphics.Effects;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
@ -49,7 +50,7 @@ namespace osu.Game.Screens.Play
/// </summary>
protected virtual Action SelectAction => () => InternalButtons.Selected?.TriggerClick();
public abstract string Header { get; }
public abstract LocalisableString Header { get; }
protected SelectionCycleFillFlowContainer<DialogButton> InternalButtons = null!;
public IReadOnlyList<DialogButton> Buttons => InternalButtons;
@ -153,7 +154,7 @@ namespace osu.Game.Screens.Play
protected override bool OnMouseMove(MouseMoveEvent e) => true;
protected void AddButton(string text, Color4 colour, Action? action)
protected void AddButton(LocalisableString text, Color4 colour, Action? action)
{
var button = new Button
{

View File

@ -9,9 +9,11 @@ using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Graphics;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Game.Audio;
using osu.Game.Graphics;
using osu.Game.Input.Bindings;
using osu.Game.Localisation;
using osu.Game.Skinning;
using osuTK.Graphics;
@ -23,7 +25,7 @@ namespace osu.Game.Screens.Play
public override bool IsPresent => base.IsPresent || pauseLoop.IsPlaying;
public override string Header => "paused";
public override LocalisableString Header => "paused";
private SkinnableSound pauseLoop;
@ -32,9 +34,9 @@ namespace osu.Game.Screens.Play
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
AddButton("Continue", colours.Green, () => OnResume?.Invoke());
AddButton("Retry", colours.YellowDark, () => OnRetry?.Invoke());
AddButton("Quit", new Color4(170, 27, 39, 255), () => OnQuit?.Invoke());
AddButton(GameplayMenuOverlayStrings.Continue, colours.Green, () => OnResume?.Invoke());
AddButton(GameplayMenuOverlayStrings.Retry, colours.YellowDark, () => OnRetry?.Invoke());
AddButton(GameplayMenuOverlayStrings.Quit, new Color4(170, 27, 39, 255), () => OnQuit?.Invoke());
AddInternal(pauseLoop = new SkinnableSound(new SampleInfo("Gameplay/pause-loop"))
{