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:
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user