mirror of
https://github.com/osukey/osukey.git
synced 2025-05-29 17:37:23 +09:00
Revert some changes
This commit is contained in:
parent
90768a86a6
commit
bfcadcc4ac
@ -19,7 +19,6 @@ using osu.Game.Graphics.Cursor;
|
|||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.Placeholders;
|
using osu.Game.Online.Placeholders;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -29,7 +28,6 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
{
|
{
|
||||||
private const double fade_duration = 300;
|
private const double fade_duration = 300;
|
||||||
|
|
||||||
private readonly Bindable<ScoringMode> scoringMode = new Bindable<ScoringMode>();
|
|
||||||
private readonly OsuScrollContainer scrollContainer;
|
private readonly OsuScrollContainer scrollContainer;
|
||||||
private readonly Container placeholderContainer;
|
private readonly Container placeholderContainer;
|
||||||
private readonly UserTopScoreContainer<TScoreInfo> topScoreContainer;
|
private readonly UserTopScoreContainer<TScoreInfo> topScoreContainer;
|
||||||
@ -255,9 +253,6 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
apiState.BindTo(api.State);
|
apiState.BindTo(api.State);
|
||||||
|
|
||||||
apiState.BindValueChanged(onlineStateChanged, true);
|
apiState.BindValueChanged(onlineStateChanged, true);
|
||||||
|
|
||||||
configManager.BindWith(OsuSetting.ScoreDisplayMode, scoringMode);
|
|
||||||
scoringMode.BindValueChanged(_ => RefreshScores(), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private APIRequest getScoresRequest;
|
private APIRequest getScoresRequest;
|
||||||
|
@ -199,7 +199,7 @@ namespace osu.Game.Online.Leaderboards
|
|||||||
TextColour = Color4.White,
|
TextColour = Color4.White,
|
||||||
GlowColour = Color4Extensions.FromHex(@"83ccfa"),
|
GlowColour = Color4Extensions.FromHex(@"83ccfa"),
|
||||||
Font = OsuFont.Numeric.With(size: 23),
|
Font = OsuFont.Numeric.With(size: 23),
|
||||||
Text = scoreManager.GetTotalScore(score).ToLocalisableString(@"N0"),
|
Current = scoreManager.GetBindableTotalScoreString(score)
|
||||||
},
|
},
|
||||||
RankContainer = new Container
|
RankContainer = new Container
|
||||||
{
|
{
|
||||||
|
@ -152,7 +152,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
{
|
{
|
||||||
Margin = new MarginPadding { Right = horizontal_inset },
|
Margin = new MarginPadding { Right = horizontal_inset },
|
||||||
Font = OsuFont.GetFont(size: text_size, weight: index == 0 ? FontWeight.Bold : FontWeight.Medium),
|
Font = OsuFont.GetFont(size: text_size, weight: index == 0 ? FontWeight.Bold : FontWeight.Medium),
|
||||||
Text = scoreManager.GetTotalScore(score).ToLocalisableString(@"N0"),
|
Current = scoreManager.GetBindableTotalScoreString(score),
|
||||||
},
|
},
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
|
@ -15,7 +15,6 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Screens.Select.Leaderboards;
|
using osu.Game.Screens.Select.Leaderboards;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
@ -30,7 +29,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||||
private readonly Bindable<BeatmapLeaderboardScope> scope = new Bindable<BeatmapLeaderboardScope>(BeatmapLeaderboardScope.Global);
|
private readonly Bindable<BeatmapLeaderboardScope> scope = new Bindable<BeatmapLeaderboardScope>(BeatmapLeaderboardScope.Global);
|
||||||
private readonly IBindable<User> user = new Bindable<User>();
|
private readonly IBindable<User> user = new Bindable<User>();
|
||||||
private readonly Bindable<ScoringMode> scoringMode = new Bindable<ScoringMode>();
|
|
||||||
|
|
||||||
private readonly Box background;
|
private readonly Box background;
|
||||||
private readonly ScoreTable scoreTable;
|
private readonly ScoreTable scoreTable;
|
||||||
@ -51,15 +49,37 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
|
|
||||||
private GetScoresRequest getScoresRequest;
|
private GetScoresRequest getScoresRequest;
|
||||||
|
|
||||||
private APILegacyScores scores;
|
|
||||||
|
|
||||||
protected APILegacyScores Scores
|
protected APILegacyScores Scores
|
||||||
{
|
{
|
||||||
set
|
set => Schedule(() =>
|
||||||
{
|
{
|
||||||
scores = value;
|
topScoresContainer.Clear();
|
||||||
displayScores(value);
|
|
||||||
}
|
if (value?.Scores.Any() != true)
|
||||||
|
{
|
||||||
|
scoreTable.ClearScores();
|
||||||
|
scoreTable.Hide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var scoreInfos = value.Scores.Select(s => s.CreateScoreInfo(rulesets))
|
||||||
|
.OrderByDescending(s => scoreManager.GetTotalScore(s))
|
||||||
|
.ThenBy(s => s.OnlineScoreID)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
var topScore = scoreInfos.First();
|
||||||
|
|
||||||
|
scoreTable.DisplayScores(scoreInfos, topScore.Beatmap?.Status.GrantsPerformancePoints() == true);
|
||||||
|
scoreTable.Show();
|
||||||
|
|
||||||
|
var userScore = value.UserScore;
|
||||||
|
var userScoreInfo = userScore?.Score.CreateScoreInfo(rulesets);
|
||||||
|
|
||||||
|
topScoresContainer.Add(new DrawableTopScore(topScore));
|
||||||
|
|
||||||
|
if (userScoreInfo != null && userScoreInfo.OnlineScoreID != topScore.OnlineScoreID)
|
||||||
|
topScoresContainer.Add(new DrawableTopScore(userScoreInfo, userScore.Position));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScoresContainer()
|
public ScoresContainer()
|
||||||
@ -160,7 +180,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
background.Colour = colourProvider.Background5;
|
background.Colour = colourProvider.Background5;
|
||||||
|
|
||||||
user.BindTo(api.LocalUser);
|
user.BindTo(api.LocalUser);
|
||||||
config.BindWith(OsuSetting.ScoreDisplayMode, scoringMode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -173,8 +192,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
|
|
||||||
Beatmap.BindValueChanged(onBeatmapChanged);
|
Beatmap.BindValueChanged(onBeatmapChanged);
|
||||||
user.BindValueChanged(onUserChanged, true);
|
user.BindValueChanged(onUserChanged, true);
|
||||||
|
|
||||||
scoringMode.BindValueChanged(_ => displayScores(scores));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onBeatmapChanged(ValueChangedEvent<BeatmapInfo> beatmap)
|
private void onBeatmapChanged(ValueChangedEvent<BeatmapInfo> beatmap)
|
||||||
@ -246,39 +263,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
api.Queue(getScoresRequest);
|
api.Queue(getScoresRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void displayScores(APILegacyScores newScores)
|
|
||||||
{
|
|
||||||
Schedule(() =>
|
|
||||||
{
|
|
||||||
topScoresContainer.Clear();
|
|
||||||
|
|
||||||
if (newScores?.Scores.Any() != true)
|
|
||||||
{
|
|
||||||
scoreTable.ClearScores();
|
|
||||||
scoreTable.Hide();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var scoreInfos = newScores.Scores.Select(s => s.CreateScoreInfo(rulesets))
|
|
||||||
.OrderByDescending(s => scoreManager.GetTotalScore(s))
|
|
||||||
.ThenBy(s => s.OnlineScoreID)
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
var topScore = scoreInfos.First();
|
|
||||||
|
|
||||||
scoreTable.DisplayScores(scoreInfos, topScore.Beatmap?.Status.GrantsPerformancePoints() == true);
|
|
||||||
scoreTable.Show();
|
|
||||||
|
|
||||||
var userScore = newScores.UserScore;
|
|
||||||
var userScoreInfo = userScore?.Score.CreateScoreInfo(rulesets);
|
|
||||||
|
|
||||||
topScoresContainer.Add(new DrawableTopScore(topScore));
|
|
||||||
|
|
||||||
if (userScoreInfo != null && userScoreInfo.OnlineScoreID != topScore.OnlineScoreID)
|
|
||||||
topScoresContainer.Add(new DrawableTopScore(userScoreInfo, userScore.Position));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool userIsSupporter => api.IsLoggedIn && api.LocalUser.Value.IsSupporter;
|
private bool userIsSupporter => api.IsLoggedIn && api.LocalUser.Value.IsSupporter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,9 +10,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Configuration;
|
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Scoring;
|
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
@ -292,26 +290,15 @@ namespace osu.Game.Screens.Ranking
|
|||||||
{
|
{
|
||||||
public override IEnumerable<Drawable> FlowingChildren => applySorting(AliveInternalChildren);
|
public override IEnumerable<Drawable> FlowingChildren => applySorting(AliveInternalChildren);
|
||||||
|
|
||||||
private readonly Bindable<ScoringMode> scoringMode = new Bindable<ScoringMode>();
|
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private ScoreManager scoreManager { get; set; }
|
private ScoreManager scoreManager { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuConfigManager configManager)
|
|
||||||
{
|
|
||||||
configManager.BindWith(OsuSetting.ScoreDisplayMode, scoringMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
scoringMode.BindValueChanged(mode =>
|
foreach (var c in Children)
|
||||||
{
|
SetLayoutPosition(c, scoreManager.GetTotalScore(c.Panel.Score));
|
||||||
foreach (var c in Children)
|
|
||||||
SetLayoutPosition(c, scoreManager.GetTotalScore(c.Panel.Score));
|
|
||||||
}, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetPanelIndex(ScoreInfo score) => applySorting(Children).TakeWhile(s => s.Panel.Score != score).Count();
|
public int GetPanelIndex(ScoreInfo score) => applySorting(Children).TakeWhile(s => s.Panel.Score != score).Count();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user