mirror of
https://github.com/ppy/osu.git
synced 2025-03-06 13:47:21 +08:00
Merge branch 'master' into fix-spectator-seeks
This commit is contained in:
commit
9de4d416e2
@ -9,7 +9,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"jetbrains.resharper.globaltools": {
|
"jetbrains.resharper.globaltools": {
|
||||||
"version": "2020.3.2",
|
"version": "2022.1.0-eap10",
|
||||||
"commands": [
|
"commands": [
|
||||||
"jb"
|
"jb"
|
||||||
]
|
]
|
||||||
|
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@ -120,6 +120,12 @@ jobs:
|
|||||||
- name: Restore Packages
|
- name: Restore Packages
|
||||||
run: dotnet restore
|
run: dotnet restore
|
||||||
|
|
||||||
|
- name: Restore inspectcode cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{ github.workspace }}/inspectcode
|
||||||
|
key: inspectcode-${{ hashFiles('.config/dotnet-tools.json') }}-${{ hashFiles('.github/workflows/ci.yml' ) }}
|
||||||
|
|
||||||
- name: CodeFileSanity
|
- name: CodeFileSanity
|
||||||
run: |
|
run: |
|
||||||
# TODO: Add ignore filters and GitHub Workflow Command Reporting in CFS. That way we don't have to do this workaround.
|
# TODO: Add ignore filters and GitHub Workflow Command Reporting in CFS. That way we don't have to do this workaround.
|
||||||
@ -138,7 +144,7 @@ jobs:
|
|||||||
# run: dotnet format --dry-run --check
|
# run: dotnet format --dry-run --check
|
||||||
|
|
||||||
- name: InspectCode
|
- name: InspectCode
|
||||||
run: dotnet jb inspectcode $(pwd)/osu.Desktop.slnf --output=$(pwd)/inspectcodereport.xml --cachesDir=$(pwd)/inspectcode --verbosity=WARN
|
run: dotnet jb inspectcode $(pwd)/osu.Desktop.slnf --no-build --output="inspectcodereport.xml" --caches-home="inspectcode" --verbosity=WARN
|
||||||
|
|
||||||
- name: NVika
|
- name: NVika
|
||||||
run: dotnet nvika parsereport "${{github.workspace}}/inspectcodereport.xml" --treatwarningsaserrors
|
run: dotnet nvika parsereport "${{github.workspace}}/inspectcodereport.xml" --treatwarningsaserrors
|
||||||
|
@ -5,7 +5,7 @@ dotnet tool restore
|
|||||||
# - cmd: dotnet format --dry-run --check
|
# - cmd: dotnet format --dry-run --check
|
||||||
|
|
||||||
dotnet CodeFileSanity
|
dotnet CodeFileSanity
|
||||||
dotnet jb inspectcode "osu.Desktop.slnf" --output="inspectcodereport.xml" --caches-home="inspectcode" --verbosity=WARN
|
dotnet jb inspectcode "osu.Desktop.slnf" --no-build --output="inspectcodereport.xml" --caches-home="inspectcode" --verbosity=WARN
|
||||||
dotnet nvika parsereport "inspectcodereport.xml" --treatwarningsaserrors
|
dotnet nvika parsereport "inspectcodereport.xml" --treatwarningsaserrors
|
||||||
|
|
||||||
exit $LASTEXITCODE
|
exit $LASTEXITCODE
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
|
|
||||||
dotnet tool restore
|
dotnet tool restore
|
||||||
dotnet CodeFileSanity
|
dotnet CodeFileSanity
|
||||||
dotnet jb inspectcode "osu.Desktop.slnf" --output="inspectcodereport.xml" --caches-home="inspectcode" --verbosity=WARN
|
dotnet jb inspectcode "osu.Desktop.slnf" --no-build --output="inspectcodereport.xml" --caches-home="inspectcode" --verbosity=WARN
|
||||||
dotnet nvika parsereport "inspectcodereport.xml" --treatwarningsaserrors
|
dotnet nvika parsereport "inspectcodereport.xml" --treatwarningsaserrors
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// 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 System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -25,6 +26,6 @@ namespace osu.Game.Rulesets.EmptyFreeform
|
|||||||
|
|
||||||
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate) => Enumerable.Empty<DifficultyHitObject>();
|
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate) => Enumerable.Empty<DifficultyHitObject>();
|
||||||
|
|
||||||
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => new Skill[0];
|
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => Array.Empty<Skill>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// 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 System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -25,6 +26,6 @@ namespace osu.Game.Rulesets.Pippidon
|
|||||||
|
|
||||||
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate) => Enumerable.Empty<DifficultyHitObject>();
|
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate) => Enumerable.Empty<DifficultyHitObject>();
|
||||||
|
|
||||||
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => new Skill[0];
|
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => Array.Empty<Skill>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// 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 System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -25,6 +26,6 @@ namespace osu.Game.Rulesets.EmptyScrolling
|
|||||||
|
|
||||||
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate) => Enumerable.Empty<DifficultyHitObject>();
|
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate) => Enumerable.Empty<DifficultyHitObject>();
|
||||||
|
|
||||||
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => new Skill[0];
|
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => Array.Empty<Skill>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// 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 System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
@ -25,6 +26,6 @@ namespace osu.Game.Rulesets.Pippidon
|
|||||||
|
|
||||||
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate) => Enumerable.Empty<DifficultyHitObject>();
|
protected override IEnumerable<DifficultyHitObject> CreateDifficultyHitObjects(IBeatmap beatmap, double clockRate) => Enumerable.Empty<DifficultyHitObject>();
|
||||||
|
|
||||||
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => new Skill[0];
|
protected override Skill[] CreateSkills(IBeatmap beatmap, Mod[] mods, double clockRate) => Array.Empty<Skill>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,9 +28,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
|
|||||||
|
|
||||||
// flying hits all land in one common scrolling container (and stay there for rewind purposes),
|
// flying hits all land in one common scrolling container (and stay there for rewind purposes),
|
||||||
// so we need to manually get the latest one.
|
// so we need to manually get the latest one.
|
||||||
flyingHit = this.ChildrenOfType<DrawableFlyingHit>()
|
flyingHit = this.ChildrenOfType<DrawableFlyingHit>().MaxBy(h => h.HitObject.StartTime);
|
||||||
.OrderByDescending(h => h.HitObject.StartTime)
|
|
||||||
.FirstOrDefault();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
AddAssert("hit type is correct", () => flyingHit.HitObject.Type == hitType);
|
AddAssert("hit type is correct", () => flyingHit.HitObject.Type == hitType);
|
||||||
|
@ -33,9 +33,10 @@ namespace osu.Game.Tests.Online
|
|||||||
|
|
||||||
var converted = deserialized?.ToMod(new TestRuleset());
|
var converted = deserialized?.ToMod(new TestRuleset());
|
||||||
|
|
||||||
|
Assert.NotNull(converted);
|
||||||
Assert.That(converted, Is.TypeOf(typeof(UnknownMod)));
|
Assert.That(converted, Is.TypeOf(typeof(UnknownMod)));
|
||||||
Assert.That(converted?.Type, Is.EqualTo(ModType.System));
|
Assert.That(converted.Type, Is.EqualTo(ModType.System));
|
||||||
Assert.That(converted?.Acronym, Is.EqualTo("WNG??"));
|
Assert.That(converted.Acronym, Is.EqualTo("WNG??"));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -25,7 +25,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddUntilStep("get variables", () =>
|
AddUntilStep("get variables", () =>
|
||||||
{
|
{
|
||||||
sampleDisabler = Player;
|
sampleDisabler = Player;
|
||||||
slider = Player.ChildrenOfType<DrawableSlider>().OrderBy(s => s.HitObject.StartTime).FirstOrDefault();
|
slider = Player.ChildrenOfType<DrawableSlider>().MinBy(s => s.HitObject.StartTime);
|
||||||
samples = slider?.ChildrenOfType<PoolableSkinnableSample>().ToArray();
|
samples = slider?.ChildrenOfType<PoolableSkinnableSample>().ToArray();
|
||||||
|
|
||||||
return slider != null;
|
return slider != null;
|
||||||
|
@ -26,6 +26,8 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestSceneReplayDownloadButton : OsuManualInputManagerTestScene
|
public class TestSceneReplayDownloadButton : OsuManualInputManagerTestScene
|
||||||
{
|
{
|
||||||
|
private const long online_score_id = 2553163309;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private RulesetStore rulesets { get; set; }
|
private RulesetStore rulesets { get; set; }
|
||||||
|
|
||||||
@ -43,6 +45,15 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
beatmapManager.Import(TestResources.GetQuickTestBeatmapForImport()).WaitSafely();
|
beatmapManager.Import(TestResources.GetQuickTestBeatmapForImport()).WaitSafely();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SetUpSteps]
|
||||||
|
public void SetUpSteps()
|
||||||
|
{
|
||||||
|
AddStep("delete previous imports", () =>
|
||||||
|
{
|
||||||
|
scoreManager.Delete(s => s.OnlineID == online_score_id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestDisplayStates()
|
public void TestDisplayStates()
|
||||||
{
|
{
|
||||||
@ -180,7 +191,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
return new APIScore
|
return new APIScore
|
||||||
{
|
{
|
||||||
OnlineID = 2553163309,
|
OnlineID = online_score_id,
|
||||||
RulesetID = 0,
|
RulesetID = 0,
|
||||||
Beatmap = CreateAPIBeatmapSet(new OsuRuleset().RulesetInfo).Beatmaps.First(),
|
Beatmap = CreateAPIBeatmapSet(new OsuRuleset().RulesetInfo).Beatmaps.First(),
|
||||||
HasReplay = replayAvailable,
|
HasReplay = replayAvailable,
|
||||||
|
@ -27,6 +27,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
public abstract class MultiplayerGameplayLeaderboardTestScene : OsuTestScene
|
public abstract class MultiplayerGameplayLeaderboardTestScene : OsuTestScene
|
||||||
{
|
{
|
||||||
|
private const int total_users = 16;
|
||||||
|
|
||||||
protected readonly BindableList<MultiplayerRoomUser> MultiplayerUsers = new BindableList<MultiplayerRoomUser>();
|
protected readonly BindableList<MultiplayerRoomUser> MultiplayerUsers = new BindableList<MultiplayerRoomUser>();
|
||||||
|
|
||||||
protected MultiplayerGameplayLeaderboard Leaderboard { get; private set; }
|
protected MultiplayerGameplayLeaderboard Leaderboard { get; private set; }
|
||||||
@ -84,7 +86,11 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
[SetUpSteps]
|
[SetUpSteps]
|
||||||
public virtual void SetUpSteps()
|
public virtual void SetUpSteps()
|
||||||
{
|
{
|
||||||
AddStep("reset counts", () => spectatorClient.Invocations.Clear());
|
AddStep("reset counts", () =>
|
||||||
|
{
|
||||||
|
spectatorClient.Invocations.Clear();
|
||||||
|
lastHeaders.Clear();
|
||||||
|
});
|
||||||
|
|
||||||
AddStep("set local user", () => ((DummyAPIAccess)API).LocalUser.Value = new APIUser
|
AddStep("set local user", () => ((DummyAPIAccess)API).LocalUser.Value = new APIUser
|
||||||
{
|
{
|
||||||
@ -94,7 +100,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
AddStep("populate users", () =>
|
AddStep("populate users", () =>
|
||||||
{
|
{
|
||||||
MultiplayerUsers.Clear();
|
MultiplayerUsers.Clear();
|
||||||
for (int i = 0; i < 16; i++)
|
for (int i = 0; i < total_users; i++)
|
||||||
MultiplayerUsers.Add(CreateUser(i));
|
MultiplayerUsers.Add(CreateUser(i));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Utils;
|
|
||||||
using osu.Game.Online.Multiplayer;
|
using osu.Game.Online.Multiplayer;
|
||||||
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
|
using osu.Game.Online.Multiplayer.MatchTypes.TeamVersus;
|
||||||
using osu.Game.Rulesets.Osu.Scoring;
|
using osu.Game.Rulesets.Osu.Scoring;
|
||||||
@ -14,12 +13,14 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
{
|
{
|
||||||
public class TestSceneMultiplayerGameplayLeaderboardTeams : MultiplayerGameplayLeaderboardTestScene
|
public class TestSceneMultiplayerGameplayLeaderboardTeams : MultiplayerGameplayLeaderboardTestScene
|
||||||
{
|
{
|
||||||
|
private int team;
|
||||||
|
|
||||||
protected override MultiplayerRoomUser CreateUser(int userId)
|
protected override MultiplayerRoomUser CreateUser(int userId)
|
||||||
{
|
{
|
||||||
var user = base.CreateUser(userId);
|
var user = base.CreateUser(userId);
|
||||||
user.MatchState = new TeamVersusUserState
|
user.MatchState = new TeamVersusUserState
|
||||||
{
|
{
|
||||||
TeamID = RNG.Next(0, 2)
|
TeamID = team++ % 2
|
||||||
};
|
};
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
@ -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));
|
||||||
|
@ -36,11 +36,7 @@ namespace osu.Game.Tournament.Screens.Ladder.Components
|
|||||||
bool progressionToRight = q2.TopLeft.X > q1.TopLeft.X;
|
bool progressionToRight = q2.TopLeft.X > q1.TopLeft.X;
|
||||||
|
|
||||||
if (!progressionToRight)
|
if (!progressionToRight)
|
||||||
{
|
(q2, q1) = (q1, q2);
|
||||||
var temp = q2;
|
|
||||||
q2 = q1;
|
|
||||||
q1 = temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
var c1 = getCenteredVector(q1.TopRight, q1.BottomRight) + new Vector2(padding, 0);
|
var c1 = getCenteredVector(q1.TopRight, q1.BottomRight) + new Vector2(padding, 0);
|
||||||
var c2 = getCenteredVector(q2.TopLeft, q2.BottomLeft) - new Vector2(padding, 0);
|
var c2 = getCenteredVector(q2.TopLeft, q2.BottomLeft) - new Vector2(padding, 0);
|
||||||
|
@ -70,7 +70,10 @@ namespace osu.Game.Graphics.Containers
|
|||||||
confirming = false;
|
confirming = false;
|
||||||
Fired = false;
|
Fired = false;
|
||||||
|
|
||||||
this.TransformBindableTo(Progress, 0, fadeout_delay, Easing.Out);
|
this
|
||||||
|
.TransformBindableTo(Progress, Progress.Value)
|
||||||
|
.Delay(200)
|
||||||
|
.TransformBindableTo(Progress, 0, fadeout_delay, Easing.InSine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,10 @@ namespace osu.Game.Online
|
|||||||
Downloader.DownloadBegan += downloadBegan;
|
Downloader.DownloadBegan += downloadBegan;
|
||||||
Downloader.DownloadFailed += downloadFailed;
|
Downloader.DownloadFailed += downloadFailed;
|
||||||
|
|
||||||
realmSubscription = realm.RegisterForNotifications(r => r.All<ScoreInfo>().Where(s => ((s.OnlineID > 0 && s.OnlineID == TrackedItem.OnlineID) || s.Hash == TrackedItem.Hash) && !s.DeletePending), (items, changes, ___) =>
|
realmSubscription = realm.RegisterForNotifications(r => r.All<ScoreInfo>().Where(s =>
|
||||||
|
((s.OnlineID > 0 && s.OnlineID == TrackedItem.OnlineID)
|
||||||
|
|| (!string.IsNullOrEmpty(s.Hash) && s.Hash == TrackedItem.Hash))
|
||||||
|
&& !s.DeletePending), (items, changes, ___) =>
|
||||||
{
|
{
|
||||||
if (items.Any())
|
if (items.Any())
|
||||||
Schedule(() => UpdateState(DownloadState.LocallyAvailable));
|
Schedule(() => UpdateState(DownloadState.LocallyAvailable));
|
||||||
|
@ -253,7 +253,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
|
|
||||||
noScoresPlaceholder.Hide();
|
noScoresPlaceholder.Hide();
|
||||||
|
|
||||||
if (Beatmap.Value == null || Beatmap.Value.OnlineID <= 0 || (Beatmap.Value?.BeatmapSet as IBeatmapSetOnlineInfo)?.Status <= BeatmapOnlineStatus.Pending)
|
if (Beatmap.Value == null || Beatmap.Value.OnlineID <= 0 || (Beatmap.Value.BeatmapSet as IBeatmapSetOnlineInfo)?.Status <= BeatmapOnlineStatus.Pending)
|
||||||
{
|
{
|
||||||
Scores = null;
|
Scores = null;
|
||||||
Hide();
|
Hide();
|
||||||
|
@ -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)
|
||||||
|
@ -106,7 +106,7 @@ namespace osu.Game.Screens.Play
|
|||||||
new Sprite
|
new Sprite
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Texture = beatmap?.Background,
|
Texture = beatmap.Background,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
FillMode = FillMode.Fill,
|
FillMode = FillMode.Fill,
|
||||||
@ -126,7 +126,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
new OsuSpriteText
|
new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = beatmap?.BeatmapInfo?.DifficultyName,
|
Text = beatmap.BeatmapInfo.DifficultyName,
|
||||||
Font = OsuFont.GetFont(size: 26, italics: true),
|
Font = OsuFont.GetFont(size: 26, italics: true),
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
|
@ -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; }
|
||||||
@ -75,21 +75,27 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
foreach (var user in playingUsers)
|
foreach (var user in playingUsers)
|
||||||
{
|
{
|
||||||
var trackedUser = CreateUserData(user, ruleset, scoreProcessor);
|
var trackedUser = CreateUserData(user, ruleset, scoreProcessor);
|
||||||
|
|
||||||
trackedUser.ScoringMode.BindTo(scoringMode);
|
trackedUser.ScoringMode.BindTo(scoringMode);
|
||||||
|
trackedUser.Score.BindValueChanged(_ => Scheduler.AddOnce(updateTotals));
|
||||||
|
|
||||||
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(() =>
|
||||||
{
|
{
|
||||||
var users = task.GetResultSafely();
|
var users = task.GetResultSafely();
|
||||||
|
|
||||||
foreach (var user in users)
|
for (int i = 0; i < users.Length; i++)
|
||||||
{
|
{
|
||||||
if (user == null)
|
var user = users[i] ?? new APIUser
|
||||||
continue;
|
{
|
||||||
|
Id = playingUsers[i].UserID,
|
||||||
|
Username = "Unknown user",
|
||||||
|
};
|
||||||
|
|
||||||
var trackedUser = UserScores[user.Id];
|
var trackedUser = UserScores[user.Id];
|
||||||
|
|
||||||
@ -175,8 +181,6 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
trackedData.Frames.Add(new TimedFrame(bundle.Frames.First().Time, bundle.Header));
|
trackedData.Frames.Add(new TimedFrame(bundle.Frames.First().Time, bundle.Header));
|
||||||
trackedData.UpdateScore();
|
trackedData.UpdateScore();
|
||||||
|
|
||||||
updateTotals();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
private void updateTotals()
|
private void updateTotals()
|
||||||
|
@ -351,7 +351,6 @@ namespace osu.Game.Stores
|
|||||||
|
|
||||||
using (var transaction = realm.BeginWrite())
|
using (var transaction = realm.BeginWrite())
|
||||||
{
|
{
|
||||||
if (existing.DeletePending)
|
|
||||||
UndeleteForReuse(existing);
|
UndeleteForReuse(existing);
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
}
|
}
|
||||||
@ -388,9 +387,7 @@ namespace osu.Game.Stores
|
|||||||
{
|
{
|
||||||
LogForModel(item, @$"Found existing {HumanisedModelName} for {item} (ID {existing.ID}) – skipping import.");
|
LogForModel(item, @$"Found existing {HumanisedModelName} for {item} (ID {existing.ID}) – skipping import.");
|
||||||
|
|
||||||
if (existing.DeletePending)
|
|
||||||
UndeleteForReuse(existing);
|
UndeleteForReuse(existing);
|
||||||
|
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
|
|
||||||
return existing.ToLive(Realm);
|
return existing.ToLive(Realm);
|
||||||
@ -536,6 +533,10 @@ namespace osu.Game.Stores
|
|||||||
/// <param name="existing">The existing model.</param>
|
/// <param name="existing">The existing model.</param>
|
||||||
protected virtual void UndeleteForReuse(TModel existing)
|
protected virtual void UndeleteForReuse(TModel existing)
|
||||||
{
|
{
|
||||||
|
if (!existing.DeletePending)
|
||||||
|
return;
|
||||||
|
|
||||||
|
LogForModel(existing, $@"Existing {HumanisedModelName}'s deletion flag has been removed to allow for reuse.");
|
||||||
existing.DeletePending = false;
|
existing.DeletePending = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,6 +118,7 @@
|
|||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MissingLinebreak/@EntryIndexedValue">WARNING</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MissingLinebreak/@EntryIndexedValue">WARNING</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MissingSpace/@EntryIndexedValue">WARNING</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MissingSpace/@EntryIndexedValue">WARNING</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MoreSpecificForeachVariableTypeAvailable/@EntryIndexedValue">WARNING</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MoreSpecificForeachVariableTypeAvailable/@EntryIndexedValue">WARNING</s:String>
|
||||||
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MoveVariableDeclarationInsideLoopCondition/@EntryIndexedValue">HINT</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MultipleSpaces/@EntryIndexedValue">WARNING</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MultipleSpaces/@EntryIndexedValue">WARNING</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MultipleStatementsOnOneLine/@EntryIndexedValue">WARNING</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MultipleStatementsOnOneLine/@EntryIndexedValue">WARNING</s:String>
|
||||||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MultipleTypeMembersOnOneLine/@EntryIndexedValue">WARNING</s:String>
|
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MultipleTypeMembersOnOneLine/@EntryIndexedValue">WARNING</s:String>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user