mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 21:07:18 +09:00
Merge pull request #6348 from GSculerlor/truncate-username
Fix username overlap timestamp in match chatroom
This commit is contained in:
commit
c52cd02b62
@ -32,6 +32,12 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
Id = 4,
|
Id = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private readonly User longUsernameUser = new User
|
||||||
|
{
|
||||||
|
Username = "Very Long Long Username",
|
||||||
|
Id = 5,
|
||||||
|
};
|
||||||
|
|
||||||
[Cached]
|
[Cached]
|
||||||
private ChannelManager channelManager = new ChannelManager();
|
private ChannelManager channelManager = new ChannelManager();
|
||||||
|
|
||||||
@ -99,6 +105,12 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
Sender = admin,
|
Sender = admin,
|
||||||
Content = "Okay okay, calm down guys. Let's do this!"
|
Content = "Okay okay, calm down guys. Let's do this!"
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
AddStep("message from long username", () => testChannel.AddNewMessages(new Message(sequence++)
|
||||||
|
{
|
||||||
|
Sender = longUsernameUser,
|
||||||
|
Content = "Hi guys, my new username is lit!"
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,6 +146,7 @@ namespace osu.Game.Online.Chat
|
|||||||
|
|
||||||
protected override float HorizontalPadding => 10;
|
protected override float HorizontalPadding => 10;
|
||||||
protected override float MessagePadding => 120;
|
protected override float MessagePadding => 120;
|
||||||
|
protected override float TimestampPadding => 50;
|
||||||
|
|
||||||
public StandAloneMessage(Message message)
|
public StandAloneMessage(Message message)
|
||||||
: base(message)
|
: base(message)
|
||||||
|
@ -31,7 +31,9 @@ namespace osu.Game.Overlays.Chat
|
|||||||
|
|
||||||
protected virtual float MessagePadding => default_message_padding;
|
protected virtual float MessagePadding => default_message_padding;
|
||||||
|
|
||||||
private const float timestamp_padding = 65;
|
private const float default_timestamp_padding = 65;
|
||||||
|
|
||||||
|
protected virtual float TimestampPadding => default_timestamp_padding;
|
||||||
|
|
||||||
private const float default_horizontal_padding = 15;
|
private const float default_horizontal_padding = 15;
|
||||||
|
|
||||||
@ -94,7 +96,7 @@ namespace osu.Game.Overlays.Chat
|
|||||||
Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.Bold, italics: true),
|
Font = OsuFont.GetFont(size: TextSize, weight: FontWeight.Bold, italics: true),
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
MaxWidth = default_message_padding - timestamp_padding
|
MaxWidth = MessagePadding - TimestampPadding
|
||||||
};
|
};
|
||||||
|
|
||||||
if (hasBackground)
|
if (hasBackground)
|
||||||
@ -149,7 +151,6 @@ namespace osu.Game.Overlays.Chat
|
|||||||
new MessageSender(message.Sender)
|
new MessageSender(message.Sender)
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Padding = new MarginPadding { Left = timestamp_padding },
|
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Child = effectedUsername,
|
Child = effectedUsername,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user