Skip to content

Commit

Permalink
非常暴力的部分恢复为旧版风格
Browse files Browse the repository at this point in the history
未恢复的有字体大小
  • Loading branch information
cdwcgt committed Dec 18, 2024
1 parent 78e41fb commit 7824246
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion osu.Game/Overlays/Chat/ChatLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ private void updateMessageContent()

private void updateTimestamp()
{
drawableTimestamp.Text = message.Timestamp.LocalDateTime.ToLocalisableString(prefer24HourTime.Value ? @"HH:mm" : @"hh:mm tt");
drawableTimestamp.Text = message.Timestamp.LocalDateTime.ToLocalisableString(prefer24HourTime.Value ? @"HH:mm:ss" : @"hh:mm:ss tt");
}

private static readonly Color4[] default_username_colours =
Expand Down
38 changes: 20 additions & 18 deletions osu.Game/Overlays/Chat/DrawableChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,26 @@ protected override void LoadComplete()
highlightedMessage.BindValueChanged(_ => processMessageHighlighting(), true);
}

protected override void Update()
{
base.Update();

long? lastMinutes = null;

for (int i = 0; i < ChatLineFlow.Count; i++)
{
if (ChatLineFlow[i] is ChatLine chatline)
{
long minutes = chatline.Message.Timestamp.ToUnixTimeSeconds() / 60;

chatline.AlternatingBackground = i % 2 == 0;
chatline.RequiresTimestamp = minutes != lastMinutes;
lastMinutes = minutes;
}
}
}
// 去除背景替换和时间消除
// 其实就是返回旧版
// protected override void Update()
// {
// base.Update();
//
// long? lastMinutes = null;
//
// for (int i = 0; i < ChatLineFlow.Count; i++)
// {
// if (ChatLineFlow[i] is ChatLine chatline)
// {
// long minutes = chatline.Message.Timestamp.ToUnixTimeSeconds() / 60;
//
// chatline.AlternatingBackground = i % 2 == 0;
// chatline.RequiresTimestamp = minutes != lastMinutes;
// lastMinutes = minutes;
// }
// }
// }

/// <summary>
/// Processes any pending message in <see cref="highlightedMessage"/>.
Expand Down

0 comments on commit 7824246

Please sign in to comment.