1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:02:55 +08:00

Revert changes

This commit is contained in:
jkh675 2024-08-02 12:02:28 +08:00
parent 894c6150c8
commit 5de37f9cd5
2 changed files with 4 additions and 59 deletions

View File

@ -139,13 +139,11 @@ namespace osu.Game.Overlays.Comments
}
}
private partial class ParentUsername : FillFlowContainer, IHasCustomTooltip<LocalisableString>
private partial class ParentUsername : FillFlowContainer, IHasTooltip
{
public ITooltip<LocalisableString> GetCustomTooltip() => new CommentTooltip();
public LocalisableString TooltipText => getParentMessage();
LocalisableString IHasCustomTooltip<LocalisableString>.TooltipContent => getParentMessage();
private Comment? parentComment { get; }
private readonly Comment? parentComment;
public ParentUsername(Comment comment)
{
@ -178,58 +176,5 @@ namespace osu.Game.Overlays.Comments
return parentComment.HasMessage ? parentComment.Message : parentComment.IsDeleted ? CommentsStrings.Deleted : string.Empty;
}
}
private partial class CommentTooltip : VisibilityContainer, ITooltip<LocalisableString>
{
private const int max_width = 500;
private TextFlowContainer content { get; set; } = null!;
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
AutoSizeAxes = Axes.Both;
Masking = true;
CornerRadius = 7;
Children = new Drawable[]
{
new Box
{
Colour = colours.Gray3,
RelativeSizeAxes = Axes.Both
},
content = new TextFlowContainer(f =>
{
f.Font = OsuFont.Default;
f.Truncate = true;
f.MaxWidth = max_width;
})
{
Margin = new MarginPadding(3),
AutoSizeAxes = Axes.Both,
MaximumSize = new Vector2(max_width, float.PositiveInfinity),
}
};
}
private LocalisableString lastPresent;
public void SetContent(LocalisableString content)
{
if (lastPresent.Equals(content))
return;
this.content.Text = content;
lastPresent = content;
}
public void Move(Vector2 pos) => Position = pos;
protected override void PopIn() => this.FadeIn(200, Easing.OutQuint);
protected override void PopOut() => this.FadeOut(200, Easing.OutQuint);
}
}
}

View File

@ -36,7 +36,7 @@
</PackageReference>
<PackageReference Include="Realm" Version="11.5.0" />
<PackageReference Include="ppy.osu.Framework" Version="2024.720.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2024.713.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2024.731.0" />
<PackageReference Include="Sentry" Version="4.3.0" />
<!-- Held back due to 0.34.0 failing AOT compilation on ZstdSharp.dll dependency. -->
<PackageReference Include="SharpCompress" Version="0.36.0" />