mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 18:27:26 +08:00
Don't wrap "chatting in.." text in ChatTextBar
This commit is contained in:
parent
e6f1ac6bec
commit
1473762e25
@ -11,7 +11,8 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.Chat;
|
||||
using osuTK;
|
||||
|
||||
@ -28,7 +29,8 @@ namespace osu.Game.Overlays.Chat
|
||||
[Resolved]
|
||||
private Bindable<Channel> currentChannel { get; set; } = null!;
|
||||
|
||||
private OsuTextFlowContainer chattingTextContainer = null!;
|
||||
private Container chattingTextContainer = null!;
|
||||
private OsuSpriteText chattingText = null!;
|
||||
private Container searchIconContainer = null!;
|
||||
private ChatTextBox chatTextBox = null!;
|
||||
|
||||
@ -61,16 +63,19 @@ namespace osu.Game.Overlays.Chat
|
||||
{
|
||||
new Drawable[]
|
||||
{
|
||||
chattingTextContainer = new OsuTextFlowContainer(t => t.Font = t.Font.With(size: 20))
|
||||
chattingTextContainer = new Container
|
||||
{
|
||||
Masking = true,
|
||||
Width = chatting_text_width,
|
||||
Padding = new MarginPadding { Left = 10 },
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
TextAnchor = Anchor.CentreRight,
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft,
|
||||
Colour = colourProvider.Background1,
|
||||
Width = chatting_text_width,
|
||||
Masking = true,
|
||||
Child = chattingText = new OsuSpriteText
|
||||
{
|
||||
Font = OsuFont.Torus.With(size: 20),
|
||||
Colour = colourProvider.Background1,
|
||||
Anchor = Anchor.CentreRight,
|
||||
Origin = Anchor.CentreRight,
|
||||
Truncate = true,
|
||||
},
|
||||
},
|
||||
searchIconContainer = new Container
|
||||
{
|
||||
@ -131,15 +136,15 @@ namespace osu.Game.Overlays.Chat
|
||||
switch (newChannel?.Type)
|
||||
{
|
||||
case ChannelType.Public:
|
||||
chattingTextContainer.Text = $"chatting in {newChannel.Name}";
|
||||
chattingText.Text = $"chatting in {newChannel.Name}";
|
||||
break;
|
||||
|
||||
case ChannelType.PM:
|
||||
chattingTextContainer.Text = $"chatting with {newChannel.Name}";
|
||||
chattingText.Text = $"chatting with {newChannel.Name}";
|
||||
break;
|
||||
|
||||
default:
|
||||
chattingTextContainer.Text = string.Empty;
|
||||
chattingText.Text = string.Empty;
|
||||
break;
|
||||
}
|
||||
}, true);
|
||||
|
Loading…
Reference in New Issue
Block a user