mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 01:23:05 +08:00
Merge branch 'master' into tourney-simplify-video-spec
This commit is contained in:
commit
643b25e484
@ -52,6 +52,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.304.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.304.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.302.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.305.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -3,10 +3,8 @@
|
|||||||
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using osu.Game.Storyboards;
|
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Gameplay
|
namespace osu.Game.Tests.Visual.Gameplay
|
||||||
{
|
{
|
||||||
@ -15,8 +13,6 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
protected new TestPlayer Player => (TestPlayer)base.Player;
|
protected new TestPlayer Player => (TestPlayer)base.Player;
|
||||||
|
|
||||||
private ClockBackedTestWorkingBeatmap.TrackVirtualManual track;
|
|
||||||
|
|
||||||
protected override Player CreatePlayer(Ruleset ruleset)
|
protected override Player CreatePlayer(Ruleset ruleset)
|
||||||
{
|
{
|
||||||
SelectedMods.Value = SelectedMods.Value.Concat(new[] { ruleset.GetAutoplayMod() }).ToArray();
|
SelectedMods.Value = SelectedMods.Value.Concat(new[] { ruleset.GetAutoplayMod() }).ToArray();
|
||||||
@ -27,17 +23,12 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
AddUntilStep("score above zero", () => Player.ScoreProcessor.TotalScore.Value > 0);
|
AddUntilStep("score above zero", () => Player.ScoreProcessor.TotalScore.Value > 0);
|
||||||
AddUntilStep("key counter counted keys", () => Player.HUDOverlay.KeyCounter.Children.Any(kc => kc.CountPresses > 2));
|
AddUntilStep("key counter counted keys", () => Player.HUDOverlay.KeyCounter.Children.Any(kc => kc.CountPresses > 2));
|
||||||
AddStep("rewind", () => track.Seek(-10000));
|
AddStep("seek to break time", () => Player.GameplayClockContainer.Seek(Player.BreakOverlay.Breaks.First().StartTime));
|
||||||
|
AddUntilStep("wait for seek to complete", () =>
|
||||||
|
Player.HUDOverlay.Progress.ReferenceClock.CurrentTime >= Player.BreakOverlay.Breaks.First().StartTime);
|
||||||
|
AddAssert("test keys not counting", () => !Player.HUDOverlay.KeyCounter.IsCounting);
|
||||||
|
AddStep("rewind", () => Player.GameplayClockContainer.Seek(-80000));
|
||||||
AddUntilStep("key counter reset", () => Player.HUDOverlay.KeyCounter.Children.All(kc => kc.CountPresses == 0));
|
AddUntilStep("key counter reset", () => Player.HUDOverlay.KeyCounter.Children.All(kc => kc.CountPresses == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override WorkingBeatmap CreateWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard = null)
|
|
||||||
{
|
|
||||||
var working = base.CreateWorkingBeatmap(beatmap, storyboard);
|
|
||||||
|
|
||||||
track = (ClockBackedTestWorkingBeatmap.TrackVirtualManual)working.Track;
|
|
||||||
|
|
||||||
return working;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,21 +47,22 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
Key testKey = ((KeyCounterKeyboard)kc.Children.First()).Key;
|
Key testKey = ((KeyCounterKeyboard)kc.Children.First()).Key;
|
||||||
|
|
||||||
AddStep($"Press {testKey} key", () =>
|
void addPressKeyStep()
|
||||||
{
|
{
|
||||||
InputManager.PressKey(testKey);
|
AddStep($"Press {testKey} key", () =>
|
||||||
InputManager.ReleaseKey(testKey);
|
{
|
||||||
});
|
InputManager.PressKey(testKey);
|
||||||
|
InputManager.ReleaseKey(testKey);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
addPressKeyStep();
|
||||||
AddAssert($"Check {testKey} counter after keypress", () => testCounter.CountPresses == 1);
|
AddAssert($"Check {testKey} counter after keypress", () => testCounter.CountPresses == 1);
|
||||||
|
addPressKeyStep();
|
||||||
AddStep($"Press {testKey} key", () =>
|
|
||||||
{
|
|
||||||
InputManager.PressKey(testKey);
|
|
||||||
InputManager.ReleaseKey(testKey);
|
|
||||||
});
|
|
||||||
|
|
||||||
AddAssert($"Check {testKey} counter after keypress", () => testCounter.CountPresses == 2);
|
AddAssert($"Check {testKey} counter after keypress", () => testCounter.CountPresses == 2);
|
||||||
|
AddStep("Disable counting", () => testCounter.IsCounting = false);
|
||||||
|
addPressKeyStep();
|
||||||
|
AddAssert($"Check {testKey} count has not changed", () => testCounter.CountPresses == 2);
|
||||||
|
|
||||||
Add(kc);
|
Add(kc);
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,9 @@ namespace osu.Game.Tournament.Screens
|
|||||||
protected TournamentScreen()
|
protected TournamentScreen()
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
|
FillMode = FillMode.Fit;
|
||||||
|
FillAspectRatio = 16 / 9f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Hide() => this.FadeOut(FADE_DELAY);
|
public override void Hide() => this.FadeOut(FADE_DELAY);
|
||||||
|
@ -184,7 +184,7 @@ namespace osu.Game.Screens.Play
|
|||||||
foreach (var mod in Mods.Value.OfType<IApplicableToHealthProcessor>())
|
foreach (var mod in Mods.Value.OfType<IApplicableToHealthProcessor>())
|
||||||
mod.ApplyToHealthProcessor(HealthProcessor);
|
mod.ApplyToHealthProcessor(HealthProcessor);
|
||||||
|
|
||||||
BreakOverlay.IsBreakTime.ValueChanged += _ => updatePauseOnFocusLostState();
|
BreakOverlay.IsBreakTime.BindValueChanged(onBreakTimeChanged, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addUnderlayComponents(Container target)
|
private void addUnderlayComponents(Container target)
|
||||||
@ -229,7 +229,11 @@ namespace osu.Game.Screens.Play
|
|||||||
IsPaused = { BindTarget = GameplayClockContainer.IsPaused }
|
IsPaused = { BindTarget = GameplayClockContainer.IsPaused }
|
||||||
},
|
},
|
||||||
PlayerSettingsOverlay = { PlaybackSettings = { UserPlaybackRate = { BindTarget = GameplayClockContainer.UserPlaybackRate } } },
|
PlayerSettingsOverlay = { PlaybackSettings = { UserPlaybackRate = { BindTarget = GameplayClockContainer.UserPlaybackRate } } },
|
||||||
KeyCounter = { AlwaysVisible = { BindTarget = DrawableRuleset.HasReplayLoaded } },
|
KeyCounter =
|
||||||
|
{
|
||||||
|
AlwaysVisible = { BindTarget = DrawableRuleset.HasReplayLoaded },
|
||||||
|
IsCounting = false
|
||||||
|
},
|
||||||
RequestSeek = GameplayClockContainer.Seek,
|
RequestSeek = GameplayClockContainer.Seek,
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre
|
Origin = Anchor.Centre
|
||||||
@ -286,6 +290,12 @@ namespace osu.Game.Screens.Play
|
|||||||
HealthProcessor.IsBreakTime.BindTo(BreakOverlay.IsBreakTime);
|
HealthProcessor.IsBreakTime.BindTo(BreakOverlay.IsBreakTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onBreakTimeChanged(ValueChangedEvent<bool> isBreakTime)
|
||||||
|
{
|
||||||
|
updatePauseOnFocusLostState();
|
||||||
|
HUDOverlay.KeyCounter.IsCounting = !isBreakTime.NewValue;
|
||||||
|
}
|
||||||
|
|
||||||
private void updatePauseOnFocusLostState() =>
|
private void updatePauseOnFocusLostState() =>
|
||||||
HUDOverlay.HoldToQuit.PauseOnFocusLost = PauseOnFocusLost
|
HUDOverlay.HoldToQuit.PauseOnFocusLost = PauseOnFocusLost
|
||||||
&& !DrawableRuleset.HasReplayLoaded.Value
|
&& !DrawableRuleset.HasReplayLoaded.Value
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.304.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.304.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.302.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.305.0" />
|
||||||
<PackageReference Include="Sentry" Version="2.1.0" />
|
<PackageReference Include="Sentry" Version="2.1.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
|
@ -71,7 +71,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.304.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.304.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.302.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.305.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
<!-- Xamarin.iOS does not automatically handle transitive dependencies from NuGet packages. -->
|
||||||
<ItemGroup Label="Transitive Dependencies">
|
<ItemGroup Label="Transitive Dependencies">
|
||||||
@ -79,7 +79,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2020.302.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.305.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
<PackageReference Include="SharpCompress" Version="0.24.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user