mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Merge branch 'master' into fl-slider
This commit is contained in:
9
.github/workflows/ci.yml
vendored
9
.github/workflows/ci.yml
vendored
@ -78,15 +78,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
dotnet-version: "6.0.x"
|
dotnet-version: "6.0.x"
|
||||||
|
|
||||||
# FIXME: libavformat is not included in Ubuntu. Let's fix that.
|
|
||||||
# https://github.com/ppy/osu-framework/issues/4349
|
|
||||||
# Remove this once https://github.com/actions/virtual-environments/issues/3306 has been resolved.
|
|
||||||
- name: Install libavformat-dev
|
|
||||||
if: ${{matrix.os.fullname == 'ubuntu-latest'}}
|
|
||||||
run: |
|
|
||||||
sudo apt-get update && \
|
|
||||||
sudo apt-get -y install libavformat-dev
|
|
||||||
|
|
||||||
- name: Compile
|
- name: Compile
|
||||||
run: dotnet build -c Debug -warnaserror osu.Desktop.slnf
|
run: dotnet build -c Debug -warnaserror osu.Desktop.slnf
|
||||||
|
|
||||||
|
@ -898,5 +898,24 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.That(controlPoints[3].Type, Is.Null);
|
Assert.That(controlPoints[3].Type, Is.Null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestLegacyDuplicateInitialCatmullPointIsMerged()
|
||||||
|
{
|
||||||
|
var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false };
|
||||||
|
|
||||||
|
using (var resStream = TestResources.OpenResource("catmull-duplicate-initial-controlpoint.osu"))
|
||||||
|
using (var stream = new LineBufferedReader(resStream))
|
||||||
|
{
|
||||||
|
var decoded = decoder.Decode(stream);
|
||||||
|
var controlPoints = ((IHasPath)decoded.HitObjects[0]).Path.ControlPoints;
|
||||||
|
|
||||||
|
Assert.That(controlPoints.Count, Is.EqualTo(4));
|
||||||
|
Assert.That(controlPoints[0].Type, Is.EqualTo(PathType.Catmull));
|
||||||
|
Assert.That(controlPoints[0].Position, Is.EqualTo(Vector2.Zero));
|
||||||
|
Assert.That(controlPoints[1].Type, Is.Null);
|
||||||
|
Assert.That(controlPoints[1].Position, Is.Not.EqualTo(Vector2.Zero));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
[HitObjects]
|
||||||
|
200,304,23875,6,0,C|200:304|288:304|288:208|352:208,1,260,8|0
|
@ -8,9 +8,11 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Extensions;
|
using osu.Framework.Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.UserInterface;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Collections;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Online.Leaderboards;
|
using osu.Game.Online.Leaderboards;
|
||||||
@ -54,6 +56,39 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
exitViaEscapeAndConfirm();
|
exitViaEscapeAndConfirm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestSongSelectBackActionHandling()
|
||||||
|
{
|
||||||
|
TestPlaySongSelect songSelect = null;
|
||||||
|
|
||||||
|
PushAndConfirm(() => songSelect = new TestPlaySongSelect());
|
||||||
|
|
||||||
|
AddStep("set filter", () => songSelect.ChildrenOfType<SearchTextBox>().Single().Current.Value = "test");
|
||||||
|
AddStep("press back", () => InputManager.Click(MouseButton.Button1));
|
||||||
|
|
||||||
|
AddAssert("still at song select", () => Game.ScreenStack.CurrentScreen == songSelect);
|
||||||
|
AddAssert("filter cleared", () => string.IsNullOrEmpty(songSelect.ChildrenOfType<SearchTextBox>().Single().Current.Value));
|
||||||
|
|
||||||
|
AddStep("set filter again", () => songSelect.ChildrenOfType<SearchTextBox>().Single().Current.Value = "test");
|
||||||
|
AddStep("open collections dropdown", () =>
|
||||||
|
{
|
||||||
|
InputManager.MoveMouseTo(songSelect.ChildrenOfType<CollectionFilterDropdown>().Single());
|
||||||
|
InputManager.Click(MouseButton.Left);
|
||||||
|
});
|
||||||
|
|
||||||
|
AddStep("press back once", () => InputManager.Click(MouseButton.Button1));
|
||||||
|
AddAssert("still at song select", () => Game.ScreenStack.CurrentScreen == songSelect);
|
||||||
|
AddAssert("collections dropdown closed", () => songSelect
|
||||||
|
.ChildrenOfType<CollectionFilterDropdown>().Single()
|
||||||
|
.ChildrenOfType<Dropdown<CollectionFilterMenuItem>.DropdownMenu>().Single().State == MenuState.Closed);
|
||||||
|
|
||||||
|
AddStep("press back a second time", () => InputManager.Click(MouseButton.Button1));
|
||||||
|
AddAssert("filter cleared", () => string.IsNullOrEmpty(songSelect.ChildrenOfType<SearchTextBox>().Single().Current.Value));
|
||||||
|
|
||||||
|
AddStep("press back a third time", () => InputManager.Click(MouseButton.Button1));
|
||||||
|
ConfirmAtMainMenu();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This tests that the F1 key will open the mod select overlay, and not be handled / blocked by the music controller (which has the same default binding
|
/// This tests that the F1 key will open the mod select overlay, and not be handled / blocked by the music controller (which has the same default binding
|
||||||
/// but should be handled *after* song select).
|
/// but should be handled *after* song select).
|
||||||
@ -487,6 +522,9 @@ namespace osu.Game.Tests.Visual.Navigation
|
|||||||
AddStep("move cursor to background", () => InputManager.MoveMouseTo(Game.ScreenSpaceDrawQuad.BottomRight));
|
AddStep("move cursor to background", () => InputManager.MoveMouseTo(Game.ScreenSpaceDrawQuad.BottomRight));
|
||||||
AddStep("click left mouse button", () => InputManager.Click(MouseButton.Left));
|
AddStep("click left mouse button", () => InputManager.Click(MouseButton.Left));
|
||||||
AddAssert("now playing is hidden", () => nowPlayingOverlay.State.Value == Visibility.Hidden);
|
AddAssert("now playing is hidden", () => nowPlayingOverlay.State.Value == Visibility.Hidden);
|
||||||
|
|
||||||
|
// move the mouse firmly inside game bounds to avoid interfering with other tests.
|
||||||
|
AddStep("center cursor", () => InputManager.MoveMouseTo(Game.ScreenSpaceDrawQuad.Centre));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -12,9 +12,12 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
|
using osu.Framework.Input.Bindings;
|
||||||
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Localisation;
|
using osu.Framework.Localisation;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Sprites;
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osu.Game.Input.Bindings;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
@ -31,7 +34,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
#region OsuDropdownMenu
|
#region OsuDropdownMenu
|
||||||
|
|
||||||
protected class OsuDropdownMenu : DropdownMenu
|
protected class OsuDropdownMenu : DropdownMenu, IKeyBindingHandler<GlobalAction>
|
||||||
{
|
{
|
||||||
public override bool HandleNonPositionalInput => State == MenuState.Open;
|
public override bool HandleNonPositionalInput => State == MenuState.Open;
|
||||||
|
|
||||||
@ -275,6 +278,23 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||||
|
{
|
||||||
|
if (e.Repeat) return false;
|
||||||
|
|
||||||
|
if (e.Action == GlobalAction.Back)
|
||||||
|
{
|
||||||
|
State = MenuState.Closed;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -32,6 +32,9 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
[Description("Pending & WIP")]
|
[Description("Pending & WIP")]
|
||||||
Pending,
|
Pending,
|
||||||
|
|
||||||
|
[LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.StatusWip))]
|
||||||
|
Wip,
|
||||||
|
|
||||||
[LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.StatusGraveyard))]
|
[LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.StatusGraveyard))]
|
||||||
Graveyard,
|
Graveyard,
|
||||||
|
|
||||||
|
@ -21,6 +21,9 @@ namespace osu.Game.Overlays.BeatmapListing
|
|||||||
[Description("Subscribed mappers")]
|
[Description("Subscribed mappers")]
|
||||||
Follows,
|
Follows,
|
||||||
|
|
||||||
|
[LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.GeneralSpotlights))]
|
||||||
|
Spotlights,
|
||||||
|
|
||||||
[LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.GeneralFeaturedArtists))]
|
[LocalisableDescription(typeof(BeatmapsStrings), nameof(BeatmapsStrings.GeneralFeaturedArtists))]
|
||||||
[Description("Featured artists")]
|
[Description("Featured artists")]
|
||||||
FeaturedArtists
|
FeaturedArtists
|
||||||
|
@ -340,8 +340,10 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
if (vertices[endIndex].Position != vertices[endIndex - 1].Position)
|
if (vertices[endIndex].Position != vertices[endIndex - 1].Position)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Adjacent legacy Catmull segments should be treated as a single segment.
|
// Legacy Catmull sliders don't support multiple segments, so adjacent Catmull segments should be treated as a single one.
|
||||||
if (FormatVersion < LegacyBeatmapEncoder.FIRST_LAZER_VERSION && type == PathType.Catmull)
|
// Importantly, this is not applied to the first control point, which may duplicate the slider path's position
|
||||||
|
// resulting in a duplicate (0,0) control point in the resultant list.
|
||||||
|
if (type == PathType.Catmull && endIndex > 1 && FormatVersion < LegacyBeatmapEncoder.FIRST_LAZER_VERSION)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// The last control point of each segment is not allowed to start a new implicit segment.
|
// The last control point of each segment is not allowed to start a new implicit segment.
|
||||||
|
Reference in New Issue
Block a user