mirror of
https://github.com/osukey/osukey.git
synced 2025-06-22 19:57:56 +09:00
Use BindableLong
instead of BindableInt
for user score tracking
This commit is contained in:
parent
22c75a518e
commit
8b1cee75fa
@ -26,10 +26,10 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
var beatmapInfo = CreateBeatmap(rulesetInfo).BeatmapInfo;
|
var beatmapInfo = CreateBeatmap(rulesetInfo).BeatmapInfo;
|
||||||
var score = TestResources.CreateTestScoreInfo(beatmapInfo);
|
var score = TestResources.CreateTestScoreInfo(beatmapInfo);
|
||||||
|
|
||||||
SortedDictionary<int, BindableInt> teamScores = new SortedDictionary<int, BindableInt>
|
SortedDictionary<int, BindableLong> teamScores = new SortedDictionary<int, BindableLong>
|
||||||
{
|
{
|
||||||
{ 0, new BindableInt(team1Score) },
|
{ 0, new BindableLong(team1Score) },
|
||||||
{ 1, new BindableInt(team2Score) }
|
{ 1, new BindableLong(team2Score) }
|
||||||
};
|
};
|
||||||
|
|
||||||
Stack.Push(screen = new MultiplayerTeamResultsScreen(score, 1, new PlaylistItem(beatmapInfo), teamScores));
|
Stack.Push(screen = new MultiplayerTeamResultsScreen(score, 1, new PlaylistItem(beatmapInfo), teamScores));
|
||||||
|
@ -24,12 +24,12 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
|||||||
{
|
{
|
||||||
public class MultiplayerTeamResultsScreen : MultiplayerResultsScreen
|
public class MultiplayerTeamResultsScreen : MultiplayerResultsScreen
|
||||||
{
|
{
|
||||||
private readonly SortedDictionary<int, BindableInt> teamScores;
|
private readonly SortedDictionary<int, BindableLong> teamScores;
|
||||||
|
|
||||||
private Container winnerBackground;
|
private Container winnerBackground;
|
||||||
private Drawable winnerText;
|
private Drawable winnerText;
|
||||||
|
|
||||||
public MultiplayerTeamResultsScreen(ScoreInfo score, long roomId, PlaylistItem playlistItem, SortedDictionary<int, BindableInt> teamScores)
|
public MultiplayerTeamResultsScreen(ScoreInfo score, long roomId, PlaylistItem playlistItem, SortedDictionary<int, BindableLong> teamScores)
|
||||||
: base(score, roomId, playlistItem)
|
: base(score, roomId, playlistItem)
|
||||||
{
|
{
|
||||||
if (teamScores.Count != 2)
|
if (teamScores.Count != 2)
|
||||||
|
@ -19,8 +19,8 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
private const float bar_height = 18;
|
private const float bar_height = 18;
|
||||||
private const float font_size = 50;
|
private const float font_size = 50;
|
||||||
|
|
||||||
public BindableInt Team1Score = new BindableInt();
|
public BindableLong Team1Score = new BindableLong();
|
||||||
public BindableInt Team2Score = new BindableInt();
|
public BindableLong Team2Score = new BindableLong();
|
||||||
|
|
||||||
protected MatchScoreCounter Score1Text;
|
protected MatchScoreCounter Score1Text;
|
||||||
protected MatchScoreCounter Score2Text;
|
protected MatchScoreCounter Score2Text;
|
||||||
@ -133,7 +133,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
var winningBar = Team1Score.Value > Team2Score.Value ? score1Bar : score2Bar;
|
var winningBar = Team1Score.Value > Team2Score.Value ? score1Bar : score2Bar;
|
||||||
var losingBar = Team1Score.Value <= Team2Score.Value ? score1Bar : score2Bar;
|
var losingBar = Team1Score.Value <= Team2Score.Value ? score1Bar : score2Bar;
|
||||||
|
|
||||||
int diff = Math.Max(Team1Score.Value, Team2Score.Value) - Math.Min(Team1Score.Value, Team2Score.Value);
|
long diff = Math.Max(Team1Score.Value, Team2Score.Value) - Math.Min(Team1Score.Value, Team2Score.Value);
|
||||||
|
|
||||||
losingBar.ResizeWidthTo(0, 400, Easing.OutQuint);
|
losingBar.ResizeWidthTo(0, 400, Easing.OutQuint);
|
||||||
winningBar.ResizeWidthTo(Math.Min(0.4f, MathF.Pow(diff / 1500000f, 0.5f) / 2), 400, Easing.OutQuint);
|
winningBar.ResizeWidthTo(Math.Min(0.4f, MathF.Pow(diff / 1500000f, 0.5f) / 2), 400, Easing.OutQuint);
|
||||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
protected readonly Dictionary<int, TrackedUserData> UserScores = new Dictionary<int, TrackedUserData>();
|
protected readonly Dictionary<int, TrackedUserData> UserScores = new Dictionary<int, TrackedUserData>();
|
||||||
|
|
||||||
public readonly SortedDictionary<int, BindableInt> TeamScores = new SortedDictionary<int, BindableInt>();
|
public readonly SortedDictionary<int, BindableLong> TeamScores = new SortedDictionary<int, BindableLong>();
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; }
|
private OsuColour colours { get; set; }
|
||||||
@ -82,7 +82,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
UserScores[user.UserID] = trackedUser;
|
UserScores[user.UserID] = trackedUser;
|
||||||
|
|
||||||
if (trackedUser.Team is int team && !TeamScores.ContainsKey(team))
|
if (trackedUser.Team is int team && !TeamScores.ContainsKey(team))
|
||||||
TeamScores.Add(team, new BindableInt());
|
TeamScores.Add(team, new BindableLong());
|
||||||
}
|
}
|
||||||
|
|
||||||
userLookupCache.GetUsersAsync(playingUsers.Select(u => u.UserID).ToArray()).ContinueWith(task => Schedule(() =>
|
userLookupCache.GetUsersAsync(playingUsers.Select(u => u.UserID).ToArray()).ContinueWith(task => Schedule(() =>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user