From 965f16ef8a4485ec366980a9ef97c0caf70a688a Mon Sep 17 00:00:00 2001 From: sineplusx <112003827+sineplusx@users.noreply.github.com> Date: Mon, 7 Apr 2025 21:14:42 +0200 Subject: [PATCH] Use actual keybind in multiplayer chat hint --- osu.Game/Localisation/ChatStrings.cs | 4 ++-- .../OnlinePlay/Multiplayer/GameplayChatDisplay.cs | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/osu.Game/Localisation/ChatStrings.cs b/osu.Game/Localisation/ChatStrings.cs index 6841e7d938..b14cfd6729 100644 --- a/osu.Game/Localisation/ChatStrings.cs +++ b/osu.Game/Localisation/ChatStrings.cs @@ -25,9 +25,9 @@ namespace osu.Game.Localisation public static LocalisableString MentionUser => new TranslatableString(getKey(@"mention_user"), @"Mention"); /// - /// "press enter to chat..." + /// "press {0} to chat..." /// - 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}"; } diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/GameplayChatDisplay.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/GameplayChatDisplay.cs index befaf115ae..83c94ab534 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/GameplayChatDisplay.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/GameplayChatDisplay.cs @@ -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; }; }