1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-03 03:20:16 +08:00

Use actual keybind in multiplayer chat hint

This commit is contained in:
sineplusx
2025-04-07 21:14:42 +02:00
Unverified
parent 10abd55a15
commit 965f16ef8a
2 changed files with 9 additions and 5 deletions
+2 -2
View File
@@ -25,9 +25,9 @@ namespace osu.Game.Localisation
public static LocalisableString MentionUser => new TranslatableString(getKey(@"mention_user"), @"Mention");
/// <summary>
/// "press enter to chat..."
/// "press {0} to chat..."
/// </summary>
public static LocalisableString InGameInputPlaceholder => new TranslatableString(getKey(@"in_game_input_placeholder"), @"press enter to chat...");
public static LocalisableString InGameInputPlaceholder(LocalisableString keyBind) => new TranslatableString(getKey(@"in_game_input_placeholder"), @"press {0} to chat...", keyBind);
private static string getKey(string key) => $@"{prefix}:{key}";
}
@@ -6,6 +6,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Input.Bindings;
using osu.Framework.Input.Events;
using osu.Game.Configuration;
using osu.Game.Input.Bindings;
using osu.Game.Localisation;
using osu.Game.Online.Rooms;
@@ -37,14 +38,17 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
: base(room, leaveChannelOnDispose: false)
{
RelativeSizeAxes = Axes.X;
Background.Alpha = 0.2f;
}
TextBox.PlaceholderText = ChatStrings.InGameInputPlaceholder;
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
TextBox.PlaceholderText = ChatStrings.InGameInputPlaceholder(config.LookupKeyBindings(GlobalAction.ToggleChatFocus));
TextBox.Focus = () => TextBox.PlaceholderText = Resources.Localisation.Web.ChatStrings.InputPlaceholder;
TextBox.FocusLost = () =>
{
TextBox.PlaceholderText = ChatStrings.InGameInputPlaceholder;
TextBox.PlaceholderText = ChatStrings.InGameInputPlaceholder(config.LookupKeyBindings(GlobalAction.ToggleChatFocus));
expandedFromTextBoxFocus.Value = false;
};
}