mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 16:32:54 +08:00
Merge branch 'master' into rhythm-bonus-performance-fix
This commit is contained in:
commit
5618bdafce
@ -70,7 +70,9 @@ namespace osu.Desktop
|
|||||||
if (!string.IsNullOrEmpty(stableInstallPath) && checkExists(stableInstallPath))
|
if (!string.IsNullOrEmpty(stableInstallPath) && checkExists(stableInstallPath))
|
||||||
return stableInstallPath;
|
return stableInstallPath;
|
||||||
}
|
}
|
||||||
catch { }
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!");
|
stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!");
|
||||||
@ -113,7 +115,7 @@ namespace osu.Desktop
|
|||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
if (!noVersionOverlay)
|
if (!noVersionOverlay)
|
||||||
LoadComponentAsync(versionManager = new VersionManager { Depth = int.MinValue }, Add);
|
LoadComponentAsync(versionManager = new VersionManager { Depth = int.MinValue }, ScreenContainer.Add);
|
||||||
|
|
||||||
LoadComponentAsync(new DiscordRichPresence(), Add);
|
LoadComponentAsync(new DiscordRichPresence(), Add);
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ namespace osu.Game.Tests.Visual.Playlists
|
|||||||
public class TestScenePlaylistsResultsScreen : ScreenTestScene
|
public class TestScenePlaylistsResultsScreen : ScreenTestScene
|
||||||
{
|
{
|
||||||
private const int scores_per_result = 10;
|
private const int scores_per_result = 10;
|
||||||
|
private const int real_user_position = 200;
|
||||||
|
|
||||||
private TestResultsScreen resultsScreen;
|
private TestResultsScreen resultsScreen;
|
||||||
|
|
||||||
@ -58,6 +59,8 @@ namespace osu.Game.Tests.Visual.Playlists
|
|||||||
createResults(() => userScore);
|
createResults(() => userScore);
|
||||||
|
|
||||||
AddAssert("user score selected", () => this.ChildrenOfType<ScorePanel>().Single(p => p.Score.OnlineID == userScore.OnlineID).State == PanelState.Expanded);
|
AddAssert("user score selected", () => this.ChildrenOfType<ScorePanel>().Single(p => p.Score.OnlineID == userScore.OnlineID).State == PanelState.Expanded);
|
||||||
|
AddAssert($"score panel position is {real_user_position}",
|
||||||
|
() => this.ChildrenOfType<ScorePanel>().Single(p => p.Score.OnlineID == userScore.OnlineID).ScorePosition.Value == real_user_position);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -236,7 +239,7 @@ namespace osu.Game.Tests.Visual.Playlists
|
|||||||
EndedAt = userScore.Date,
|
EndedAt = userScore.Date,
|
||||||
Passed = userScore.Passed,
|
Passed = userScore.Passed,
|
||||||
Rank = userScore.Rank,
|
Rank = userScore.Rank,
|
||||||
Position = 200,
|
Position = real_user_position,
|
||||||
MaxCombo = userScore.MaxCombo,
|
MaxCombo = userScore.MaxCombo,
|
||||||
TotalScore = userScore.TotalScore,
|
TotalScore = userScore.TotalScore,
|
||||||
User = userScore.User,
|
User = userScore.User,
|
||||||
|
@ -103,7 +103,7 @@ namespace osu.Game
|
|||||||
|
|
||||||
private Container topMostOverlayContent;
|
private Container topMostOverlayContent;
|
||||||
|
|
||||||
private ScalingContainer screenContainer;
|
protected ScalingContainer ScreenContainer { get; private set; }
|
||||||
|
|
||||||
protected Container ScreenOffsetContainer { get; private set; }
|
protected Container ScreenOffsetContainer { get; private set; }
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ namespace osu.Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateBlockingOverlayFade() =>
|
private void updateBlockingOverlayFade() =>
|
||||||
screenContainer.FadeColour(visibleBlockingOverlays.Any() ? OsuColour.Gray(0.5f) : Color4.White, 500, Easing.OutQuint);
|
ScreenContainer.FadeColour(visibleBlockingOverlays.Any() ? OsuColour.Gray(0.5f) : Color4.White, 500, Easing.OutQuint);
|
||||||
|
|
||||||
public void AddBlockingOverlay(OverlayContainer overlay)
|
public void AddBlockingOverlay(OverlayContainer overlay)
|
||||||
{
|
{
|
||||||
@ -698,7 +698,7 @@ namespace osu.Game
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
screenContainer = new ScalingContainer(ScalingMode.ExcludeOverlays)
|
ScreenContainer = new ScalingContainer(ScalingMode.ExcludeOverlays)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
@ -801,7 +801,7 @@ namespace osu.Game
|
|||||||
loadComponentSingleFile(userProfile = new UserProfileOverlay(), overlayContent.Add, true);
|
loadComponentSingleFile(userProfile = new UserProfileOverlay(), overlayContent.Add, true);
|
||||||
loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay(), overlayContent.Add, true);
|
loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay(), overlayContent.Add, true);
|
||||||
loadComponentSingleFile(wikiOverlay = new WikiOverlay(), overlayContent.Add, true);
|
loadComponentSingleFile(wikiOverlay = new WikiOverlay(), overlayContent.Add, true);
|
||||||
loadComponentSingleFile(skinEditor = new SkinEditorOverlay(screenContainer), overlayContent.Add, true);
|
loadComponentSingleFile(skinEditor = new SkinEditorOverlay(ScreenContainer), overlayContent.Add, true);
|
||||||
|
|
||||||
loadComponentSingleFile(new LoginOverlay
|
loadComponentSingleFile(new LoginOverlay
|
||||||
{
|
{
|
||||||
|
@ -87,6 +87,13 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
|
|||||||
{
|
{
|
||||||
var allScores = new List<MultiplayerScore> { userScore };
|
var allScores = new List<MultiplayerScore> { userScore };
|
||||||
|
|
||||||
|
// Other scores could have arrived between score submission and entering the results screen. Ensure the local player score position is up to date.
|
||||||
|
if (Score != null)
|
||||||
|
{
|
||||||
|
Score.Position = userScore.Position;
|
||||||
|
ScorePanelList.GetPanelForScore(Score).ScorePosition.Value = userScore.Position;
|
||||||
|
}
|
||||||
|
|
||||||
if (userScore.ScoresAround?.Higher != null)
|
if (userScore.ScoresAround?.Higher != null)
|
||||||
{
|
{
|
||||||
allScores.AddRange(userScore.ScoresAround.Higher.Scores);
|
allScores.AddRange(userScore.ScoresAround.Higher.Scores);
|
||||||
|
@ -2,36 +2,42 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game.Scoring;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Ranking.Contracted
|
namespace osu.Game.Screens.Ranking.Contracted
|
||||||
{
|
{
|
||||||
public class ContractedPanelTopContent : CompositeDrawable
|
public class ContractedPanelTopContent : CompositeDrawable
|
||||||
{
|
{
|
||||||
private readonly ScoreInfo score;
|
public readonly Bindable<int?> ScorePosition = new Bindable<int?>();
|
||||||
|
|
||||||
public ContractedPanelTopContent(ScoreInfo score)
|
private OsuSpriteText text;
|
||||||
|
|
||||||
|
public ContractedPanelTopContent()
|
||||||
{
|
{
|
||||||
this.score = score;
|
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
InternalChild = new OsuSpriteText
|
InternalChild = text = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Y = 6,
|
Y = 6,
|
||||||
Text = score.Position != null ? $"#{score.Position}" : string.Empty,
|
|
||||||
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold)
|
Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
ScorePosition.BindValueChanged(pos => text.Text = pos.NewValue != null ? $"#{pos.NewValue}" : string.Empty, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
@ -78,6 +79,11 @@ namespace osu.Game.Screens.Ranking
|
|||||||
|
|
||||||
public event Action<PanelState> StateChanged;
|
public event Action<PanelState> StateChanged;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The position of the score in the rankings.
|
||||||
|
/// </summary>
|
||||||
|
public readonly Bindable<int?> ScorePosition = new Bindable<int?>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An action to be invoked if this <see cref="ScorePanel"/> is clicked while in an expanded state.
|
/// An action to be invoked if this <see cref="ScorePanel"/> is clicked while in an expanded state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -103,6 +109,8 @@ namespace osu.Game.Screens.Ranking
|
|||||||
{
|
{
|
||||||
Score = score;
|
Score = score;
|
||||||
displayWithFlair = isNewLocalScore;
|
displayWithFlair = isNewLocalScore;
|
||||||
|
|
||||||
|
ScorePosition.Value = score.Position;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -211,8 +219,8 @@ namespace osu.Game.Screens.Ranking
|
|||||||
topLayerBackground.FadeColour(expanded_top_layer_colour, RESIZE_DURATION, Easing.OutQuint);
|
topLayerBackground.FadeColour(expanded_top_layer_colour, RESIZE_DURATION, Easing.OutQuint);
|
||||||
middleLayerBackground.FadeColour(expanded_middle_layer_colour, RESIZE_DURATION, Easing.OutQuint);
|
middleLayerBackground.FadeColour(expanded_middle_layer_colour, RESIZE_DURATION, Easing.OutQuint);
|
||||||
|
|
||||||
topLayerContentContainer.Add(topLayerContent = new ExpandedPanelTopContent(Score.User).With(d => d.Alpha = 0));
|
topLayerContentContainer.Add(topLayerContent = new ExpandedPanelTopContent(Score.User) { Alpha = 0 });
|
||||||
middleLayerContentContainer.Add(middleLayerContent = new ExpandedPanelMiddleContent(Score, displayWithFlair).With(d => d.Alpha = 0));
|
middleLayerContentContainer.Add(middleLayerContent = new ExpandedPanelMiddleContent(Score, displayWithFlair) { Alpha = 0 });
|
||||||
|
|
||||||
// only the first expanded display should happen with flair.
|
// only the first expanded display should happen with flair.
|
||||||
displayWithFlair = false;
|
displayWithFlair = false;
|
||||||
@ -224,8 +232,13 @@ namespace osu.Game.Screens.Ranking
|
|||||||
topLayerBackground.FadeColour(contracted_top_layer_colour, RESIZE_DURATION, Easing.OutQuint);
|
topLayerBackground.FadeColour(contracted_top_layer_colour, RESIZE_DURATION, Easing.OutQuint);
|
||||||
middleLayerBackground.FadeColour(contracted_middle_layer_colour, RESIZE_DURATION, Easing.OutQuint);
|
middleLayerBackground.FadeColour(contracted_middle_layer_colour, RESIZE_DURATION, Easing.OutQuint);
|
||||||
|
|
||||||
topLayerContentContainer.Add(topLayerContent = new ContractedPanelTopContent(Score).With(d => d.Alpha = 0));
|
topLayerContentContainer.Add(topLayerContent = new ContractedPanelTopContent
|
||||||
middleLayerContentContainer.Add(middleLayerContent = new ContractedPanelMiddleContent(Score).With(d => d.Alpha = 0));
|
{
|
||||||
|
ScorePosition = { BindTarget = ScorePosition },
|
||||||
|
Alpha = 0
|
||||||
|
});
|
||||||
|
|
||||||
|
middleLayerContentContainer.Add(middleLayerContent = new ContractedPanelMiddleContent(Score) { Alpha = 0 });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user