From 0478f7bae1cf168707bee7c35654a8de1b848e62 Mon Sep 17 00:00:00 2001 From: MATRIX-feather Date: Thu, 30 Jan 2020 21:18:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E8=A7=81Changelog.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Changelog.md | 57 ++-- osu.Desktop/Overlays/VersionManager.cs | 4 +- osu.Desktop/osu.Desktop.csproj | 4 +- osu.Game/Graphics/DrawableDate.cs | 4 +- .../Overlays/Profile/ProfileItemContainer.cs | 63 +++++ .../Historical/DrawableMostPlayedBeatmap.cs | 85 +++--- .../Ranks/DrawablePerformanceScore.cs | 47 ---- .../Sections/Ranks/DrawableProfileScore.cs | 250 ++++++++++++++---- .../Ranks/DrawableProfileWeightedScore.cs | 55 ++++ .../Sections/Ranks/DrawableTotalScore.cs | 31 --- .../Sections/Ranks/PaginatedScoreContainer.cs | 12 +- .../Overlays/Profile/Sections/RanksSection.cs | 2 +- 12 files changed, 399 insertions(+), 215 deletions(-) create mode 100644 osu.Game/Overlays/Profile/ProfileItemContainer.cs delete mode 100755 osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs create mode 100644 osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileWeightedScore.cs delete mode 100755 osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs diff --git a/Changelog.md b/Changelog.md index fea6e1dfa676..55771b41dd9a 100755 --- a/Changelog.md +++ b/Changelog.md @@ -175,35 +175,38 @@ * [effectSection](osu.Game/Screens/Edit/Timing/EffectSection.cs) * 整合更新 - * [m] [#7623 - Fix crash due to misordered selection events](https://github.com/ppy/osu/pull/7623) - * [m] [#7432 - Implement ability to create OverlayHeader with no TabControl](https://github.com/ppy/osu/pull/7432) + * [M] [#7623 - Fix crash due to misordered selection events](https://github.com/ppy/osu/pull/7623) + * [M] [#7432 - Implement ability to create OverlayHeader with no TabControl](https://github.com/ppy/osu/pull/7432) * [M] [#7638 - Use type switch in SerializationWriter](https://github.com/ppy/osu/pull/7638) - * [m] [#7637 - Refactor background creation in OverlayHeader](https://github.com/ppy/osu/pull/7637) - * [m] [#7650 - Change default method style for better IDE autocompletion](https://github.com/ppy/osu/pull/7650) - * [m] [#7636 - Make CommentsContainer use OverlayColourProvider](https://github.com/ppy/osu/pull/7636) - * [m] [#7645 - Allow OsuSliderBar tooltip to show as percentage as needed](https://github.com/ppy/osu/pull/7645) - * [m] [#7659 - Fix random PlaySongSelect test failures](https://github.com/ppy/osu/pull/7659) - * [m] [#7653 - Fix navigation test crashing when raw input is disabled](https://github.com/ppy/osu/pull/7653) - * [m] [#7652 - Fix key count being incorrectly adjusted by hard/easy mods](https://github.com/ppy/osu/pull/7652) - * [m] [#7634 - Add beat ticks to editor timeline](https://github.com/ppy/osu/pull/7634) + * [M] [#7637 - Refactor background creation in OverlayHeader](https://github.com/ppy/osu/pull/7637) + * [M] [#7650 - Change default method style for better IDE autocompletion](https://github.com/ppy/osu/pull/7650) + * [M] [#7636 - Make CommentsContainer use OverlayColourProvider](https://github.com/ppy/osu/pull/7636) + * [M] [#7645 - Allow OsuSliderBar tooltip to show as percentage as needed](https://github.com/ppy/osu/pull/7645) + * [M] [#7659 - Fix random PlaySongSelect test failures](https://github.com/ppy/osu/pull/7659) + * [M] [#7653 - Fix navigation test crashing when raw input is disabled](https://github.com/ppy/osu/pull/7653) + * [M] [#7652 - Fix key count being incorrectly adjusted by hard/easy mods](https://github.com/ppy/osu/pull/7652) + * [M] [#7634 - Add beat ticks to editor timeline](https://github.com/ppy/osu/pull/7634) +## 2020.130.1 ### 2020/1/30: * 整合更新 - * [m] [#7675 - Fix possible crash when searching with no channel topic](https://github.com/ppy/osu/pull/7675) - * [m] [#7593 - Minor cleanups for Legacy Storyboard/Beatmap decoder](https://github.com/ppy/osu/pull/7593) - * [m] [#7647 - Move select tool to an actual tool implementation](https://github.com/ppy/osu/pull/7647) - * [m] [#7671 - Rename and tidy up DeletedCommentsCounter](https://github.com/ppy/osu/pull/7671) - * [m] [#7642 - Fix beat snap implementation being incorrect](https://github.com/ppy/osu/pull/7642) - * [m] [#7644 - Standardise editor timeline zoom across maps of all lengths](https://github.com/ppy/osu/pull/7644) - * [!_与一个现有更新冲突] #7643 - Distance snap grid correct colouring - * Ensure selection tool correctly matches selection state #7649 - * Allow selecting composition tools using 1-4 keys #7648 + * [M] [#7675 - Fix possible crash when searching with no channel topic](https://github.com/ppy/osu/pull/7675) + * [M] [#7593 - Minor cleanups for Legacy Storyboard/Beatmap decoder](https://github.com/ppy/osu/pull/7593) + * [M] [#7647 - Move select tool to an actual tool implementation](https://github.com/ppy/osu/pull/7647) + * [M] [#7671 - Rename and tidy up DeletedCommentsCounter](https://github.com/ppy/osu/pull/7671) + * [M] [#7642 - Fix beat snap implementation being incorrect](https://github.com/ppy/osu/pull/7642) + * [M] [#7644 - Standardise editor timeline zoom across maps of all lengths](https://github.com/ppy/osu/pull/7644) + * [#7643 - Distance snap grid correct colouring](https://github.com/ppy/osu/pull/7643) + * [M] [#7649 - Ensure selection tool correctly matches selection state](https://github.com/ppy/osu/pull/7649) + * [M] [#7648 - Allow selecting composition tools using 1-4 keys](https://github.com/ppy/osu/pull/7648) * [!_有变动,需要重新描述这个更新] [O->M] [#7222 - 向"WindUp"和"WindDown"Mod添加反向选项](https://github.com/ppy/osu/pull/7222) - * Fix osu!catch not handling all vertical space #7673 - * Bring UserProfileOverlay colour scheme in line with web #7670 - * Fix negative replay frames being played back incorrectly #7676 - * Fix editor being accessible for multiplayer song select #7667 - * Fix presenting a beatmap from a different ruleset not working #7663 - * Move navigation / game test scenes to new namespace #7661 - * Remove build target from Fastfile #7613 - * Fix percentage-formatted displays containing a space #7664 \ No newline at end of file + * [M] [#7673 - Fix osu!catch not handling all vertical space](https://github.com/ppy/osu/pull/7673) + * [M] [#7670 - Bring UserProfileOverlay colour scheme in line with web](https://github.com/ppy/osu/pull/7670) + * [M] [#7676 - Fix negative replay frames being played back incorrectly](https://github.com/ppy/osu/pull/7676) + * [M] [#7667 - Fix editor being accessible for multiplayer song select](https://github.com/ppy/osu/pull/7667) + * [M] [#7663 - Fix presenting a beatmap from a different ruleset not working](https://github.com/ppy/osu/pull/7663) + * [M] [#7661 - Move navigation / game test scenes to new namespace](https://github.com/ppy/osu/pull/7661) + * [M] [#7613 - Remove build target from Fastfile](https://github.com/ppy/osu/pull/7613) + * [M] [#7664 - Fix percentage-formatted displays containing a space](https://github.com/ppy/osu/pull/7664) + * [M] [#7554 - Update profile scores in line with the web design](https://github.com/ppy/osu/pull/7554) + * [M] [#7654 - Add a method to recycle test storage between runs #7654](https://github.com/ppy/osu/pull/7654) \ No newline at end of file diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index 560c75fb17fb..b1c933722d1c 100755 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -61,8 +61,8 @@ private void load(OsuColour colours, TextureStore textures, OsuGameBase game) Origin = Anchor.TopCentre, Font = OsuFont.Numeric.With(size: 16),//翻译时修改 Colour = colours.Yellow, - // Text = @"2020.125.0+matrixfeather 2" - Text = "早期开发版本" + Text = @"2020.130.0+matrixfeather 1" + //Text = "早期开发版本" }, new Sprite { diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj index 0aa857a3b129..34536cc3ee2c 100755 --- a/osu.Desktop/osu.Desktop.csproj +++ b/osu.Desktop/osu.Desktop.csproj @@ -9,8 +9,8 @@ osu!lazer lazer.ico app.manifest - 0.0.0 - + + 2020.130.1 0.0.0 diff --git a/osu.Game/Graphics/DrawableDate.cs b/osu.Game/Graphics/DrawableDate.cs index 7f43cc9d86fb..b032f6ff4a6b 100755 --- a/osu.Game/Graphics/DrawableDate.cs +++ b/osu.Game/Graphics/DrawableDate.cs @@ -29,9 +29,9 @@ public DateTimeOffset Date } } - public DrawableDate(DateTimeOffset date) + public DrawableDate(DateTimeOffset date, float textSize = OsuFont.DEFAULT_FONT_SIZE) { - Font = OsuFont.GetFont(weight: FontWeight.Regular, italics: true); + Font = OsuFont.GetFont(weight: FontWeight.Regular, size: textSize, italics: true); Date = date; } diff --git a/osu.Game/Overlays/Profile/ProfileItemContainer.cs b/osu.Game/Overlays/Profile/ProfileItemContainer.cs new file mode 100644 index 000000000000..6f38d9cae880 --- /dev/null +++ b/osu.Game/Overlays/Profile/ProfileItemContainer.cs @@ -0,0 +1,63 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Input.Events; +using osuTK.Graphics; + +namespace osu.Game.Overlays.Profile.Sections +{ + public class ProfileItemContainer : Container + { + private const int hover_duration = 200; + + protected override Container Content => content; + + private Color4 idleColour; + private Color4 hoverColour; + + private readonly Box background; + private readonly Container content; + + public ProfileItemContainer() + { + RelativeSizeAxes = Axes.Both; + Masking = true; + CornerRadius = 6; + + AddRangeInternal(new Drawable[] + { + background = new Box + { + RelativeSizeAxes = Axes.Both, + }, + content = new Container + { + RelativeSizeAxes = Axes.Both, + } + }); + } + + [BackgroundDependencyLoader] + private void load(OverlayColourProvider colourProvider) + { + background.Colour = idleColour = colourProvider.Background4; + hoverColour = colourProvider.Background3; + } + + protected override bool OnHover(HoverEvent e) + { + background.FadeColour(hoverColour, hover_duration, Easing.OutQuint); + return base.OnHover(e); + } + + protected override void OnHoverLost(HoverLostEvent e) + { + base.OnHoverLost(e); + background.FadeColour(idleColour, hover_duration, Easing.OutQuint); + } + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedBeatmap.cs b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedBeatmap.cs index 24b90c26d5e1..082778cd0ed0 100755 --- a/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedBeatmap.cs +++ b/osu.Game/Overlays/Profile/Sections/Historical/DrawableMostPlayedBeatmap.cs @@ -4,7 +4,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; using osu.Game.Beatmaps; @@ -13,32 +12,25 @@ using osu.Game.Graphics.Containers; using osu.Game.Graphics.Sprites; using osuTK; -using System.Collections.Generic; using osu.Framework.Graphics.Cursor; namespace osu.Game.Overlays.Profile.Sections.Historical { - public class DrawableMostPlayedBeatmap : OsuHoverContainer + public class DrawableMostPlayedBeatmap : CompositeDrawable { private const int cover_width = 100; private const int corner_radius = 6; - private const int height = 50; private readonly BeatmapInfo beatmap; private readonly int playCount; - private Box background; - - protected override IEnumerable EffectTargets => new[] { background }; - public DrawableMostPlayedBeatmap(BeatmapInfo beatmap, int playCount) { this.beatmap = beatmap; this.playCount = playCount; - Enabled.Value = true; //manually enabled, because we have no action RelativeSizeAxes = Axes.X; - Height = height; + Height = 50; Masking = true; CornerRadius = corner_radius; @@ -47,10 +39,7 @@ public DrawableMostPlayedBeatmap(BeatmapInfo beatmap, int playCount) [BackgroundDependencyLoader] private void load(OsuColour colours) { - IdleColour = colours.GreySeafoam; - HoverColour = colours.GreySeafoamLight; - - Children = new Drawable[] + AddRangeInternal(new Drawable[] { new UpdateableBeatmapSetCover { @@ -72,46 +61,48 @@ private void load(OsuColour colours) CornerRadius = corner_radius, Children = new Drawable[] { - background = new Box { RelativeSizeAxes = Axes.Both }, - new Container + new ProfileItemContainer { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding(10), - Children = new Drawable[] + Child = new Container { - new FillFlowContainer + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding(10), + Children = new Drawable[] { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, - Children = new Drawable[] + new FillFlowContainer { - new MostPlayedBeatmapMetadataContainer(beatmap), - new LinkFlowContainer(t => t.Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular)) - { - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Horizontal, - Colour = colours.GreySeafoamLighter - }.With(d => + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Children = new Drawable[] { - d.AddText("作图者: "); - d.AddUserLink(beatmap.Metadata.Author); - }), - } - }, - new PlayCountText(playCount) - { - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight - }, - } - }, + new MostPlayedBeatmapMetadataContainer(beatmap), + new LinkFlowContainer(t => t.Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular)) + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Colour = colours.GreySeafoamLighter + }.With(d => + { + d.AddText("作图者 "); + d.AddUserLink(beatmap.Metadata.Author); + }), + } + }, + new PlayCountText(playCount) + { + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight + }, + } + }, + } } } } } - }; + }); } private class MostPlayedBeatmapMetadataContainer : BeatmapMetadataContainer @@ -132,7 +123,7 @@ public MostPlayedBeatmapMetadataContainer(BeatmapInfo beatmap) }, new OsuSpriteText { - Text = "艺术家:" + new LocalisedString((beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist)), + Text = "by " + new LocalisedString((beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist)), Font = OsuFont.GetFont(weight: FontWeight.Regular) }, }; @@ -179,4 +170,4 @@ private void load(OsuColour colours) } } } -} +} \ No newline at end of file diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs deleted file mode 100755 index 5ac422a2717e..000000000000 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawablePerformanceScore.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Game.Graphics; -using osu.Game.Graphics.Sprites; -using osu.Game.Scoring; - -namespace osu.Game.Overlays.Profile.Sections.Ranks -{ - public class DrawablePerformanceScore : DrawableProfileScore - { - private readonly double? weight; - - public DrawablePerformanceScore(ScoreInfo score, double? weight = null) - : base(score) - { - this.weight = weight; - } - - [BackgroundDependencyLoader] - private void load(OsuColour colour) - { - double pp = Score.PP ?? 0; - RightFlowContainer.Add(new OsuSpriteText - { - Text = $"{pp:0}pp", - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold, italics: true) - }); - - if (weight.HasValue) - { - RightFlowContainer.Add(new OsuSpriteText - { - Text = $"比重: {pp * weight:0}pp ({weight:P0})", - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - Colour = colour.GrayA, - Font = OsuFont.GetFont(size: 15, weight: FontWeight.Regular, italics: true)//第一次翻译时调整 - }); - } - } - } -} diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs index e366f989e5ce..d9dd39421a38 100755 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs @@ -1,76 +1,225 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osuTK; +using System.Linq; +using JetBrains.Annotations; using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; +using osu.Framework.Localisation; +using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Online.Leaderboards; -using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.UI; using osu.Game.Scoring; -using osu.Game.Beatmaps; -using osu.Framework.Localisation; -using osu.Framework.Graphics.Containers; +using osuTK; +using osuTK.Graphics; namespace osu.Game.Overlays.Profile.Sections.Ranks { - public abstract class DrawableProfileScore : DrawableProfileRow + public class DrawableProfileScore : CompositeDrawable { - private readonly FillFlowContainer modsContainer; + private const int performance_width = 80; + private const int content_padding = 10; + protected readonly ScoreInfo Score; - protected DrawableProfileScore(ScoreInfo score) + [Resolved] + private OsuColour colours { get; set; } + + [Resolved] + private OverlayColourProvider colourProvider { get; set; } + + public DrawableProfileScore(ScoreInfo score) { Score = score; RelativeSizeAxes = Axes.X; - Height = 60; - Children = new Drawable[] + Height = 40; + } + + [BackgroundDependencyLoader] + private void load() + { + AddInternal(new ProfileItemContainer { - modsContainer = new FillFlowContainer + Children = new Drawable[] { - AutoSizeAxes = Axes.Both, - Anchor = Anchor.CentreRight, - Origin = Anchor.CentreRight, - Spacing = new Vector2(1), - Margin = new MarginPadding { Right = 160 } + new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Left = content_padding, Right = performance_width + content_padding }, + Children = new Drawable[] + { + new FillFlowContainer + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(8, 0), + Children = new Drawable[] + { + new UpdateableRank(Score.Rank) + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + Size = new Vector2(50, 20), + }, + new FillFlowContainer + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 2), + Children = new Drawable[] + { + new ScoreBeatmapMetadataContainer(Score.Beatmap), + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(5, 0), + Children = new Drawable[] + { + new OsuSpriteText + { + Text = $"{Score.Beatmap.Version}", + Font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular), + Colour = colours.Yellow + }, + new DrawableDate(Score.Date, 12) + { + Colour = colourProvider.Foreground1 + } + } + } + } + } + } + }, + new FillFlowContainer + { + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(15), + Children = new[] + { + CreateRightContent().With(c => + { + c.Anchor = Anchor.CentreRight; + c.Origin = Anchor.CentreRight; + }), + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + Direction = FillDirection.Horizontal, + Spacing = new Vector2(2), + Children = Score.Mods.Select(mod => new ModIcon(mod) + { + Scale = new Vector2(0.35f) + }).ToList(), + } + } + } + } + }, + new Container + { + RelativeSizeAxes = Axes.Y, + Width = performance_width, + Anchor = Anchor.CentreRight, + Origin = Anchor.CentreRight, + Children = new[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Size = new Vector2(1, 0.5f), + Colour = Color4.Black.Opacity(0.5f), + Shear = new Vector2(-0.45f, 0), + EdgeSmoothness = new Vector2(2, 0), + }, + new Box + { + RelativeSizeAxes = Axes.Both, + RelativePositionAxes = Axes.Y, + Size = new Vector2(1, -0.5f), + Position = new Vector2(0, 1), + Colour = Color4.Black.Opacity(0.5f), + Shear = new Vector2(0.45f, 0), + EdgeSmoothness = new Vector2(2, 0), + }, + createDrawablePerformance().With(d => + { + d.Anchor = Anchor.Centre; + d.Origin = Anchor.Centre; + }) + } + } } - }; + }); } - [BackgroundDependencyLoader(true)] - private void load(OsuColour colour) - { - var text = new OsuSpriteText - { - Text = $"准确率: {Score.Accuracy:P2}", - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - Colour = colour.GrayA, - Font = OsuFont.GetFont(size: 15, weight: FontWeight.Regular, italics: true)//第一次翻译时调整 - }; + [NotNull] + protected virtual Drawable CreateRightContent() => CreateDrawableAccuracy(); - RightFlowContainer.Insert(1, text); + protected OsuSpriteText CreateDrawableAccuracy() => new OsuSpriteText + { + Text = $"{Score.Accuracy:0.00%}", + Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold, italics: true), + Colour = colours.Yellow, + }; - LeftFlowContainer.Add(new ProfileScoreBeatmapMetadataContainer(Score.Beatmap)); - LeftFlowContainer.Add(new DrawableDate(Score.Date)); + private Drawable createDrawablePerformance() + { + if (Score.PP.HasValue) + { + return new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Children = new[] + { + new OsuSpriteText + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + Font = OsuFont.GetFont(weight: FontWeight.Bold), + Text = $"{Score.PP:0}", + Colour = colourProvider.Highlight1 + }, + new OsuSpriteText + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold), + Text = "pp", + Colour = colourProvider.Light3 + } + } + }; + } - foreach (Mod mod in Score.Mods) - modsContainer.Add(new ModIcon(mod) { Scale = new Vector2(0.5f) }); + return new OsuSpriteText + { + Font = OsuFont.GetFont(weight: FontWeight.Bold), + Text = "-", + Colour = colourProvider.Highlight1 + }; } - protected override Drawable CreateLeftVisual() => new UpdateableRank(Score.Rank) - { - RelativeSizeAxes = Axes.Y, - Width = 60, - FillMode = FillMode.Fit, - }; - - private class ProfileScoreBeatmapMetadataContainer : BeatmapMetadataContainer + private class ScoreBeatmapMetadataContainer : BeatmapMetadataContainer { - public ProfileScoreBeatmapMetadataContainer(BeatmapInfo beatmap) + public ScoreBeatmapMetadataContainer(BeatmapInfo beatmap) : base(beatmap) { } @@ -79,18 +228,21 @@ public ProfileScoreBeatmapMetadataContainer(BeatmapInfo beatmap) { new OsuSpriteText { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, Text = new LocalisedString(( - $"{beatmap.Metadata.TitleUnicode ?? beatmap.Metadata.Title} [{beatmap.Version}] ", - $"{beatmap.Metadata.Title ?? beatmap.Metadata.TitleUnicode} [{beatmap.Version}] ")), - Font = OsuFont.GetFont(size: 15, weight: FontWeight.SemiBold, italics: true) + $"{beatmap.Metadata.TitleUnicode ?? beatmap.Metadata.Title} ", + $"{beatmap.Metadata.Title ?? beatmap.Metadata.TitleUnicode} ")), + Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold, italics: true) }, new OsuSpriteText { - Text = new LocalisedString((beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist)), - Padding = new MarginPadding { Top = 3 }, - Font = OsuFont.GetFont(size: 12, weight: FontWeight.Regular, italics: true) + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + Text = "by " + new LocalisedString((beatmap.Metadata.ArtistUnicode, beatmap.Metadata.Artist)), + Font = OsuFont.GetFont(size: 12, italics: true) }, }; } } -} +} \ No newline at end of file diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileWeightedScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileWeightedScore.cs new file mode 100644 index 000000000000..1b771986aa98 --- /dev/null +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileWeightedScore.cs @@ -0,0 +1,55 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Scoring; + +namespace osu.Game.Overlays.Profile.Sections.Ranks +{ + public class DrawableProfileWeightedScore : DrawableProfileScore + { + private readonly double weight; + + public DrawableProfileWeightedScore(ScoreInfo score, double weight) + : base(score) + { + this.weight = weight; + } + + protected override Drawable CreateRightContent() => new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new FillFlowContainer + { + AutoSizeAxes = Axes.Both, + Direction = FillDirection.Horizontal, + Children = new Drawable[] + { + new Container + { + AutoSizeAxes = Axes.Y, + Width = 60, + Child = CreateDrawableAccuracy() + }, + new OsuSpriteText + { + Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold, italics: true), + Text = $"{Score.PP * weight:0}pp", + }, + } + }, + new OsuSpriteText + { + Font = OsuFont.GetFont(size: 16), + Text = $@"比重 {weight:0%}" + } + } + }; + } +} \ No newline at end of file diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs deleted file mode 100755 index 8bfca08fe7fc..000000000000 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableTotalScore.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Game.Graphics; -using osu.Game.Graphics.Sprites; -using osu.Game.Scoring; - -namespace osu.Game.Overlays.Profile.Sections.Ranks -{ - public class DrawableTotalScore : DrawableProfileScore - { - public DrawableTotalScore(ScoreInfo score) - : base(score) - { - } - - [BackgroundDependencyLoader] - private void load() - { - RightFlowContainer.Add(new OsuSpriteText - { - Text = Score.TotalScore.ToString("#,###"), - Anchor = Anchor.TopRight, - Origin = Anchor.TopRight, - Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold, italics: true) - }); - } - } -} diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs index e0f1c935dad5..084077f849e5 100755 --- a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs @@ -15,14 +15,12 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks { public class PaginatedScoreContainer : PaginatedContainer { - private readonly bool includeWeight; private readonly ScoreType type; - public PaginatedScoreContainer(ScoreType type, Bindable user, string header, string missing, bool includeWeight = false) + public PaginatedScoreContainer(ScoreType type, Bindable user, string header, string missing) : base(user, header, missing) { this.type = type; - this.includeWeight = includeWeight; ItemsPerPage = 5; @@ -43,11 +41,11 @@ protected override Drawable CreateDrawableItem(APILegacyScoreInfo model) switch (type) { default: - return new DrawablePerformanceScore(model.CreateScoreInfo(Rulesets), includeWeight ? Math.Pow(0.95, ItemsContainer.Count) : (double?)null); + return new DrawableProfileScore(model.CreateScoreInfo(Rulesets)); - case ScoreType.Recent: - return new DrawableTotalScore(model.CreateScoreInfo(Rulesets)); + case ScoreType.Best: + return new DrawableProfileWeightedScore(model.CreateScoreInfo(Rulesets), Math.Pow(0.95, ItemsContainer.Count)); } } } -} +} \ No newline at end of file diff --git a/osu.Game/Overlays/Profile/Sections/RanksSection.cs b/osu.Game/Overlays/Profile/Sections/RanksSection.cs index 7a61b4314084..bfe60516b822 100755 --- a/osu.Game/Overlays/Profile/Sections/RanksSection.cs +++ b/osu.Game/Overlays/Profile/Sections/RanksSection.cs @@ -16,7 +16,7 @@ public RanksSection() { Children = new[] { - new PaginatedScoreContainer(ScoreType.Best, User, "最佳成绩", "还没有(´・ω・`)", true), + new PaginatedScoreContainer(ScoreType.Best, User, "最佳成绩", "还没有(´・ω・`)"), new PaginatedScoreContainer(ScoreType.Firsts, User, "第一名", "还没有(´・ω・`)"), }; }