1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 05:02:56 +08:00

Merge branch 'master' into daily-challenge-intro-screen-part-2

This commit is contained in:
Dean Herbert 2024-08-08 14:12:16 +09:00
commit 7058fedf42
No known key found for this signature in database
4 changed files with 27 additions and 7 deletions

View File

@ -24,6 +24,11 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString MentionUser => new TranslatableString(getKey(@"mention_user"), @"Mention");
private static string getKey(string key) => $"{prefix}:{key}";
/// <summary>
/// "press enter to chat..."
/// </summary>
public static LocalisableString InGameInputPlaceholder => new TranslatableString(getKey(@"in_game_input_placeholder"), @"press enter to chat...");
private static string getKey(string key) => $@"{prefix}:{key}";
}
}

View File

@ -128,6 +128,9 @@ namespace osu.Game.Online.Chat
public partial class ChatTextBox : HistoryTextBox
{
public Action Focus;
public Action FocusLost;
protected override bool OnKeyDown(KeyDownEvent e)
{
// Chat text boxes are generally used in places where they retain focus, but shouldn't block interaction with other
@ -153,13 +156,17 @@ namespace osu.Game.Online.Chat
BackgroundFocused = new Color4(10, 10, 10, 255);
}
protected override void OnFocus(FocusEvent e)
{
base.OnFocus(e);
Focus?.Invoke();
}
protected override void OnFocusLost(FocusLostEvent e)
{
base.OnFocusLost(e);
FocusLost?.Invoke();
}
public Action FocusLost;
}
public partial class StandAloneDrawableChannel : DrawableChannel

View File

@ -76,6 +76,9 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
[Cached]
private readonly OnlinePlayBeatmapAvailabilityTracker beatmapAvailabilityTracker = new OnlinePlayBeatmapAvailabilityTracker();
[Resolved]
private OsuGame? game { get; set; }
[Resolved]
private BeatmapManager beatmapManager { get; set; } = null!;
@ -547,9 +550,6 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
metadataClient.MultiplayerRoomScoreSet -= onRoomScoreSet;
}
[Resolved]
private OsuGame? game { get; set; }
public void PresentBeatmap(WorkingBeatmap beatmap, RulesetInfo ruleset)
{
if (!this.IsCurrentScreen())
@ -559,6 +559,7 @@ namespace osu.Game.Screens.OnlinePlay.DailyChallenge
// If the import was for a different beatmap, pass the duty off to global handling.
if (beatmap.BeatmapSetInfo.OnlineID != playlistItem.Beatmap.BeatmapSet!.OnlineID)
{
this.Exit();
game?.PresentBeatmap(beatmap.BeatmapSetInfo, b => b.ID == beatmap.BeatmapInfo.ID);
}

View File

@ -10,6 +10,7 @@ using osu.Framework.Graphics;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Game.Input.Bindings;
using osu.Game.Localisation;
using osu.Game.Online.Rooms;
using osu.Game.Screens.OnlinePlay.Match.Components;
using osu.Game.Screens.Play;
@ -41,7 +42,13 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
Background.Alpha = 0.2f;
TextBox.FocusLost = () => expandedFromTextBoxFocus.Value = false;
TextBox.PlaceholderText = ChatStrings.InGameInputPlaceholder;
TextBox.Focus = () => TextBox.PlaceholderText = Resources.Localisation.Web.ChatStrings.InputPlaceholder;
TextBox.FocusLost = () =>
{
TextBox.PlaceholderText = ChatStrings.InGameInputPlaceholder;
expandedFromTextBoxFocus.Value = false;
};
}
protected override bool OnHover(HoverEvent e) => true; // use UI mouse cursor.