Use different chatbox placeholder when dependent keys unbound (#22747)
This commit is contained in:
@@ -33,7 +33,7 @@ public class ChatInputBox : PanelContainer
|
||||
Input = new HistoryLineEdit
|
||||
{
|
||||
Name = "Input",
|
||||
PlaceHolder = Loc.GetString("hud-chatbox-info", ("talk-key", BoundKeyHelper.ShortKeyName(ContentKeyFunctions.FocusChat)), ("cycle-key", BoundKeyHelper.ShortKeyName(ContentKeyFunctions.CycleChatChannelForward))),
|
||||
PlaceHolder = GetChatboxInfoPlaceholder(),
|
||||
HorizontalExpand = true,
|
||||
StyleClasses = {"chatLineEdit"}
|
||||
};
|
||||
@@ -51,4 +51,15 @@ public class ChatInputBox : PanelContainer
|
||||
{
|
||||
ActiveChannel = (ChatChannel) selectedChannel;
|
||||
}
|
||||
|
||||
private static string GetChatboxInfoPlaceholder()
|
||||
{
|
||||
return (BoundKeyHelper.IsBound(ContentKeyFunctions.FocusChat), BoundKeyHelper.IsBound(ContentKeyFunctions.CycleChatChannelForward)) switch
|
||||
{
|
||||
(true, true) => Loc.GetString("hud-chatbox-info", ("talk-key", BoundKeyHelper.ShortKeyName(ContentKeyFunctions.FocusChat)), ("cycle-key", BoundKeyHelper.ShortKeyName(ContentKeyFunctions.CycleChatChannelForward))),
|
||||
(true, false) => Loc.GetString("hud-chatbox-info-talk", ("talk-key", BoundKeyHelper.ShortKeyName(ContentKeyFunctions.FocusChat))),
|
||||
(false, true) => Loc.GetString("hud-chatbox-info-cycle", ("cycle-key", BoundKeyHelper.ShortKeyName(ContentKeyFunctions.CycleChatChannelForward))),
|
||||
(false, false) => Loc.GetString("hud-chatbox-info-unbound")
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user