mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 08:22:56 +08:00
Merge branch 'master' into realm-importer
This commit is contained in:
commit
30af27e561
@ -20,14 +20,15 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class TestSceneAllRulesetPlayers : RateAdjustedBeatmapTestScene
|
public abstract class TestSceneAllRulesetPlayers : RateAdjustedBeatmapTestScene
|
||||||
{
|
{
|
||||||
protected Player Player;
|
protected Player Player { get; private set; }
|
||||||
|
|
||||||
|
protected OsuConfigManager Config { get; private set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(RulesetStore rulesets)
|
private void load(RulesetStore rulesets)
|
||||||
{
|
{
|
||||||
OsuConfigManager manager;
|
Dependencies.Cache(Config = new OsuConfigManager(LocalStorage));
|
||||||
Dependencies.Cache(manager = new OsuConfigManager(LocalStorage));
|
Config.GetBindable<double>(OsuSetting.DimLevel).Value = 1.0;
|
||||||
manager.GetBindable<double>(OsuSetting.DimLevel).Value = 1.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
// 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;
|
||||||
|
using NUnit.Framework;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
@ -17,6 +19,14 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
return new FailPlayer();
|
return new FailPlayer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestOsuWithoutRedTint()
|
||||||
|
{
|
||||||
|
AddStep("Disable red tint", () => Config.SetValue(OsuSetting.FadePlayfieldWhenHealthLow, false));
|
||||||
|
TestOsu();
|
||||||
|
AddStep("Enable red tint", () => Config.SetValue(OsuSetting.FadePlayfieldWhenHealthLow, true));
|
||||||
|
}
|
||||||
|
|
||||||
protected override void AddCheckSteps()
|
protected override void AddCheckSteps()
|
||||||
{
|
{
|
||||||
AddUntilStep("wait for fail", () => Player.HasFailed);
|
AddUntilStep("wait for fail", () => Player.HasFailed);
|
||||||
|
@ -227,12 +227,13 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddAssert("ensure no submission", () => Player.SubmittedScore == null);
|
AddAssert("ensure no submission", () => Player.SubmittedScore == null);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[TestCase(null)]
|
||||||
public void TestNoSubmissionOnCustomRuleset()
|
[TestCase(10)]
|
||||||
|
public void TestNoSubmissionOnCustomRuleset(int? rulesetId)
|
||||||
{
|
{
|
||||||
prepareTokenResponse(true);
|
prepareTokenResponse(true);
|
||||||
|
|
||||||
createPlayerTest(false, createRuleset: () => new OsuRuleset { RulesetInfo = { ID = 10 } });
|
createPlayerTest(false, createRuleset: () => new OsuRuleset { RulesetInfo = { ID = rulesetId } });
|
||||||
|
|
||||||
AddUntilStep("wait for token request", () => Player.TokenCreationRequested);
|
AddUntilStep("wait for token request", () => Player.TokenCreationRequested);
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ using osu.Framework.Graphics.Shapes;
|
|||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Audio.Effects;
|
using osu.Game.Audio.Effects;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
@ -35,7 +36,7 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private Container filters;
|
private Container filters;
|
||||||
|
|
||||||
private Box failFlash;
|
private Box redFlashLayer;
|
||||||
|
|
||||||
private Track track;
|
private Track track;
|
||||||
|
|
||||||
@ -46,6 +47,9 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
private Sample failSample;
|
private Sample failSample;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuConfigManager config { get; set; }
|
||||||
|
|
||||||
protected override Container<Drawable> Content { get; } = new Container
|
protected override Container<Drawable> Content { get; } = new Container
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
@ -77,7 +81,7 @@ namespace osu.Game.Screens.Play
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Content,
|
Content,
|
||||||
failFlash = new Box
|
redFlashLayer = new Box
|
||||||
{
|
{
|
||||||
Colour = Color4.Red,
|
Colour = Color4.Red,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -114,7 +118,8 @@ namespace osu.Game.Screens.Play
|
|||||||
applyToPlayfield(drawableRuleset.Playfield);
|
applyToPlayfield(drawableRuleset.Playfield);
|
||||||
drawableRuleset.Playfield.HitObjectContainer.FadeOut(duration / 2);
|
drawableRuleset.Playfield.HitObjectContainer.FadeOut(duration / 2);
|
||||||
|
|
||||||
failFlash.FadeOutFromOne(1000);
|
if (config.Get<bool>(OsuSetting.FadePlayfieldWhenHealthLow))
|
||||||
|
redFlashLayer.FadeOutFromOne(1000);
|
||||||
|
|
||||||
Content.Masking = true;
|
Content.Masking = true;
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
// 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;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -218,12 +217,11 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
Score = CreateScore(playableBeatmap);
|
Score = CreateScore(playableBeatmap);
|
||||||
|
|
||||||
Debug.Assert(ruleset.RulesetInfo.ID != null);
|
|
||||||
|
|
||||||
// ensure the score is in a consistent state with the current player.
|
// ensure the score is in a consistent state with the current player.
|
||||||
Score.ScoreInfo.BeatmapInfo = Beatmap.Value.BeatmapInfo;
|
Score.ScoreInfo.BeatmapInfo = Beatmap.Value.BeatmapInfo;
|
||||||
Score.ScoreInfo.Ruleset = ruleset.RulesetInfo;
|
Score.ScoreInfo.Ruleset = ruleset.RulesetInfo;
|
||||||
Score.ScoreInfo.RulesetID = ruleset.RulesetInfo.ID.Value;
|
if (ruleset.RulesetInfo.ID != null)
|
||||||
|
Score.ScoreInfo.RulesetID = ruleset.RulesetInfo.ID.Value;
|
||||||
Score.ScoreInfo.Mods = gameplayMods;
|
Score.ScoreInfo.Mods = gameplayMods;
|
||||||
|
|
||||||
dependencies.CacheAs(GameplayState = new GameplayState(playableBeatmap, ruleset, gameplayMods, Score));
|
dependencies.CacheAs(GameplayState = new GameplayState(playableBeatmap, ruleset, gameplayMods, Score));
|
||||||
|
Loading…
Reference in New Issue
Block a user