-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "enter" hint to in-gameplay chatbox placeholder text #29281
Conversation
I'm not sure about:
Regarding the second from the above, I experimented with something like this: diff --git a/osu.Game/Online/Chat/StandAloneChatDisplay.cs b/osu.Game/Online/Chat/StandAloneChatDisplay.cs
index 3a094cc074..e100b5fe5b 100644
--- a/osu.Game/Online/Chat/StandAloneChatDisplay.cs
+++ b/osu.Game/Online/Chat/StandAloneChatDisplay.cs
@@ -128,6 +128,9 @@ private void channelChanged(ValueChangedEvent<Channel> e)
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 @@ protected override void LoadComplete()
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
diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/GameplayChatDisplay.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/GameplayChatDisplay.cs
index 656071ad43..d1a73457e3 100644
--- a/osu.Game/Screens/OnlinePlay/Multiplayer/GameplayChatDisplay.cs
+++ b/osu.Game/Screens/OnlinePlay/Multiplayer/GameplayChatDisplay.cs
@@ -42,8 +42,13 @@ public GameplayChatDisplay(Room room)
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. Screen.Recording.2024-08-05.at.12.37.08.movBut I'm still not too sure about it. Need a secondary opinion. |
"press enter to chat..." could work better as a shorter placeholder. |
"press enter to chat..." is definitely better, I will change that now
That implementation makes sense, agreed. |
@kstefanowicz are you going to apply the proposed change to the placeholder text when focused? |
Placeholder text hover change has been applied. Thank you for your patience. |
I don't know how to get to a multiplayer game in a debug build, so I was not able to confirm if this works.