mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 05:47:45 +08:00
Merge branch 'master' into sample-lookup-improvements
This commit is contained in:
commit
1b53e6c782
@ -16,9 +16,9 @@
|
|||||||
<EmbeddedResource Include="Resources\**\*.*" />
|
<EmbeddedResource Include="Resources\**\*.*" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Code Analysis">
|
<ItemGroup Label="Code Analysis">
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.0" PrivateAssets="All" />
|
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.1" PrivateAssets="All" />
|
||||||
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CodeAnalysis\BannedSymbols.txt" />
|
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CodeAnalysis\BannedSymbols.txt" />
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0" PrivateAssets="All" />
|
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.1" PrivateAssets="All" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup Label="Code Analysis">
|
<PropertyGroup Label="Code Analysis">
|
||||||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodeAnalysis\osu.ruleset</CodeAnalysisRuleSet>
|
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodeAnalysis\osu.ruleset</CodeAnalysisRuleSet>
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
"version": "3.1.100"
|
"version": "3.1.100"
|
||||||
},
|
},
|
||||||
"msbuild-sdks": {
|
"msbuild-sdks": {
|
||||||
"Microsoft.Build.Traversal": "2.1.1"
|
"Microsoft.Build.Traversal": "2.2.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -52,6 +52,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.1016.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.1016.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.1019.0" />
|
<PackageReference Include="ppy.osu.Framework.Android" Version="2020.1029.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -35,6 +35,7 @@ namespace osu.Game.Rulesets.Mania.Tests
|
|||||||
|
|
||||||
objects.Add(new Note { StartTime = time });
|
objects.Add(new Note { StartTime = time });
|
||||||
|
|
||||||
|
// don't hit the first note
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
{
|
{
|
||||||
frames.Add(new ManiaReplayFrame(time + 10, ManiaAction.Key1));
|
frames.Add(new ManiaReplayFrame(time + 10, ManiaAction.Key1));
|
||||||
|
@ -64,8 +64,8 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private const float target_clamp = 1;
|
private const float target_clamp = 1;
|
||||||
|
|
||||||
private readonly float targetBreakMultiplier = 0;
|
private readonly float targetBreakMultiplier;
|
||||||
private readonly float easing = 1;
|
private readonly float easing;
|
||||||
|
|
||||||
private readonly CompositeDrawable restrictTo;
|
private readonly CompositeDrawable restrictTo;
|
||||||
|
|
||||||
@ -86,6 +86,9 @@ namespace osu.Game.Rulesets.Osu.Mods
|
|||||||
{
|
{
|
||||||
this.restrictTo = restrictTo;
|
this.restrictTo = restrictTo;
|
||||||
this.beatmap = beatmap;
|
this.beatmap = beatmap;
|
||||||
|
|
||||||
|
targetBreakMultiplier = 0;
|
||||||
|
easing = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
// 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 osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Performance;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
|
@ -821,15 +821,13 @@ namespace osu.Game.Tests.Beatmaps.IO
|
|||||||
|
|
||||||
var manager = osu.Dependencies.Get<BeatmapManager>();
|
var manager = osu.Dependencies.Get<BeatmapManager>();
|
||||||
|
|
||||||
await manager.Import(temp);
|
var importedSet = await manager.Import(temp);
|
||||||
|
|
||||||
var imported = manager.GetAllUsableBeatmapSets();
|
|
||||||
|
|
||||||
ensureLoaded(osu);
|
ensureLoaded(osu);
|
||||||
|
|
||||||
waitForOrAssert(() => !File.Exists(temp), "Temporary file still exists after standard import", 5000);
|
waitForOrAssert(() => !File.Exists(temp), "Temporary file still exists after standard import", 5000);
|
||||||
|
|
||||||
return imported.LastOrDefault();
|
return manager.GetAllUsableBeatmapSets().Find(beatmapSet => beatmapSet.ID == importedSet.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteBeatmapSet(BeatmapSetInfo imported, OsuGameBase osu)
|
private void deleteBeatmapSet(BeatmapSetInfo imported, OsuGameBase osu)
|
||||||
|
@ -81,8 +81,8 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
|
|
||||||
private class TestHitObjectWithCombo : ConvertHitObject, IHasComboInformation
|
private class TestHitObjectWithCombo : ConvertHitObject, IHasComboInformation
|
||||||
{
|
{
|
||||||
public bool NewCombo { get; set; } = false;
|
public bool NewCombo { get; set; }
|
||||||
public int ComboOffset { get; } = 0;
|
public int ComboOffset => 0;
|
||||||
|
|
||||||
public Bindable<int> IndexInCurrentComboBindable { get; } = new Bindable<int>();
|
public Bindable<int> IndexInCurrentComboBindable { get; } = new Bindable<int>();
|
||||||
|
|
||||||
|
@ -0,0 +1,196 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.OpenGL.Textures;
|
||||||
|
using osu.Framework.Graphics.Textures;
|
||||||
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Graphics.Backgrounds;
|
||||||
|
using osu.Game.Online.API;
|
||||||
|
using osu.Game.Online.API.Requests;
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Visual.Background
|
||||||
|
{
|
||||||
|
public class TestSceneSeasonalBackgroundLoader : ScreenTestScene
|
||||||
|
{
|
||||||
|
[Resolved]
|
||||||
|
private OsuConfigManager config { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private SessionStatics statics { get; set; }
|
||||||
|
|
||||||
|
[Cached(typeof(LargeTextureStore))]
|
||||||
|
private LookupLoggingTextureStore textureStore = new LookupLoggingTextureStore();
|
||||||
|
|
||||||
|
private DummyAPIAccess dummyAPI => (DummyAPIAccess)API;
|
||||||
|
|
||||||
|
private SeasonalBackgroundLoader backgroundLoader;
|
||||||
|
private Container backgroundContainer;
|
||||||
|
|
||||||
|
// in real usages these would be online URLs, but correct execution of this test
|
||||||
|
// shouldn't be coupled to existence of online assets.
|
||||||
|
private static readonly List<string> seasonal_background_urls = new List<string>
|
||||||
|
{
|
||||||
|
"Backgrounds/bg2",
|
||||||
|
"Backgrounds/bg4",
|
||||||
|
"Backgrounds/bg3"
|
||||||
|
};
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(LargeTextureStore wrappedStore)
|
||||||
|
{
|
||||||
|
textureStore.AddStore(wrappedStore);
|
||||||
|
|
||||||
|
Add(backgroundContainer = new Container
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public void SetUp() => Schedule(() =>
|
||||||
|
{
|
||||||
|
// reset API response in statics to avoid test crosstalk.
|
||||||
|
statics.Set<APISeasonalBackgrounds>(Static.SeasonalBackgrounds, null);
|
||||||
|
textureStore.PerformedLookups.Clear();
|
||||||
|
dummyAPI.SetState(APIState.Online);
|
||||||
|
|
||||||
|
backgroundContainer.Clear();
|
||||||
|
});
|
||||||
|
|
||||||
|
[TestCase(-5)]
|
||||||
|
[TestCase(5)]
|
||||||
|
public void TestAlwaysSeasonal(int daysOffset)
|
||||||
|
{
|
||||||
|
registerBackgroundsResponse(DateTimeOffset.Now.AddDays(daysOffset));
|
||||||
|
setSeasonalBackgroundMode(SeasonalBackgroundMode.Always);
|
||||||
|
|
||||||
|
createLoader();
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; ++i)
|
||||||
|
loadNextBackground();
|
||||||
|
|
||||||
|
AddAssert("all backgrounds cycled", () => new HashSet<string>(textureStore.PerformedLookups).SetEquals(seasonal_background_urls));
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestCase(-5)]
|
||||||
|
[TestCase(5)]
|
||||||
|
public void TestNeverSeasonal(int daysOffset)
|
||||||
|
{
|
||||||
|
registerBackgroundsResponse(DateTimeOffset.Now.AddDays(daysOffset));
|
||||||
|
setSeasonalBackgroundMode(SeasonalBackgroundMode.Never);
|
||||||
|
|
||||||
|
createLoader();
|
||||||
|
|
||||||
|
assertNoBackgrounds();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestSometimesInSeason()
|
||||||
|
{
|
||||||
|
registerBackgroundsResponse(DateTimeOffset.Now.AddDays(5));
|
||||||
|
setSeasonalBackgroundMode(SeasonalBackgroundMode.Sometimes);
|
||||||
|
|
||||||
|
createLoader();
|
||||||
|
|
||||||
|
assertAnyBackground();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestSometimesOutOfSeason()
|
||||||
|
{
|
||||||
|
registerBackgroundsResponse(DateTimeOffset.Now.AddDays(-10));
|
||||||
|
setSeasonalBackgroundMode(SeasonalBackgroundMode.Sometimes);
|
||||||
|
|
||||||
|
createLoader();
|
||||||
|
|
||||||
|
assertNoBackgrounds();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestDelayedConnectivity()
|
||||||
|
{
|
||||||
|
registerBackgroundsResponse(DateTimeOffset.Now.AddDays(30));
|
||||||
|
setSeasonalBackgroundMode(SeasonalBackgroundMode.Always);
|
||||||
|
AddStep("go offline", () => dummyAPI.SetState(APIState.Offline));
|
||||||
|
|
||||||
|
createLoader();
|
||||||
|
assertNoBackgrounds();
|
||||||
|
|
||||||
|
AddStep("go online", () => dummyAPI.SetState(APIState.Online));
|
||||||
|
|
||||||
|
assertAnyBackground();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void registerBackgroundsResponse(DateTimeOffset endDate)
|
||||||
|
=> AddStep("setup request handler", () =>
|
||||||
|
{
|
||||||
|
dummyAPI.HandleRequest = request =>
|
||||||
|
{
|
||||||
|
if (dummyAPI.State.Value != APIState.Online || !(request is GetSeasonalBackgroundsRequest backgroundsRequest))
|
||||||
|
return;
|
||||||
|
|
||||||
|
backgroundsRequest.TriggerSuccess(new APISeasonalBackgrounds
|
||||||
|
{
|
||||||
|
Backgrounds = seasonal_background_urls.Select(url => new APISeasonalBackground { Url = url }).ToList(),
|
||||||
|
EndDate = endDate
|
||||||
|
});
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
private void setSeasonalBackgroundMode(SeasonalBackgroundMode mode)
|
||||||
|
=> AddStep($"set seasonal mode to {mode}", () => config.Set(OsuSetting.SeasonalBackgroundMode, mode));
|
||||||
|
|
||||||
|
private void createLoader()
|
||||||
|
=> AddStep("create loader", () =>
|
||||||
|
{
|
||||||
|
if (backgroundLoader != null)
|
||||||
|
Remove(backgroundLoader);
|
||||||
|
|
||||||
|
Add(backgroundLoader = new SeasonalBackgroundLoader());
|
||||||
|
});
|
||||||
|
|
||||||
|
private void loadNextBackground()
|
||||||
|
{
|
||||||
|
SeasonalBackground background = null;
|
||||||
|
|
||||||
|
AddStep("create next background", () =>
|
||||||
|
{
|
||||||
|
background = backgroundLoader.LoadNextBackground();
|
||||||
|
LoadComponentAsync(background, bg => backgroundContainer.Child = bg);
|
||||||
|
});
|
||||||
|
|
||||||
|
AddUntilStep("background loaded", () => background.IsLoaded);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assertAnyBackground()
|
||||||
|
{
|
||||||
|
loadNextBackground();
|
||||||
|
AddAssert("background looked up", () => textureStore.PerformedLookups.Any());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assertNoBackgrounds()
|
||||||
|
{
|
||||||
|
AddAssert("no background available", () => backgroundLoader.LoadNextBackground() == null);
|
||||||
|
AddAssert("no lookups performed", () => !textureStore.PerformedLookups.Any());
|
||||||
|
}
|
||||||
|
|
||||||
|
private class LookupLoggingTextureStore : LargeTextureStore
|
||||||
|
{
|
||||||
|
public List<string> PerformedLookups { get; } = new List<string>();
|
||||||
|
|
||||||
|
public override Texture Get(string name, WrapMode wrapModeS, WrapMode wrapModeT)
|
||||||
|
{
|
||||||
|
PerformedLookups.Add(name);
|
||||||
|
return base.Get(name, wrapModeS, wrapModeT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2,29 +2,23 @@
|
|||||||
// 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.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets;
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Osu;
|
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
|
|
||||||
namespace osu.Game.Tests.Visual.Gameplay
|
namespace osu.Game.Tests.Visual.Gameplay
|
||||||
{
|
{
|
||||||
public class TestSceneHUDOverlay : SkinnableTestScene
|
public class TestSceneHUDOverlay : OsuManualInputManagerTestScene
|
||||||
{
|
{
|
||||||
private HUDOverlay hudOverlay;
|
private HUDOverlay hudOverlay;
|
||||||
|
|
||||||
private IEnumerable<HUDOverlay> hudOverlays => CreatedDrawables.OfType<HUDOverlay>();
|
|
||||||
|
|
||||||
// best way to check without exposing.
|
// best way to check without exposing.
|
||||||
private Drawable hideTarget => hudOverlay.KeyCounter;
|
private Drawable hideTarget => hudOverlay.KeyCounter;
|
||||||
private FillFlowContainer<KeyCounter> keyCounterFlow => hudOverlay.KeyCounter.ChildrenOfType<FillFlowContainer<KeyCounter>>().First();
|
private FillFlowContainer<KeyCounter> keyCounterFlow => hudOverlay.KeyCounter.ChildrenOfType<FillFlowContainer<KeyCounter>>().First();
|
||||||
@ -37,17 +31,9 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
createNew();
|
createNew();
|
||||||
|
|
||||||
AddRepeatStep("increase combo", () =>
|
AddRepeatStep("increase combo", () => { hudOverlay.ComboCounter.Current.Value++; }, 10);
|
||||||
{
|
|
||||||
foreach (var hud in hudOverlays)
|
|
||||||
hud.ComboCounter.Current.Value++;
|
|
||||||
}, 10);
|
|
||||||
|
|
||||||
AddStep("reset combo", () =>
|
AddStep("reset combo", () => { hudOverlay.ComboCounter.Current.Value = 0; });
|
||||||
{
|
|
||||||
foreach (var hud in hudOverlays)
|
|
||||||
hud.ComboCounter.Current.Value = 0;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -77,7 +63,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
createNew();
|
createNew();
|
||||||
|
|
||||||
AddStep("set showhud false", () => hudOverlays.ForEach(h => h.ShowHud.Value = false));
|
AddStep("set showhud false", () => hudOverlay.ShowHud.Value = false);
|
||||||
|
|
||||||
AddUntilStep("hidetarget is hidden", () => !hideTarget.IsPresent);
|
AddUntilStep("hidetarget is hidden", () => !hideTarget.IsPresent);
|
||||||
AddAssert("pause button is still visible", () => hudOverlay.HoldToQuit.IsPresent);
|
AddAssert("pause button is still visible", () => hudOverlay.HoldToQuit.IsPresent);
|
||||||
@ -86,10 +72,32 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddAssert("key counter flow not affected", () => keyCounterFlow.IsPresent);
|
AddAssert("key counter flow not affected", () => keyCounterFlow.IsPresent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestMomentaryShowHUD()
|
||||||
|
{
|
||||||
|
createNew();
|
||||||
|
|
||||||
|
HUDVisibilityMode originalConfigValue = HUDVisibilityMode.HideDuringGameplay;
|
||||||
|
|
||||||
|
AddStep("get original config value", () => originalConfigValue = config.Get<HUDVisibilityMode>(OsuSetting.HUDVisibilityMode));
|
||||||
|
|
||||||
|
AddStep("set hud to never show", () => config.Set(OsuSetting.HUDVisibilityMode, HUDVisibilityMode.Never));
|
||||||
|
|
||||||
|
AddUntilStep("wait for fade", () => !hideTarget.IsPresent);
|
||||||
|
|
||||||
|
AddStep("trigger momentary show", () => InputManager.PressKey(Key.ControlLeft));
|
||||||
|
AddUntilStep("wait for visible", () => hideTarget.IsPresent);
|
||||||
|
|
||||||
|
AddStep("stop trigering", () => InputManager.ReleaseKey(Key.ControlLeft));
|
||||||
|
AddUntilStep("wait for fade", () => !hideTarget.IsPresent);
|
||||||
|
|
||||||
|
AddStep("set original config value", () => config.Set(OsuSetting.HUDVisibilityMode, originalConfigValue));
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestExternalHideDoesntAffectConfig()
|
public void TestExternalHideDoesntAffectConfig()
|
||||||
{
|
{
|
||||||
HUDVisibilityMode originalConfigValue = HUDVisibilityMode.HideDuringBreaks;
|
HUDVisibilityMode originalConfigValue = HUDVisibilityMode.HideDuringGameplay;
|
||||||
|
|
||||||
createNew();
|
createNew();
|
||||||
|
|
||||||
@ -113,14 +121,14 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
AddStep("set keycounter visible false", () =>
|
AddStep("set keycounter visible false", () =>
|
||||||
{
|
{
|
||||||
config.Set<bool>(OsuSetting.KeyOverlay, false);
|
config.Set<bool>(OsuSetting.KeyOverlay, false);
|
||||||
hudOverlays.ForEach(h => h.KeyCounter.AlwaysVisible.Value = false);
|
hudOverlay.KeyCounter.AlwaysVisible.Value = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
AddStep("set showhud false", () => hudOverlays.ForEach(h => h.ShowHud.Value = false));
|
AddStep("set showhud false", () => hudOverlay.ShowHud.Value = false);
|
||||||
AddUntilStep("hidetarget is hidden", () => !hideTarget.IsPresent);
|
AddUntilStep("hidetarget is hidden", () => !hideTarget.IsPresent);
|
||||||
AddAssert("key counters hidden", () => !keyCounterFlow.IsPresent);
|
AddAssert("key counters hidden", () => !keyCounterFlow.IsPresent);
|
||||||
|
|
||||||
AddStep("set showhud true", () => hudOverlays.ForEach(h => h.ShowHud.Value = true));
|
AddStep("set showhud true", () => hudOverlay.ShowHud.Value = true);
|
||||||
AddUntilStep("hidetarget is visible", () => hideTarget.IsPresent);
|
AddUntilStep("hidetarget is visible", () => hideTarget.IsPresent);
|
||||||
AddAssert("key counters still hidden", () => !keyCounterFlow.IsPresent);
|
AddAssert("key counters still hidden", () => !keyCounterFlow.IsPresent);
|
||||||
|
|
||||||
@ -131,22 +139,17 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
{
|
{
|
||||||
AddStep("create overlay", () =>
|
AddStep("create overlay", () =>
|
||||||
{
|
{
|
||||||
SetContents(() =>
|
hudOverlay = new HUDOverlay(null, null, null, Array.Empty<Mod>());
|
||||||
{
|
|
||||||
hudOverlay = new HUDOverlay(null, null, null, Array.Empty<Mod>());
|
|
||||||
|
|
||||||
// Add any key just to display the key counter visually.
|
// Add any key just to display the key counter visually.
|
||||||
hudOverlay.KeyCounter.Add(new KeyCounterKeyboard(Key.Space));
|
hudOverlay.KeyCounter.Add(new KeyCounterKeyboard(Key.Space));
|
||||||
|
|
||||||
hudOverlay.ComboCounter.Current.Value = 1;
|
hudOverlay.ComboCounter.Current.Value = 1;
|
||||||
|
|
||||||
action?.Invoke(hudOverlay);
|
action?.Invoke(hudOverlay);
|
||||||
|
|
||||||
return hudOverlay;
|
Child = hudOverlay;
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Ruleset CreateRulesetForSkinProvider() => new OsuRuleset();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,99 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using NUnit.Framework;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Testing;
|
||||||
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Rulesets;
|
||||||
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Rulesets.Osu;
|
||||||
|
using osu.Game.Screens.Play;
|
||||||
|
using osuTK.Input;
|
||||||
|
|
||||||
|
namespace osu.Game.Tests.Visual.Gameplay
|
||||||
|
{
|
||||||
|
public class TestSceneSkinnableHUDOverlay : SkinnableTestScene
|
||||||
|
{
|
||||||
|
private HUDOverlay hudOverlay;
|
||||||
|
|
||||||
|
private IEnumerable<HUDOverlay> hudOverlays => CreatedDrawables.OfType<HUDOverlay>();
|
||||||
|
|
||||||
|
// best way to check without exposing.
|
||||||
|
private Drawable hideTarget => hudOverlay.KeyCounter;
|
||||||
|
private FillFlowContainer<KeyCounter> keyCounterFlow => hudOverlay.KeyCounter.ChildrenOfType<FillFlowContainer<KeyCounter>>().First();
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuConfigManager config { get; set; }
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestComboCounterIncrementing()
|
||||||
|
{
|
||||||
|
createNew();
|
||||||
|
|
||||||
|
AddRepeatStep("increase combo", () =>
|
||||||
|
{
|
||||||
|
foreach (var hud in hudOverlays)
|
||||||
|
hud.ComboCounter.Current.Value++;
|
||||||
|
}, 10);
|
||||||
|
|
||||||
|
AddStep("reset combo", () =>
|
||||||
|
{
|
||||||
|
foreach (var hud in hudOverlays)
|
||||||
|
hud.ComboCounter.Current.Value = 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestFadesInOnLoadComplete()
|
||||||
|
{
|
||||||
|
float? initialAlpha = null;
|
||||||
|
|
||||||
|
createNew(h => h.OnLoadComplete += _ => initialAlpha = hideTarget.Alpha);
|
||||||
|
AddUntilStep("wait for load", () => hudOverlay.IsAlive);
|
||||||
|
AddAssert("initial alpha was less than 1", () => initialAlpha < 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestHideExternally()
|
||||||
|
{
|
||||||
|
createNew();
|
||||||
|
|
||||||
|
AddStep("set showhud false", () => hudOverlays.ForEach(h => h.ShowHud.Value = false));
|
||||||
|
|
||||||
|
AddUntilStep("hidetarget is hidden", () => !hideTarget.IsPresent);
|
||||||
|
AddAssert("pause button is still visible", () => hudOverlay.HoldToQuit.IsPresent);
|
||||||
|
|
||||||
|
// Key counter flow container should not be affected by this, only the key counter display will be hidden as checked above.
|
||||||
|
AddAssert("key counter flow not affected", () => keyCounterFlow.IsPresent);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createNew(Action<HUDOverlay> action = null)
|
||||||
|
{
|
||||||
|
AddStep("create overlay", () =>
|
||||||
|
{
|
||||||
|
SetContents(() =>
|
||||||
|
{
|
||||||
|
hudOverlay = new HUDOverlay(null, null, null, Array.Empty<Mod>());
|
||||||
|
|
||||||
|
// Add any key just to display the key counter visually.
|
||||||
|
hudOverlay.KeyCounter.Add(new KeyCounterKeyboard(Key.Space));
|
||||||
|
|
||||||
|
hudOverlay.ComboCounter.Current.Value = 1;
|
||||||
|
|
||||||
|
action?.Invoke(hudOverlay);
|
||||||
|
|
||||||
|
return hudOverlay;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Ruleset CreateRulesetForSkinProvider() => new OsuRuleset();
|
||||||
|
}
|
||||||
|
}
|
@ -135,7 +135,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
|
|
||||||
public Bindable<bool> InitialRoomsReceived { get; } = new Bindable<bool>(true);
|
public Bindable<bool> InitialRoomsReceived { get; } = new Bindable<bool>(true);
|
||||||
|
|
||||||
public IBindableList<Room> Rooms { get; } = null;
|
public IBindableList<Room> Rooms => null;
|
||||||
|
|
||||||
public void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)
|
public void CreateRoom(Room room, Action<Room> onSuccess = null, Action<string> onError = null)
|
||||||
{
|
{
|
||||||
|
@ -103,7 +103,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
|
|
||||||
private void addPanelStep(ScoreInfo score, PanelState state = PanelState.Expanded) => AddStep("add panel", () =>
|
private void addPanelStep(ScoreInfo score, PanelState state = PanelState.Expanded) => AddStep("add panel", () =>
|
||||||
{
|
{
|
||||||
Child = panel = new ScorePanel(score)
|
Child = panel = new ScorePanel(score, true)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
|
@ -197,8 +197,8 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
|
|
||||||
private class TestHitObject : ConvertHitObject, IHasPosition
|
private class TestHitObject : ConvertHitObject, IHasPosition
|
||||||
{
|
{
|
||||||
public float X { get; } = 0;
|
public float X => 0;
|
||||||
public float Y { get; } = 0;
|
public float Y => 0;
|
||||||
public Vector2 Position { get; } = Vector2.Zero;
|
public Vector2 Position { get; } = Vector2.Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -417,7 +417,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
string sampleFilename = samples.FirstOrDefault(s => string.IsNullOrEmpty(s.Name))?.LookupNames.First() ?? string.Empty;
|
string sampleFilename = samples.FirstOrDefault(s => string.IsNullOrEmpty(s.Name))?.LookupNames.First() ?? string.Empty;
|
||||||
int volume = samples.FirstOrDefault()?.Volume ?? 100;
|
int volume = samples.FirstOrDefault()?.Volume ?? 100;
|
||||||
|
|
||||||
sb.Append(":");
|
sb.Append(':');
|
||||||
sb.Append(FormattableString.Invariant($"{customSampleBank}:"));
|
sb.Append(FormattableString.Invariant($"{customSampleBank}:"));
|
||||||
sb.Append(FormattableString.Invariant($"{volume}:"));
|
sb.Append(FormattableString.Invariant($"{volume}:"));
|
||||||
sb.Append(FormattableString.Invariant($"{sampleFilename}"));
|
sb.Append(FormattableString.Invariant($"{sampleFilename}"));
|
||||||
|
@ -347,7 +347,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
/// <param name="line">The line which may contains variables.</param>
|
/// <param name="line">The line which may contains variables.</param>
|
||||||
private void decodeVariables(ref string line)
|
private void decodeVariables(ref string line)
|
||||||
{
|
{
|
||||||
while (line.IndexOf('$') >= 0)
|
while (line.Contains('$'))
|
||||||
{
|
{
|
||||||
string origLine = line;
|
string origLine = line;
|
||||||
|
|
||||||
|
@ -12,9 +12,6 @@ namespace osu.Game.Configuration
|
|||||||
[Description("Hide during gameplay")]
|
[Description("Hide during gameplay")]
|
||||||
HideDuringGameplay,
|
HideDuringGameplay,
|
||||||
|
|
||||||
[Description("Hide during breaks")]
|
|
||||||
HideDuringBreaks,
|
|
||||||
|
|
||||||
Always
|
Always
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,6 +131,7 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuSetting.IntroSequence, IntroSequence.Triangles);
|
Set(OsuSetting.IntroSequence, IntroSequence.Triangles);
|
||||||
|
|
||||||
Set(OsuSetting.MenuBackgroundSource, BackgroundSource.Skin);
|
Set(OsuSetting.MenuBackgroundSource, BackgroundSource.Skin);
|
||||||
|
Set(OsuSetting.SeasonalBackgroundMode, SeasonalBackgroundMode.Sometimes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OsuConfigManager(Storage storage)
|
public OsuConfigManager(Storage storage)
|
||||||
@ -170,6 +171,7 @@ namespace osu.Game.Configuration
|
|||||||
public override TrackedSettings CreateTrackedSettings() => new TrackedSettings
|
public override TrackedSettings CreateTrackedSettings() => new TrackedSettings
|
||||||
{
|
{
|
||||||
new TrackedSetting<bool>(OsuSetting.MouseDisableButtons, v => new SettingDescription(!v, "gameplay mouse buttons", v ? "disabled" : "enabled")),
|
new TrackedSetting<bool>(OsuSetting.MouseDisableButtons, v => new SettingDescription(!v, "gameplay mouse buttons", v ? "disabled" : "enabled")),
|
||||||
|
new TrackedSetting<HUDVisibilityMode>(OsuSetting.HUDVisibilityMode, m => new SettingDescription(m, "HUD Visibility", m.GetDescription())),
|
||||||
new TrackedSetting<ScalingMode>(OsuSetting.Scaling, m => new SettingDescription(m, "scaling", m.GetDescription())),
|
new TrackedSetting<ScalingMode>(OsuSetting.Scaling, m => new SettingDescription(m, "scaling", m.GetDescription())),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -239,5 +241,6 @@ namespace osu.Game.Configuration
|
|||||||
HitLighting,
|
HitLighting,
|
||||||
MenuBackgroundSource,
|
MenuBackgroundSource,
|
||||||
GameplayDisableWinKey,
|
GameplayDisableWinKey,
|
||||||
|
SeasonalBackgroundMode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
23
osu.Game/Configuration/SeasonalBackgroundMode.cs
Normal file
23
osu.Game/Configuration/SeasonalBackgroundMode.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
namespace osu.Game.Configuration
|
||||||
|
{
|
||||||
|
public enum SeasonalBackgroundMode
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Seasonal backgrounds are shown regardless of season, if at all available.
|
||||||
|
/// </summary>
|
||||||
|
Always,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Seasonal backgrounds are shown only during their corresponding season.
|
||||||
|
/// </summary>
|
||||||
|
Sometimes,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Seasonal backgrounds are never shown.
|
||||||
|
/// </summary>
|
||||||
|
Never
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,8 @@
|
|||||||
// 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 osu.Game.Online.API.Requests.Responses;
|
||||||
|
|
||||||
namespace osu.Game.Configuration
|
namespace osu.Game.Configuration
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -12,12 +14,19 @@ namespace osu.Game.Configuration
|
|||||||
{
|
{
|
||||||
Set(Static.LoginOverlayDisplayed, false);
|
Set(Static.LoginOverlayDisplayed, false);
|
||||||
Set(Static.MutedAudioNotificationShownOnce, false);
|
Set(Static.MutedAudioNotificationShownOnce, false);
|
||||||
|
Set<APISeasonalBackgrounds>(Static.SeasonalBackgrounds, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum Static
|
public enum Static
|
||||||
{
|
{
|
||||||
LoginOverlayDisplayed,
|
LoginOverlayDisplayed,
|
||||||
MutedAudioNotificationShownOnce
|
MutedAudioNotificationShownOnce,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Info about seasonal backgrounds available fetched from API - see <see cref="APISeasonalBackgrounds"/>.
|
||||||
|
/// Value under this lookup can be <c>null</c> if there are no backgrounds available (or API is not reachable).
|
||||||
|
/// </summary>
|
||||||
|
SeasonalBackgrounds,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ namespace osu.Game.Database
|
|||||||
/// Whether this write usage will commit a transaction on completion.
|
/// Whether this write usage will commit a transaction on completion.
|
||||||
/// If false, there is a parent usage responsible for transaction commit.
|
/// If false, there is a parent usage responsible for transaction commit.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsTransactionLeader = false;
|
public bool IsTransactionLeader;
|
||||||
|
|
||||||
protected void Dispose(bool disposing)
|
protected void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
|
103
osu.Game/Graphics/Backgrounds/SeasonalBackgroundLoader.cs
Normal file
103
osu.Game/Graphics/Backgrounds/SeasonalBackgroundLoader.cs
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Textures;
|
||||||
|
using osu.Framework.Utils;
|
||||||
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Online.API;
|
||||||
|
using osu.Game.Online.API.Requests;
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
|
|
||||||
|
namespace osu.Game.Graphics.Backgrounds
|
||||||
|
{
|
||||||
|
public class SeasonalBackgroundLoader : Component
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Fired when background should be changed due to receiving backgrounds from API
|
||||||
|
/// or when the user setting is changed (as it might require unloading the seasonal background).
|
||||||
|
/// </summary>
|
||||||
|
public event Action SeasonalBackgroundChanged;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private IAPIProvider api { get; set; }
|
||||||
|
|
||||||
|
private readonly IBindable<APIState> apiState = new Bindable<APIState>();
|
||||||
|
private Bindable<SeasonalBackgroundMode> seasonalBackgroundMode;
|
||||||
|
private Bindable<APISeasonalBackgrounds> seasonalBackgrounds;
|
||||||
|
|
||||||
|
private int current;
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuConfigManager config, SessionStatics sessionStatics)
|
||||||
|
{
|
||||||
|
seasonalBackgroundMode = config.GetBindable<SeasonalBackgroundMode>(OsuSetting.SeasonalBackgroundMode);
|
||||||
|
seasonalBackgroundMode.BindValueChanged(_ => SeasonalBackgroundChanged?.Invoke());
|
||||||
|
|
||||||
|
seasonalBackgrounds = sessionStatics.GetBindable<APISeasonalBackgrounds>(Static.SeasonalBackgrounds);
|
||||||
|
seasonalBackgrounds.BindValueChanged(_ => SeasonalBackgroundChanged?.Invoke());
|
||||||
|
|
||||||
|
apiState.BindTo(api.State);
|
||||||
|
apiState.BindValueChanged(fetchSeasonalBackgrounds, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void fetchSeasonalBackgrounds(ValueChangedEvent<APIState> stateChanged)
|
||||||
|
{
|
||||||
|
if (seasonalBackgrounds.Value != null || stateChanged.NewValue != APIState.Online)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var request = new GetSeasonalBackgroundsRequest();
|
||||||
|
request.Success += response =>
|
||||||
|
{
|
||||||
|
seasonalBackgrounds.Value = response;
|
||||||
|
current = RNG.Next(0, response.Backgrounds?.Count ?? 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
api.PerformAsync(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SeasonalBackground LoadNextBackground()
|
||||||
|
{
|
||||||
|
if (seasonalBackgroundMode.Value == SeasonalBackgroundMode.Never
|
||||||
|
|| (seasonalBackgroundMode.Value == SeasonalBackgroundMode.Sometimes && !isInSeason))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var backgrounds = seasonalBackgrounds.Value?.Backgrounds;
|
||||||
|
if (backgrounds == null || !backgrounds.Any())
|
||||||
|
return null;
|
||||||
|
|
||||||
|
current = (current + 1) % backgrounds.Count;
|
||||||
|
string url = backgrounds[current].Url;
|
||||||
|
|
||||||
|
return new SeasonalBackground(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool isInSeason => seasonalBackgrounds.Value != null && DateTimeOffset.Now < seasonalBackgrounds.Value.EndDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
[LongRunningLoad]
|
||||||
|
public class SeasonalBackground : Background
|
||||||
|
{
|
||||||
|
private readonly string url;
|
||||||
|
private const string fallback_texture_name = @"Backgrounds/bg1";
|
||||||
|
|
||||||
|
public SeasonalBackground(string url)
|
||||||
|
{
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(LargeTextureStore textures)
|
||||||
|
{
|
||||||
|
Sprite.Texture = textures.Get(url) ?? textures.Get(fallback_texture_name);
|
||||||
|
// ensure we're not loading in without a transition.
|
||||||
|
this.FadeInFromZero(200, Easing.InOutSine);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -21,7 +21,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
/// Allows controlling the scroll bar from any position in the container using the right mouse button.
|
/// Allows controlling the scroll bar from any position in the container using the right mouse button.
|
||||||
/// Uses the value of <see cref="DistanceDecayOnRightMouseScrollbar"/> to smoothly scroll to the dragged location.
|
/// Uses the value of <see cref="DistanceDecayOnRightMouseScrollbar"/> to smoothly scroll to the dragged location.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool RightMouseScrollbar = false;
|
public bool RightMouseScrollbar;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Controls the rate with which the target position is approached when performing a relative drag. Default is 0.02.
|
/// Controls the rate with which the target position is approached when performing a relative drag. Default is 0.02.
|
||||||
|
@ -41,7 +41,7 @@ namespace osu.Game.IO.Archives
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
byte[] buffer = new byte[input.Length];
|
byte[] buffer = new byte[input.Length];
|
||||||
await input.ReadAsync(buffer, 0, buffer.Length);
|
await input.ReadAsync(buffer);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,7 @@ namespace osu.Game.Input.Bindings
|
|||||||
new KeyBinding(new[] { InputKey.Control, InputKey.Plus }, GlobalAction.IncreaseScrollSpeed),
|
new KeyBinding(new[] { InputKey.Control, InputKey.Plus }, GlobalAction.IncreaseScrollSpeed),
|
||||||
new KeyBinding(new[] { InputKey.Control, InputKey.Minus }, GlobalAction.DecreaseScrollSpeed),
|
new KeyBinding(new[] { InputKey.Control, InputKey.Minus }, GlobalAction.DecreaseScrollSpeed),
|
||||||
new KeyBinding(InputKey.MouseMiddle, GlobalAction.PauseGameplay),
|
new KeyBinding(InputKey.MouseMiddle, GlobalAction.PauseGameplay),
|
||||||
|
new KeyBinding(InputKey.Control, GlobalAction.HoldForHUD),
|
||||||
};
|
};
|
||||||
|
|
||||||
public IEnumerable<KeyBinding> AudioControlKeyBindings => new[]
|
public IEnumerable<KeyBinding> AudioControlKeyBindings => new[]
|
||||||
@ -187,5 +188,8 @@ namespace osu.Game.Input.Bindings
|
|||||||
|
|
||||||
[Description("Timing Mode")]
|
[Description("Timing Mode")]
|
||||||
EditorTimingMode,
|
EditorTimingMode,
|
||||||
|
|
||||||
|
[Description("Hold for HUD")]
|
||||||
|
HoldForHUD,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
using osu.Game.Online.API.Requests.Responses;
|
||||||
|
|
||||||
|
namespace osu.Game.Online.API.Requests
|
||||||
|
{
|
||||||
|
public class GetSeasonalBackgroundsRequest : APIRequest<APISeasonalBackgrounds>
|
||||||
|
{
|
||||||
|
protected override string Target => @"seasonal-backgrounds";
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace osu.Game.Online.API.Requests.Responses
|
||||||
|
{
|
||||||
|
public class APISeasonalBackgrounds
|
||||||
|
{
|
||||||
|
[JsonProperty("ends_at")]
|
||||||
|
public DateTimeOffset EndDate;
|
||||||
|
|
||||||
|
[JsonProperty("backgrounds")]
|
||||||
|
public List<APISeasonalBackground> Backgrounds { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class APISeasonalBackground
|
||||||
|
{
|
||||||
|
[JsonProperty("url")]
|
||||||
|
public string Url { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -39,6 +39,12 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
|||||||
LabelText = "Background source",
|
LabelText = "Background source",
|
||||||
Current = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource),
|
Current = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource),
|
||||||
Items = Enum.GetValues(typeof(BackgroundSource)).Cast<BackgroundSource>()
|
Items = Enum.GetValues(typeof(BackgroundSource)).Cast<BackgroundSource>()
|
||||||
|
},
|
||||||
|
new SettingsDropdown<SeasonalBackgroundMode>
|
||||||
|
{
|
||||||
|
LabelText = "Seasonal backgrounds",
|
||||||
|
Current = config.GetBindable<SeasonalBackgroundMode>(OsuSetting.SeasonalBackgroundMode),
|
||||||
|
Items = Enum.GetValues(typeof(SeasonalBackgroundMode)).Cast<SeasonalBackgroundMode>()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ namespace osu.Game.Rulesets.Replays
|
|||||||
/// When set, we will ensure frames executed by nested drawables are frame-accurate to replay data.
|
/// When set, we will ensure frames executed by nested drawables are frame-accurate to replay data.
|
||||||
/// Disabling this can make replay playback smoother (useful for autoplay, currently).
|
/// Disabling this can make replay playback smoother (useful for autoplay, currently).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool FrameAccuratePlayback = false;
|
public bool FrameAccuratePlayback;
|
||||||
|
|
||||||
protected bool HasFrames => Frames.Count > 0;
|
protected bool HasFrames => Frames.Count > 0;
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ using System.Linq;
|
|||||||
using osu.Framework.Bindables;
|
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.Graphics.Performance;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.UI
|
namespace osu.Game.Rulesets.UI
|
||||||
|
@ -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.Threading;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -25,6 +26,7 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
private Bindable<Skin> skin;
|
private Bindable<Skin> skin;
|
||||||
private Bindable<BackgroundSource> mode;
|
private Bindable<BackgroundSource> mode;
|
||||||
private Bindable<IntroSequence> introSequence;
|
private Bindable<IntroSequence> introSequence;
|
||||||
|
private readonly SeasonalBackgroundLoader seasonalBackgroundLoader = new SeasonalBackgroundLoader();
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private IBindable<WorkingBeatmap> beatmap { get; set; }
|
private IBindable<WorkingBeatmap> beatmap { get; set; }
|
||||||
@ -42,15 +44,18 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
mode = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource);
|
mode = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource);
|
||||||
introSequence = config.GetBindable<IntroSequence>(OsuSetting.IntroSequence);
|
introSequence = config.GetBindable<IntroSequence>(OsuSetting.IntroSequence);
|
||||||
|
|
||||||
|
AddInternal(seasonalBackgroundLoader);
|
||||||
|
|
||||||
user.ValueChanged += _ => Next();
|
user.ValueChanged += _ => Next();
|
||||||
skin.ValueChanged += _ => Next();
|
skin.ValueChanged += _ => Next();
|
||||||
mode.ValueChanged += _ => Next();
|
mode.ValueChanged += _ => Next();
|
||||||
beatmap.ValueChanged += _ => Next();
|
beatmap.ValueChanged += _ => Next();
|
||||||
introSequence.ValueChanged += _ => Next();
|
introSequence.ValueChanged += _ => Next();
|
||||||
|
seasonalBackgroundLoader.SeasonalBackgroundChanged += Next;
|
||||||
|
|
||||||
currentDisplay = RNG.Next(0, background_count);
|
currentDisplay = RNG.Next(0, background_count);
|
||||||
|
|
||||||
display(createBackground());
|
Next();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void display(Background newBackground)
|
private void display(Background newBackground)
|
||||||
@ -63,11 +68,14 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ScheduledDelegate nextTask;
|
private ScheduledDelegate nextTask;
|
||||||
|
private CancellationTokenSource cancellationTokenSource;
|
||||||
|
|
||||||
public void Next()
|
public void Next()
|
||||||
{
|
{
|
||||||
nextTask?.Cancel();
|
nextTask?.Cancel();
|
||||||
nextTask = Scheduler.AddDelayed(() => { LoadComponentAsync(createBackground(), display); }, 100);
|
cancellationTokenSource?.Cancel();
|
||||||
|
cancellationTokenSource = new CancellationTokenSource();
|
||||||
|
nextTask = Scheduler.AddDelayed(() => LoadComponentAsync(createBackground(), display, cancellationTokenSource.Token), 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Background createBackground()
|
private Background createBackground()
|
||||||
@ -75,6 +83,14 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
Background newBackground;
|
Background newBackground;
|
||||||
string backgroundName;
|
string backgroundName;
|
||||||
|
|
||||||
|
var seasonalBackground = seasonalBackgroundLoader.LoadNextBackground();
|
||||||
|
|
||||||
|
if (seasonalBackground != null)
|
||||||
|
{
|
||||||
|
seasonalBackground.Depth = currentDisplay;
|
||||||
|
return seasonalBackground;
|
||||||
|
}
|
||||||
|
|
||||||
switch (introSequence.Value)
|
switch (introSequence.Value)
|
||||||
{
|
{
|
||||||
case IntroSequence.Welcome:
|
case IntroSequence.Welcome:
|
||||||
|
@ -210,10 +210,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (DragBox.State == Visibility.Visible)
|
if (DragBox.State == Visibility.Visible)
|
||||||
{
|
|
||||||
DragBox.Hide();
|
DragBox.Hide();
|
||||||
SelectionHandler.UpdateVisibility();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnKeyDown(KeyDownEvent e)
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
@ -352,11 +349,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Selects all <see cref="SelectionBlueprint"/>s.
|
/// Selects all <see cref="SelectionBlueprint"/>s.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void selectAll()
|
private void selectAll() => SelectionBlueprints.ToList().ForEach(m => m.Select());
|
||||||
{
|
|
||||||
SelectionBlueprints.ToList().ForEach(m => m.Select());
|
|
||||||
SelectionHandler.UpdateVisibility();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Deselects all selected <see cref="SelectionBlueprint"/>s.
|
/// Deselects all selected <see cref="SelectionBlueprint"/>s.
|
||||||
|
@ -201,8 +201,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
// there are potentially multiple SelectionHandlers active, but we only want to add hitobjects to the selected list once.
|
// there are potentially multiple SelectionHandlers active, but we only want to add hitobjects to the selected list once.
|
||||||
if (!EditorBeatmap.SelectedHitObjects.Contains(blueprint.HitObject))
|
if (!EditorBeatmap.SelectedHitObjects.Contains(blueprint.HitObject))
|
||||||
EditorBeatmap.SelectedHitObjects.Add(blueprint.HitObject);
|
EditorBeatmap.SelectedHitObjects.Add(blueprint.HitObject);
|
||||||
|
|
||||||
UpdateVisibility();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -214,8 +212,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
selectedBlueprints.Remove(blueprint);
|
selectedBlueprints.Remove(blueprint);
|
||||||
|
|
||||||
EditorBeatmap.SelectedHitObjects.Remove(blueprint.HitObject);
|
EditorBeatmap.SelectedHitObjects.Remove(blueprint.HitObject);
|
||||||
|
|
||||||
UpdateVisibility();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -226,13 +222,21 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
internal void HandleSelectionRequested(SelectionBlueprint blueprint, InputState state)
|
internal void HandleSelectionRequested(SelectionBlueprint blueprint, InputState state)
|
||||||
{
|
{
|
||||||
if (state.Keyboard.ShiftPressed && state.Mouse.IsPressed(MouseButton.Right))
|
if (state.Keyboard.ShiftPressed && state.Mouse.IsPressed(MouseButton.Right))
|
||||||
EditorBeatmap.Remove(blueprint.HitObject);
|
handleQuickDeletion(blueprint);
|
||||||
else if (state.Keyboard.ControlPressed && state.Mouse.IsPressed(MouseButton.Left))
|
else if (state.Keyboard.ControlPressed && state.Mouse.IsPressed(MouseButton.Left))
|
||||||
blueprint.ToggleSelection();
|
blueprint.ToggleSelection();
|
||||||
else
|
else
|
||||||
ensureSelected(blueprint);
|
ensureSelected(blueprint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void handleQuickDeletion(SelectionBlueprint blueprint)
|
||||||
|
{
|
||||||
|
if (!blueprint.IsSelected)
|
||||||
|
EditorBeatmap.Remove(blueprint.HitObject);
|
||||||
|
else
|
||||||
|
deleteSelected();
|
||||||
|
}
|
||||||
|
|
||||||
private void ensureSelected(SelectionBlueprint blueprint)
|
private void ensureSelected(SelectionBlueprint blueprint)
|
||||||
{
|
{
|
||||||
if (blueprint.IsSelected)
|
if (blueprint.IsSelected)
|
||||||
@ -254,23 +258,18 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Updates whether this <see cref="SelectionHandler"/> is visible.
|
/// Updates whether this <see cref="SelectionHandler"/> is visible.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal void UpdateVisibility()
|
private void updateVisibility()
|
||||||
{
|
{
|
||||||
int count = selectedBlueprints.Count;
|
int count = selectedBlueprints.Count;
|
||||||
|
|
||||||
selectionDetailsText.Text = count > 0 ? count.ToString() : string.Empty;
|
selectionDetailsText.Text = count > 0 ? count.ToString() : string.Empty;
|
||||||
|
|
||||||
if (count > 0)
|
this.FadeTo(count > 0 ? 1 : 0);
|
||||||
{
|
OnSelectionChanged();
|
||||||
Show();
|
|
||||||
OnSelectionChanged();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Triggered whenever more than one object is selected, on each change.
|
/// Triggered whenever the set of selected objects changes.
|
||||||
/// Should update the selection box's state to match supported operations.
|
/// Should update the selection box's state to match supported operations.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void OnSelectionChanged()
|
protected virtual void OnSelectionChanged()
|
||||||
@ -421,7 +420,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
|
|
||||||
// bring in updates from selection changes
|
// bring in updates from selection changes
|
||||||
EditorBeatmap.HitObjectUpdated += _ => UpdateTernaryStates();
|
EditorBeatmap.HitObjectUpdated += _ => UpdateTernaryStates();
|
||||||
EditorBeatmap.SelectedHitObjects.CollectionChanged += (sender, args) => UpdateTernaryStates();
|
EditorBeatmap.SelectedHitObjects.CollectionChanged += (sender, args) =>
|
||||||
|
{
|
||||||
|
Scheduler.AddOnce(updateVisibility);
|
||||||
|
UpdateTernaryStates();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -9,10 +9,10 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
|
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
|
||||||
using osuTK;
|
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||||
@ -137,8 +137,14 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
private class TimelineDragBox : DragBox
|
private class TimelineDragBox : DragBox
|
||||||
{
|
{
|
||||||
private Vector2 lastMouseDown;
|
// the following values hold the start and end X positions of the drag box in the timeline's local space,
|
||||||
private float localMouseDown;
|
// but with zoom unapplied in order to be able to compensate for positional changes
|
||||||
|
// while the timeline is being zoomed in/out.
|
||||||
|
private float? selectionStart;
|
||||||
|
private float selectionEnd;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private Timeline timeline { get; set; }
|
||||||
|
|
||||||
public TimelineDragBox(Action<RectangleF> performSelect)
|
public TimelineDragBox(Action<RectangleF> performSelect)
|
||||||
: base(performSelect)
|
: base(performSelect)
|
||||||
@ -153,21 +159,34 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
public override bool HandleDrag(MouseButtonEvent e)
|
public override bool HandleDrag(MouseButtonEvent e)
|
||||||
{
|
{
|
||||||
// store the original position of the mouse down, as we may be scrolled during selection.
|
selectionStart ??= e.MouseDownPosition.X / timeline.CurrentZoom;
|
||||||
if (lastMouseDown != e.ScreenSpaceMouseDownPosition)
|
|
||||||
{
|
|
||||||
lastMouseDown = e.ScreenSpaceMouseDownPosition;
|
|
||||||
localMouseDown = e.MouseDownPosition.X;
|
|
||||||
}
|
|
||||||
|
|
||||||
float selection1 = localMouseDown;
|
// only calculate end when a transition is not in progress to avoid bouncing.
|
||||||
float selection2 = e.MousePosition.X;
|
if (Precision.AlmostEquals(timeline.CurrentZoom, timeline.Zoom))
|
||||||
|
selectionEnd = e.MousePosition.X / timeline.CurrentZoom;
|
||||||
|
|
||||||
Box.X = Math.Min(selection1, selection2);
|
updateDragBoxPosition();
|
||||||
Box.Width = Math.Abs(selection1 - selection2);
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateDragBoxPosition()
|
||||||
|
{
|
||||||
|
if (selectionStart == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
float rescaledStart = selectionStart.Value * timeline.CurrentZoom;
|
||||||
|
float rescaledEnd = selectionEnd * timeline.CurrentZoom;
|
||||||
|
|
||||||
|
Box.X = Math.Min(rescaledStart, rescaledEnd);
|
||||||
|
Box.Width = Math.Abs(rescaledStart - rescaledEnd);
|
||||||
|
|
||||||
PerformSelection?.Invoke(Box.ScreenSpaceDrawQuad.AABBFloat);
|
PerformSelection?.Invoke(Box.ScreenSpaceDrawQuad.AABBFloat);
|
||||||
return true;
|
}
|
||||||
|
|
||||||
|
public override void Hide()
|
||||||
|
{
|
||||||
|
base.Hide();
|
||||||
|
selectionStart = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,9 +29,14 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
private readonly Container zoomedContent;
|
private readonly Container zoomedContent;
|
||||||
protected override Container<Drawable> Content => zoomedContent;
|
protected override Container<Drawable> Content => zoomedContent;
|
||||||
|
|
||||||
private float currentZoom = 1;
|
private float currentZoom = 1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The current zoom level of <see cref="ZoomableScrollContainer" />.
|
||||||
|
/// It may differ from <see cref="Zoom" /> during transitions.
|
||||||
|
/// </summary>
|
||||||
|
public float CurrentZoom => currentZoom;
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
[Resolved(canBeNull: true)]
|
||||||
private IFrameBasedClock editorClock { get; set; }
|
private IFrameBasedClock editorClock { get; set; }
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
|
|||||||
matchingFilter &= r.Room.Playlist.Count == 0 || r.Room.Playlist.Any(i => i.Ruleset.Value.Equals(criteria.Ruleset));
|
matchingFilter &= r.Room.Playlist.Count == 0 || r.Room.Playlist.Any(i => i.Ruleset.Value.Equals(criteria.Ruleset));
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(criteria.SearchString))
|
if (!string.IsNullOrEmpty(criteria.SearchString))
|
||||||
matchingFilter &= r.FilterTerms.Any(term => term.IndexOf(criteria.SearchString, StringComparison.InvariantCultureIgnoreCase) >= 0);
|
matchingFilter &= r.FilterTerms.Any(term => term.Contains(criteria.SearchString, StringComparison.InvariantCultureIgnoreCase));
|
||||||
|
|
||||||
r.MatchingFilter = matchingFilter;
|
r.MatchingFilter = matchingFilter;
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,10 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
|
using osu.Game.Input.Bindings;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.Notifications;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
@ -22,7 +24,7 @@ using osuTK.Input;
|
|||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
[Cached]
|
[Cached]
|
||||||
public class HUDOverlay : Container
|
public class HUDOverlay : Container, IKeyBindingHandler<GlobalAction>
|
||||||
{
|
{
|
||||||
public const float FADE_DURATION = 400;
|
public const float FADE_DURATION = 400;
|
||||||
|
|
||||||
@ -67,6 +69,8 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
internal readonly IBindable<bool> IsBreakTime = new Bindable<bool>();
|
internal readonly IBindable<bool> IsBreakTime = new Bindable<bool>();
|
||||||
|
|
||||||
|
private bool holdingForHUD;
|
||||||
|
|
||||||
private IEnumerable<Drawable> hideTargets => new Drawable[] { visibilityContainer, KeyCounter };
|
private IEnumerable<Drawable> hideTargets => new Drawable[] { visibilityContainer, KeyCounter };
|
||||||
|
|
||||||
public HUDOverlay(ScoreProcessor scoreProcessor, HealthProcessor healthProcessor, DrawableRuleset drawableRuleset, IReadOnlyList<Mod> mods)
|
public HUDOverlay(ScoreProcessor scoreProcessor, HealthProcessor healthProcessor, DrawableRuleset drawableRuleset, IReadOnlyList<Mod> mods)
|
||||||
@ -217,17 +221,18 @@ namespace osu.Game.Screens.Play
|
|||||||
if (ShowHud.Disabled)
|
if (ShowHud.Disabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (holdingForHUD)
|
||||||
|
{
|
||||||
|
ShowHud.Value = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (configVisibilityMode.Value)
|
switch (configVisibilityMode.Value)
|
||||||
{
|
{
|
||||||
case HUDVisibilityMode.Never:
|
case HUDVisibilityMode.Never:
|
||||||
ShowHud.Value = false;
|
ShowHud.Value = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HUDVisibilityMode.HideDuringBreaks:
|
|
||||||
// always show during replay as we want the seek bar to be visible.
|
|
||||||
ShowHud.Value = replayLoaded.Value || !IsBreakTime.Value;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case HUDVisibilityMode.HideDuringGameplay:
|
case HUDVisibilityMode.HideDuringGameplay:
|
||||||
// always show during replay as we want the seek bar to be visible.
|
// always show during replay as we want the seek bar to be visible.
|
||||||
ShowHud.Value = replayLoaded.Value || IsBreakTime.Value;
|
ShowHud.Value = replayLoaded.Value || IsBreakTime.Value;
|
||||||
@ -277,9 +282,21 @@ namespace osu.Game.Screens.Play
|
|||||||
switch (e.Key)
|
switch (e.Key)
|
||||||
{
|
{
|
||||||
case Key.Tab:
|
case Key.Tab:
|
||||||
configVisibilityMode.Value = configVisibilityMode.Value != HUDVisibilityMode.Never
|
switch (configVisibilityMode.Value)
|
||||||
? HUDVisibilityMode.Never
|
{
|
||||||
: HUDVisibilityMode.HideDuringGameplay;
|
case HUDVisibilityMode.Never:
|
||||||
|
configVisibilityMode.Value = HUDVisibilityMode.HideDuringGameplay;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case HUDVisibilityMode.HideDuringGameplay:
|
||||||
|
configVisibilityMode.Value = HUDVisibilityMode.Always;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case HUDVisibilityMode.Always:
|
||||||
|
configVisibilityMode.Value = HUDVisibilityMode.Never;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -351,5 +368,29 @@ namespace osu.Game.Screens.Play
|
|||||||
HealthDisplay?.BindHealthProcessor(processor);
|
HealthDisplay?.BindHealthProcessor(processor);
|
||||||
FailingLayer?.BindHealthProcessor(processor);
|
FailingLayer?.BindHealthProcessor(processor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool OnPressed(GlobalAction action)
|
||||||
|
{
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case GlobalAction.HoldForHUD:
|
||||||
|
holdingForHUD = true;
|
||||||
|
updateVisibility();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnReleased(GlobalAction action)
|
||||||
|
{
|
||||||
|
switch (action)
|
||||||
|
{
|
||||||
|
case GlobalAction.HoldForHUD:
|
||||||
|
holdingForHUD = false;
|
||||||
|
updateVisibility();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,8 @@ namespace osu.Game.Screens.Ranking.Expanded
|
|||||||
private const float padding = 10;
|
private const float padding = 10;
|
||||||
|
|
||||||
private readonly ScoreInfo score;
|
private readonly ScoreInfo score;
|
||||||
|
private readonly bool withFlair;
|
||||||
|
|
||||||
private readonly List<StatisticDisplay> statisticDisplays = new List<StatisticDisplay>();
|
private readonly List<StatisticDisplay> statisticDisplays = new List<StatisticDisplay>();
|
||||||
|
|
||||||
private FillFlowContainer starAndModDisplay;
|
private FillFlowContainer starAndModDisplay;
|
||||||
@ -41,9 +43,11 @@ namespace osu.Game.Screens.Ranking.Expanded
|
|||||||
/// Creates a new <see cref="ExpandedPanelMiddleContent"/>.
|
/// Creates a new <see cref="ExpandedPanelMiddleContent"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="score">The score to display.</param>
|
/// <param name="score">The score to display.</param>
|
||||||
public ExpandedPanelMiddleContent(ScoreInfo score)
|
/// <param name="withFlair">Whether to add flair for a new score being set.</param>
|
||||||
|
public ExpandedPanelMiddleContent(ScoreInfo score, bool withFlair = false)
|
||||||
{
|
{
|
||||||
this.score = score;
|
this.score = score;
|
||||||
|
this.withFlair = withFlair;
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
Masking = true;
|
Masking = true;
|
||||||
@ -266,6 +270,9 @@ namespace osu.Game.Screens.Ranking.Expanded
|
|||||||
delay += 200;
|
delay += 200;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!withFlair)
|
||||||
|
FinishTransforms(true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (Score != null)
|
if (Score != null)
|
||||||
ScorePanelList.AddScore(Score);
|
ScorePanelList.AddScore(Score, true);
|
||||||
|
|
||||||
if (player != null && allowRetry)
|
if (player != null && allowRetry)
|
||||||
{
|
{
|
||||||
|
@ -85,6 +85,8 @@ namespace osu.Game.Screens.Ranking
|
|||||||
|
|
||||||
public readonly ScoreInfo Score;
|
public readonly ScoreInfo Score;
|
||||||
|
|
||||||
|
private bool displayWithFlair;
|
||||||
|
|
||||||
private Container content;
|
private Container content;
|
||||||
|
|
||||||
private Container topLayerContainer;
|
private Container topLayerContainer;
|
||||||
@ -97,9 +99,10 @@ namespace osu.Game.Screens.Ranking
|
|||||||
private Container middleLayerContentContainer;
|
private Container middleLayerContentContainer;
|
||||||
private Drawable middleLayerContent;
|
private Drawable middleLayerContent;
|
||||||
|
|
||||||
public ScorePanel(ScoreInfo score)
|
public ScorePanel(ScoreInfo score, bool isNewLocalScore = false)
|
||||||
{
|
{
|
||||||
Score = score;
|
Score = score;
|
||||||
|
displayWithFlair = isNewLocalScore;
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -188,7 +191,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
|
|
||||||
state = value;
|
state = value;
|
||||||
|
|
||||||
if (LoadState >= LoadState.Ready)
|
if (IsLoaded)
|
||||||
updateState();
|
updateState();
|
||||||
|
|
||||||
StateChanged?.Invoke(value);
|
StateChanged?.Invoke(value);
|
||||||
@ -209,7 +212,10 @@ namespace osu.Game.Screens.Ranking
|
|||||||
middleLayerBackground.FadeColour(expanded_middle_layer_colour, resize_duration, Easing.OutQuint);
|
middleLayerBackground.FadeColour(expanded_middle_layer_colour, resize_duration, Easing.OutQuint);
|
||||||
|
|
||||||
topLayerContentContainer.Add(topLayerContent = new ExpandedPanelTopContent(Score.User).With(d => d.Alpha = 0));
|
topLayerContentContainer.Add(topLayerContent = new ExpandedPanelTopContent(Score.User).With(d => d.Alpha = 0));
|
||||||
middleLayerContentContainer.Add(middleLayerContent = new ExpandedPanelMiddleContent(Score).With(d => d.Alpha = 0));
|
middleLayerContentContainer.Add(middleLayerContent = new ExpandedPanelMiddleContent(Score, displayWithFlair).With(d => d.Alpha = 0));
|
||||||
|
|
||||||
|
// only the first expanded display should happen with flair.
|
||||||
|
displayWithFlair = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PanelState.Contracted:
|
case PanelState.Contracted:
|
||||||
|
@ -95,9 +95,10 @@ namespace osu.Game.Screens.Ranking
|
|||||||
/// Adds a <see cref="ScoreInfo"/> to this list.
|
/// Adds a <see cref="ScoreInfo"/> to this list.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="score">The <see cref="ScoreInfo"/> to add.</param>
|
/// <param name="score">The <see cref="ScoreInfo"/> to add.</param>
|
||||||
public ScorePanel AddScore(ScoreInfo score)
|
/// <param name="isNewLocalScore">Whether this is a score that has just been achieved locally. Controls whether flair is added to the display or not.</param>
|
||||||
|
public ScorePanel AddScore(ScoreInfo score, bool isNewLocalScore = false)
|
||||||
{
|
{
|
||||||
var panel = new ScorePanel(score)
|
var panel = new ScorePanel(score, isNewLocalScore)
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.CentreLeft,
|
Origin = Anchor.CentreLeft,
|
||||||
@ -117,19 +118,24 @@ namespace osu.Game.Screens.Ranking
|
|||||||
d.Origin = Anchor.Centre;
|
d.Origin = Anchor.Centre;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if (SelectedScore.Value == score)
|
if (IsLoaded)
|
||||||
selectedScoreChanged(new ValueChangedEvent<ScoreInfo>(SelectedScore.Value, SelectedScore.Value));
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// We want the scroll position to remain relative to the expanded panel. When a new panel is added after the expanded panel, nothing needs to be done.
|
if (SelectedScore.Value == score)
|
||||||
// But when a panel is added before the expanded panel, we need to offset the scroll position by the width of the new panel.
|
|
||||||
if (expandedPanel != null && flow.GetPanelIndex(score) < flow.GetPanelIndex(expandedPanel.Score))
|
|
||||||
{
|
{
|
||||||
// A somewhat hacky property is used here because we need to:
|
SelectedScore.TriggerChange();
|
||||||
// 1) Scroll after the scroll container's visible range is updated.
|
}
|
||||||
// 2) Scroll before the scroll container's scroll position is updated.
|
else
|
||||||
// Without this, we would have a 1-frame positioning error which looks very jarring.
|
{
|
||||||
scroll.InstantScrollTarget = (scroll.InstantScrollTarget ?? scroll.Target) + ScorePanel.CONTRACTED_WIDTH + panel_spacing;
|
// We want the scroll position to remain relative to the expanded panel. When a new panel is added after the expanded panel, nothing needs to be done.
|
||||||
|
// But when a panel is added before the expanded panel, we need to offset the scroll position by the width of the new panel.
|
||||||
|
if (expandedPanel != null && flow.GetPanelIndex(score) < flow.GetPanelIndex(expandedPanel.Score))
|
||||||
|
{
|
||||||
|
// A somewhat hacky property is used here because we need to:
|
||||||
|
// 1) Scroll after the scroll container's visible range is updated.
|
||||||
|
// 2) Scroll before the scroll container's scroll position is updated.
|
||||||
|
// Without this, we would have a 1-frame positioning error which looks very jarring.
|
||||||
|
scroll.InstantScrollTarget = (scroll.InstantScrollTarget ?? scroll.Target) + ScorePanel.CONTRACTED_WIDTH + panel_spacing;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,11 +148,15 @@ namespace osu.Game.Screens.Ranking
|
|||||||
/// <param name="score">The <see cref="ScoreInfo"/> to present.</param>
|
/// <param name="score">The <see cref="ScoreInfo"/> to present.</param>
|
||||||
private void selectedScoreChanged(ValueChangedEvent<ScoreInfo> score)
|
private void selectedScoreChanged(ValueChangedEvent<ScoreInfo> score)
|
||||||
{
|
{
|
||||||
// Contract the old panel.
|
// avoid contracting panels unnecessarily when TriggerChange is fired manually.
|
||||||
foreach (var t in flow.Where(t => t.Panel.Score == score.OldValue))
|
if (score.OldValue != score.NewValue)
|
||||||
{
|
{
|
||||||
t.Panel.State = PanelState.Contracted;
|
// Contract the old panel.
|
||||||
t.Margin = new MarginPadding();
|
foreach (var t in flow.Where(t => t.Panel.Score == score.OldValue))
|
||||||
|
{
|
||||||
|
t.Panel.State = PanelState.Contracted;
|
||||||
|
t.Margin = new MarginPadding();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the panel corresponding to the new score.
|
// Find the panel corresponding to the new score.
|
||||||
@ -162,12 +172,16 @@ namespace osu.Game.Screens.Ranking
|
|||||||
expandedTrackingComponent.Margin = new MarginPadding { Horizontal = expanded_panel_spacing };
|
expandedTrackingComponent.Margin = new MarginPadding { Horizontal = expanded_panel_spacing };
|
||||||
expandedPanel.State = PanelState.Expanded;
|
expandedPanel.State = PanelState.Expanded;
|
||||||
|
|
||||||
// Scroll to the new panel. This is done manually since we need:
|
// requires schedule after children to ensure the flow (and thus ScrollContainer's ScrollableExtent) has been updated.
|
||||||
// 1) To scroll after the scroll container's visible range is updated.
|
ScheduleAfterChildren(() =>
|
||||||
// 2) To account for the centre anchor/origins of panels.
|
{
|
||||||
// In the end, it's easier to compute the scroll position manually.
|
// Scroll to the new panel. This is done manually since we need:
|
||||||
float scrollOffset = flow.GetPanelIndex(expandedPanel.Score) * (ScorePanel.CONTRACTED_WIDTH + panel_spacing);
|
// 1) To scroll after the scroll container's visible range is updated.
|
||||||
scroll.ScrollTo(scrollOffset);
|
// 2) To account for the centre anchor/origins of panels.
|
||||||
|
// In the end, it's easier to compute the scroll position manually.
|
||||||
|
float scrollOffset = flow.GetPanelIndex(expandedPanel.Score) * (ScorePanel.CONTRACTED_WIDTH + panel_spacing);
|
||||||
|
scroll.ScrollTo(scrollOffset);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
@ -300,6 +300,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public MetadataSection(string title)
|
public MetadataSection(string title)
|
||||||
{
|
{
|
||||||
|
Alpha = 0;
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
var terms = Beatmap.SearchableTerms;
|
var terms = Beatmap.SearchableTerms;
|
||||||
|
|
||||||
foreach (var criteriaTerm in criteria.SearchTerms)
|
foreach (var criteriaTerm in criteria.SearchTerms)
|
||||||
match &= terms.Any(term => term.IndexOf(criteriaTerm, StringComparison.InvariantCultureIgnoreCase) >= 0);
|
match &= terms.Any(term => term.Contains(criteriaTerm, StringComparison.InvariantCultureIgnoreCase));
|
||||||
|
|
||||||
// if a match wasn't found via text matching of terms, do a second catch-all check matching against online IDs.
|
// if a match wasn't found via text matching of terms, do a second catch-all check matching against online IDs.
|
||||||
// this should be done after text matching so we can prioritise matching numbers in metadata.
|
// this should be done after text matching so we can prioritise matching numbers in metadata.
|
||||||
|
@ -126,7 +126,7 @@ namespace osu.Game.Screens.Select
|
|||||||
if (string.IsNullOrEmpty(value))
|
if (string.IsNullOrEmpty(value))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return value.IndexOf(SearchTerm, StringComparison.InvariantCultureIgnoreCase) >= 0;
|
return value.Contains(SearchTerm, StringComparison.InvariantCultureIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string SearchTerm;
|
public string SearchTerm;
|
||||||
|
@ -32,11 +32,7 @@ namespace osu.Game.Screens.Select
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
BeatmapOptions.AddButton(@"Edit", @"beatmap", FontAwesome.Solid.PencilAlt, colours.Yellow, () =>
|
BeatmapOptions.AddButton(@"Edit", @"beatmap", FontAwesome.Solid.PencilAlt, colours.Yellow, () => Edit());
|
||||||
{
|
|
||||||
ValidForResume = false;
|
|
||||||
Edit();
|
|
||||||
});
|
|
||||||
|
|
||||||
((PlayBeatmapDetailArea)BeatmapDetails).Leaderboard.ScoreSelected += PresentScore;
|
((PlayBeatmapDetailArea)BeatmapDetails).Leaderboard.ScoreSelected += PresentScore;
|
||||||
}
|
}
|
||||||
|
@ -180,9 +180,8 @@ namespace osu.Game.Tests.Beatmaps
|
|||||||
private readonly BeatmapInfo skinBeatmapInfo;
|
private readonly BeatmapInfo skinBeatmapInfo;
|
||||||
private readonly IResourceStore<byte[]> resourceStore;
|
private readonly IResourceStore<byte[]> resourceStore;
|
||||||
|
|
||||||
public TestWorkingBeatmap(BeatmapInfo skinBeatmapInfo, IResourceStore<byte[]> resourceStore, IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock referenceClock, AudioManager audio,
|
public TestWorkingBeatmap(BeatmapInfo skinBeatmapInfo, IResourceStore<byte[]> resourceStore, IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock referenceClock, AudioManager audio)
|
||||||
double length = 60000)
|
: base(beatmap, storyboard, referenceClock, audio)
|
||||||
: base(beatmap, storyboard, referenceClock, audio, length)
|
|
||||||
{
|
{
|
||||||
this.skinBeatmapInfo = skinBeatmapInfo;
|
this.skinBeatmapInfo = skinBeatmapInfo;
|
||||||
this.resourceStore = resourceStore;
|
this.resourceStore = resourceStore;
|
||||||
|
@ -23,6 +23,7 @@ using osu.Game.Online.API;
|
|||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Screens;
|
using osu.Game.Screens;
|
||||||
using osu.Game.Storyboards;
|
using osu.Game.Storyboards;
|
||||||
@ -222,18 +223,23 @@ namespace osu.Game.Tests.Visual
|
|||||||
/// <param name="storyboard">The storyboard.</param>
|
/// <param name="storyboard">The storyboard.</param>
|
||||||
/// <param name="referenceClock">An optional clock which should be used instead of a stopwatch for virtual time progression.</param>
|
/// <param name="referenceClock">An optional clock which should be used instead of a stopwatch for virtual time progression.</param>
|
||||||
/// <param name="audio">Audio manager. Required if a reference clock isn't provided.</param>
|
/// <param name="audio">Audio manager. Required if a reference clock isn't provided.</param>
|
||||||
/// <param name="length">The length of the returned virtual track.</param>
|
public ClockBackedTestWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock referenceClock, AudioManager audio)
|
||||||
public ClockBackedTestWorkingBeatmap(IBeatmap beatmap, Storyboard storyboard, IFrameBasedClock referenceClock, AudioManager audio, double length = 60000)
|
|
||||||
: base(beatmap, storyboard, audio)
|
: base(beatmap, storyboard, audio)
|
||||||
{
|
{
|
||||||
|
double trackLength = 60000;
|
||||||
|
|
||||||
|
if (beatmap.HitObjects.Count > 0)
|
||||||
|
// add buffer after last hitobject to allow for final replay frames etc.
|
||||||
|
trackLength = Math.Max(trackLength, beatmap.HitObjects.Max(h => h.GetEndTime()) + 2000);
|
||||||
|
|
||||||
if (referenceClock != null)
|
if (referenceClock != null)
|
||||||
{
|
{
|
||||||
store = new TrackVirtualStore(referenceClock);
|
store = new TrackVirtualStore(referenceClock);
|
||||||
audio.AddItem(store);
|
audio.AddItem(store);
|
||||||
track = store.GetVirtual(length);
|
track = store.GetVirtual(trackLength);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
track = audio?.Tracks.GetVirtual(length);
|
track = audio?.Tracks.GetVirtual(trackLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
~ClockBackedTestWorkingBeatmap()
|
~ClockBackedTestWorkingBeatmap()
|
||||||
|
@ -18,7 +18,7 @@ namespace osu.Game.Tests.Visual
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether custom test steps are provided. Custom tests should invoke <see cref="CreateTest"/> to create the test steps.
|
/// Whether custom test steps are provided. Custom tests should invoke <see cref="CreateTest"/> to create the test steps.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual bool HasCustomSteps { get; } = false;
|
protected virtual bool HasCustomSteps => false;
|
||||||
|
|
||||||
protected TestPlayer Player;
|
protected TestPlayer Player;
|
||||||
|
|
||||||
|
@ -26,7 +26,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.1019.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.1029.1" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.1016.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.1016.0" />
|
||||||
<PackageReference Include="Sentry" Version="2.1.6" />
|
<PackageReference Include="Sentry" Version="2.1.6" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<Reference Include="System.Net.Http" />
|
<Reference Include="System.Net.Http" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup Label="Package References">
|
<ItemGroup Label="Package References">
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.1019.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2020.1029.1" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.1016.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2020.1016.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. -->
|
||||||
@ -80,7 +80,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.1019.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2020.1029.1" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.26.0" />
|
<PackageReference Include="SharpCompress" Version="0.26.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…
x
Reference in New Issue
Block a user