forked from ppy/osu
-
Notifications
You must be signed in to change notification settings - Fork 0
osu#2 #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
osu#2 #81
Changes from all commits
Commits
Show all changes
77 commits
Select commit
Hold shift + click to select a range
5cdf07c
Make grouped friend notifications Transient and not important (#36620)
SupDos 239951e
Fix seeking to previous bookmark not working when song is playing (#3…
Joehuu 7263551
Improve handling of account registration errors (#36600)
bdach bb04a18
Localise "lounge" & "quick play" in `ButtonSystem` (#36220)
diquoks 0a4497d
Fix local beatmap metadata not being cleared when previously selecte…
Joehuu bb83f3d
Fix unreliable async loading due to incorrect single-child assumption
peppy 0198203
Allow binding left/right modifier keys separately for gameplay bindin…
failaip12 60d98f0
Improve adjusting mods settings values with keyboard (#36090)
diquoks efd4d12
Add info about damage dealt to ranked play user state (#36627)
minetoblend f39b310
Add missing wait step to fix flaky test in `TestSceneModPresetColumn`
peppy cae8d3f
Update production endpoints in an attempt to fix Russian player conne…
peppy b613c1d
Merge pull request #36635 from peppy/update-production-endpoints
bdach a1136c3
Update framework (#36637)
peppy dbce888
Rename `Ruleset.GetHitResults{ -> ForDisplay}()`
bdach 3678ea0
Publicise `Ruleset.GetValidHitResults()`
bdach 15c49a7
Adjust contract of `Ruleset.GetValidHitResults()` to always enumerate…
bdach 655d725
Perform extra checks when loading rulesets (#36641)
bdach c59e5bf
Merge pull request #36639 from bdach/actually-all-valid-hit-results
peppy 56bc80f
Update resources
peppy 50426eb
Refactor UpdateableTeamFlag for use on team overlay (#36286)
LiquidPL 5afd6c6
Add user role to `MultiplayerRoomUser` (#36652)
bdach 860427e
Fix corner radius for user tag glow (#36659)
netineko 94d9de9
Add explanations for scoring mode used in ranked & total score toolti…
bdach 87f323a
Update resources
peppy 2f459dd
Preserve bookmarks when creating a new difficulty from scratch (#36675)
64ArthurAraujo 810edeb
Fix extra lives in Easy mod potentially getting reapplied during game…
bdach 8e26cf4
Restore previous beatmap when leaving scoped mode (#36582)
LiquidPL fc4e297
Use directory of last-selected sample as initial directory in sample …
bdach 42bf254
Fix osu! editor composer scale handles not updating correctly when se…
bdach 94cec71
Prevent tagging beatmaps when played with conversion mods (#36684)
imvanni 71583bc
Add basic support for `scoreentry-` skinnable text
peppy 6e03d5b
Show initial key placeholder / trigger name using non-skinned font
peppy cc9a5ed
Update resources
peppy 86ab507
Use default overlap of 1
peppy 7445efa
Ensure state resets back to initial display on rewind
peppy 9fa7812
Merge pull request #36687 from peppy/legacy-key-counter-skinnable-font
bdach f15e086
Add "spin" keyword for menu cursor rotation
peppy 83587e2
Add ability for `LoadingLayer` to block all keyboard input
peppy 93d1a61
Migrate playlist freestyle select screen to use `SongSelectV2`
peppy fb8c228
Add test coverage of actual user flows involving freestyle select screen
peppy 110f11f
Fade out header line for now to avoid visual overlap
peppy d33a6d5
Add ability for `LoadingLayer` to block all keyboard input
peppy 4854473
Migrate multiplayer freestyle select screen to use `SongSelectV2`
peppy 25d6308
Merge pull request #36695 from peppy/loading-layer-block-non-positional
bdach e15cb08
Privatise setter
bdach 1153d17
Disallow use of scoping button when at freestyle song select
peppy f9f927f
Disable footer buttons on freestyle song select
bdach 9ae9964
Merge pull request #36694 from peppy/freestyle-select-update
bdach d3b4836
Merge branch 'master' into multiplayer-freestyle-select
bdach 69c2747
Merge pull request #36696 from peppy/multiplayer-freestyle-select
bdach 1e8b9a7
Adjust nightcore sample playback to not stop randomly and be closer t…
bdach c144cf1
Fix reversing straight perfect curve sliders positioning them weirdly…
64ArthurAraujo 29a39cb
Fix spectator player cells not having initial shadow edge effect set …
Joehuu d139f59
Update resources
peppy a09489d
Move transformation logic local to transient drawable
peppy 4916c87
Move toolbar button text local to single usage in `ToolbarUserButton`
peppy f39615a
Move spacing local to usages
peppy e2cbfb9
Merge pull request #36738 from peppy/user-button-animation-fix
bdach efc9a27
Remove no longer used class
peppy cb12d35
Combine old classes to provide better starting point for migration
peppy fabce18
Remove `V2` suffix from migrated classes
peppy 5602281
Merge pull request #36745 from peppy/song-select-cleanup
bdach ccb0224
Attempt to fix "copy labels from issues" workflow permissions again
bdach 5b1d4ce
Merge pull request #36746 from bdach/fix-thing-again
peppy ee8d990
Rename one more missed song select v2 class
peppy 99ab245
Tidy up how `SettingsSubsection` headings are created
peppy cb597c4
Fix flow animating its display initially when it shouldn't
peppy 047ea7c
Fix hidden settings flow content still being interactive
peppy 0dfb362
Use `HotkeyDisplay` for toolbar buttons (#36750)
netineko 32d1040
Merge pull request #36751 from peppy/fix-hidden-controls-settings
bdach 5174d8b
Fix changing normal sample bank via keyboard hotkeys not updating add…
bdach 7e2771c
Improve usability of sample bank toggles (#36753)
bdach 5131b18
Remove redundant footer from `TestScenePlaylistsRoomSubscreen`
LiquidPL 2e659a7
Merge pull request #36767 from LiquidPL/cleanup-online-play-tests
peppy c72b641
Add pool type to matchmaking room invited event (#36765)
smoogipoo 105342e
Migrate sheared overlay tests to `ScreenTestScene` (#36736)
LiquidPL 9c489aa
Use better text structure for `ScreenshotSaved` notification (#36701)
diquoks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,10 +3,13 @@ | |
|
|
||
| using System.Linq; | ||
| using NUnit.Framework; | ||
| using osu.Framework.Testing; | ||
| using osu.Framework.Utils; | ||
| using osu.Game.Beatmaps; | ||
| using osu.Game.Rulesets.Objects; | ||
| using osu.Game.Rulesets.Objects.Types; | ||
| using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders; | ||
| using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components; | ||
| using osu.Game.Rulesets.Osu.Objects; | ||
| using osu.Game.Rulesets.Osu.UI; | ||
| using osu.Game.Tests.Beatmaps; | ||
|
|
@@ -30,6 +33,16 @@ public partial class TestSceneSliderReversal : TestSceneOsuEditor | |
| PathType.LINEAR, | ||
| new Vector2(100, 0), | ||
| new Vector2(100, 100) | ||
| ), | ||
| createPathSegment( | ||
| PathType.PERFECT_CURVE, | ||
| new Vector2(100.009f, -50.0009f), | ||
| new Vector2(200.0089f, -100) | ||
| ), | ||
| createPathSegment( | ||
| PathType.PERFECT_CURVE, | ||
| new Vector2(25, -50), | ||
| new Vector2(100, 75) | ||
| ) | ||
| }; | ||
|
|
||
|
|
@@ -48,9 +61,13 @@ private static PathControlPoint[] createPathSegment(PathType type, params Vector | |
|
|
||
| [TestCase(0, 250)] | ||
| [TestCase(0, 200)] | ||
| [TestCase(1, 120)] | ||
| [TestCase(1, 80)] | ||
| public void TestSliderReversal(int pathIndex, double length) | ||
| [TestCase(1, 120, false, false)] | ||
| [TestCase(1, 80, false, false)] | ||
| [TestCase(2, 250)] | ||
| [TestCase(2, 190)] | ||
| [TestCase(3, 250)] | ||
| [TestCase(3, 190)] | ||
| public void TestSliderReversal(int pathIndex, double length, bool assertEqualDistances = true, bool assertSliderReduction = true) | ||
| { | ||
| var controlPoints = paths[pathIndex]; | ||
|
|
||
|
|
@@ -90,6 +107,215 @@ public void TestSliderReversal(int pathIndex, double length) | |
| InputManager.ReleaseKey(Key.LControl); | ||
| }); | ||
|
|
||
| if (pathIndex == 2) | ||
| { | ||
| AddRepeatStep("Reverse slider again", () => | ||
| { | ||
| InputManager.PressKey(Key.LControl); | ||
| InputManager.Key(Key.G); | ||
| InputManager.ReleaseKey(Key.LControl); | ||
| }, 2); | ||
| } | ||
|
|
||
| if (assertEqualDistances) | ||
| { | ||
| AddAssert("Middle control point has the same distance from start to end", () => | ||
| { | ||
| var pathControlPoints = selectedSlider.Path.ControlPoints; | ||
| float middleToStart = Vector2.Distance(pathControlPoints[^2].Position, pathControlPoints[0].Position); | ||
| float middleToEnd = Vector2.Distance(pathControlPoints[^2].Position, pathControlPoints[^1].Position); | ||
|
|
||
| return Precision.AlmostEquals(middleToStart, middleToEnd, 1f); | ||
| }); | ||
| } | ||
|
|
||
| AddAssert("Middle control point is not at start or end", () => | ||
| Vector2.Distance(selectedSlider.Path.ControlPoints[^2].Position, oldStartPos) > 1 && | ||
| Vector2.Distance(selectedSlider.Path.ControlPoints[^2].Position, oldEndPos) > 1 | ||
| ); | ||
|
|
||
| AddAssert("Slider has correct length", () => | ||
| Precision.AlmostEquals(selectedSlider.Path.Distance, oldDistance)); | ||
|
|
||
| AddAssert("Slider has correct start position", () => | ||
| Vector2.Distance(selectedSlider.Position, oldEndPos) < 1); | ||
|
|
||
| AddAssert("Slider has correct end position", () => | ||
| Vector2.Distance(selectedSlider.EndPosition, oldStartPos) < 1); | ||
|
|
||
| AddAssert("Control points have correct types", () => | ||
| { | ||
| var newControlPointTypes = selectedSlider.Path.ControlPoints.Select(p => p.Type).ToArray(); | ||
|
|
||
| return oldControlPointTypes.Take(newControlPointTypes.Length).SequenceEqual(newControlPointTypes); | ||
| }); | ||
|
|
||
| if (assertSliderReduction) | ||
| { | ||
| AddStep("Move to marker", () => | ||
| { | ||
| var marker = this.ChildrenOfType<SliderEndDragMarker>().Single(); | ||
| var markerPos = (marker.ScreenSpaceDrawQuad.TopRight + marker.ScreenSpaceDrawQuad.BottomRight) / 2; | ||
| // sometimes the cursor may miss the marker's hitbox so we | ||
| // add a little offset here to be sure it lands in a clickable position. | ||
| var position = new Vector2(markerPos.X + 2f, markerPos.Y); | ||
| InputManager.MoveMouseTo(position); | ||
| }); | ||
| AddStep("Click", () => InputManager.PressButton(MouseButton.Left)); | ||
| AddStep("Reduce slider", () => | ||
| { | ||
| var middleControlPoint = this.ChildrenOfType<PathControlPointPiece<Slider>>().ToArray()[^2]; | ||
| InputManager.MoveMouseTo(middleControlPoint); | ||
| }); | ||
| AddStep("Release click", () => InputManager.ReleaseButton(MouseButton.Left)); | ||
|
|
||
| AddStep("Save half slider info", () => | ||
| { | ||
| oldStartPos = selectedSlider.Position; | ||
| oldEndPos = selectedSlider.EndPosition; | ||
| oldDistance = selectedSlider.Path.Distance; | ||
| }); | ||
|
|
||
| AddStep("Reverse slider", () => | ||
| { | ||
| InputManager.PressKey(Key.LControl); | ||
| InputManager.Key(Key.G); | ||
| InputManager.ReleaseKey(Key.LControl); | ||
| }); | ||
|
|
||
| AddAssert("Middle control point has the same distance from start to end", () => | ||
| { | ||
| var pathControlPoints = selectedSlider.Path.ControlPoints; | ||
| float middleToStart = Vector2.Distance(pathControlPoints[^2].Position, pathControlPoints[0].Position); | ||
| float middleToEnd = Vector2.Distance(pathControlPoints[^2].Position, pathControlPoints[^1].Position); | ||
|
|
||
| return Precision.AlmostEquals(middleToStart, middleToEnd, 1f); | ||
| }); | ||
|
|
||
| AddAssert("Middle control point is not at start or end", () => | ||
| Vector2.Distance(selectedSlider.Path.ControlPoints[^2].Position, oldStartPos) > 1 && | ||
| Vector2.Distance(selectedSlider.Path.ControlPoints[^2].Position, oldEndPos) > 1 | ||
| ); | ||
|
Comment on lines
+195
to
+198
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same coordinate system mismatch. Same issue as noted above at lines 132-135 — path-relative positions compared to absolute coordinates. Proposed fix AddAssert("Middle control point is not at start or end", () =>
- Vector2.Distance(selectedSlider.Path.ControlPoints[^2].Position, oldStartPos) > 1 &&
- Vector2.Distance(selectedSlider.Path.ControlPoints[^2].Position, oldEndPos) > 1
+ Vector2.Distance(selectedSlider.Path.ControlPoints[^2].Position, selectedSlider.Path.ControlPoints[0].Position) > 1 &&
+ Vector2.Distance(selectedSlider.Path.ControlPoints[^2].Position, selectedSlider.Path.ControlPoints[^1].Position) > 1
);🤖 Prompt for AI Agents |
||
|
|
||
| AddAssert("Slider has correct length", () => | ||
| Precision.AlmostEquals(selectedSlider.Path.Distance, oldDistance)); | ||
|
|
||
| AddAssert("Slider has correct start position", () => | ||
| Vector2.Distance(selectedSlider.Position, oldEndPos) < 1); | ||
|
|
||
| AddAssert("Slider has correct end position", () => | ||
| Vector2.Distance(selectedSlider.EndPosition, oldStartPos) < 1); | ||
|
|
||
| AddAssert("Control points have correct types", () => | ||
| { | ||
| var newControlPointTypes = selectedSlider.Path.ControlPoints.Select(p => p.Type).ToArray(); | ||
|
|
||
| return oldControlPointTypes.Take(newControlPointTypes.Length).SequenceEqual(newControlPointTypes); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| [Test] | ||
| public void TestSegmentedSliderReversal() | ||
| { | ||
| PathControlPoint[] segmentedSliderPath = | ||
| [ | ||
| new PathControlPoint | ||
| { | ||
| Position = new Vector2(0, 0), | ||
| Type = PathType.PERFECT_CURVE | ||
| }, | ||
| new PathControlPoint | ||
| { | ||
| Position = new Vector2(100, 150), | ||
| }, | ||
| new PathControlPoint | ||
| { | ||
| Position = new Vector2(75, -50), | ||
| Type = PathType.PERFECT_CURVE | ||
| }, | ||
| new PathControlPoint | ||
| { | ||
| Position = new Vector2(225, -75), | ||
| }, | ||
| new PathControlPoint | ||
| { | ||
| Position = new Vector2(350, 50), | ||
| Type = PathType.PERFECT_CURVE | ||
| }, | ||
| new PathControlPoint | ||
| { | ||
| Position = new Vector2(500, -75), | ||
| }, | ||
| new PathControlPoint | ||
| { | ||
| Position = new Vector2(350, -120), | ||
| }, | ||
| ]; | ||
|
|
||
| Vector2 oldStartPos = default; | ||
| Vector2 oldEndPos = default; | ||
| double oldDistance = default; | ||
|
|
||
| var oldControlPointTypes = segmentedSliderPath.Select(p => p.Type); | ||
|
|
||
| AddStep("Add slider", () => | ||
| { | ||
| var slider = new Slider | ||
| { | ||
| Position = new Vector2(0, 200), | ||
| Path = new SliderPath(segmentedSliderPath) | ||
| { | ||
| ExpectedDistance = { Value = 1314 } | ||
| } | ||
| }; | ||
|
|
||
| EditorBeatmap.Add(slider); | ||
|
|
||
| oldStartPos = slider.Position; | ||
| oldEndPos = slider.EndPosition; | ||
| oldDistance = slider.Path.Distance; | ||
| }); | ||
|
|
||
| AddStep("Select slider", () => | ||
| { | ||
| var slider = (Slider)EditorBeatmap.HitObjects[0]; | ||
| EditorBeatmap.SelectedHitObjects.Add(slider); | ||
| }); | ||
|
|
||
| AddRepeatStep("Reverse slider", () => | ||
| { | ||
| InputManager.PressKey(Key.LControl); | ||
| InputManager.Key(Key.G); | ||
| InputManager.ReleaseKey(Key.LControl); | ||
| }, 3); | ||
|
|
||
| AddAssert("First arc's control is not at the slider's middle", () => | ||
| Vector2.Distance(selectedSlider.Path.ControlPoints[^2].Position, selectedSlider.Path.PositionAt(0.5)) > 1 | ||
| ); | ||
|
|
||
| AddAssert("Last arc's control is not at the slider's middle", () => | ||
| Vector2.Distance(selectedSlider.Path.ControlPoints[1].Position, selectedSlider.Path.PositionAt(0.5)) > 1 | ||
| ); | ||
|
|
||
| AddAssert("First arc centered middle control point", () => | ||
| { | ||
| var pathControlPoints = selectedSlider.Path.ControlPoints; | ||
| float middleToStart = Vector2.Distance(pathControlPoints[1].Position, pathControlPoints[0].Position); | ||
| float middleToEnd = Vector2.Distance(pathControlPoints[1].Position, pathControlPoints[2].Position); | ||
|
|
||
| return Precision.AlmostEquals(middleToStart, middleToEnd, 1f); | ||
| }); | ||
|
|
||
| AddAssert("Last arc centered middle control point", () => | ||
| { | ||
| var pathControlPoints = selectedSlider.Path.ControlPoints; | ||
| float middleToStart = Vector2.Distance(pathControlPoints[^2].Position, pathControlPoints[^3].Position); | ||
| float middleToEnd = Vector2.Distance(pathControlPoints[^2].Position, pathControlPoints[^1].Position); | ||
|
|
||
| return Precision.AlmostEquals(middleToStart, middleToEnd, 1f); | ||
| }); | ||
|
|
||
| AddAssert("Slider has correct length", () => | ||
| Precision.AlmostEquals(selectedSlider.Path.Distance, oldDistance)); | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coordinate system mismatch in assertion.
ControlPoints[^2].Positionis a path-relative position (small values relative to path start), whileoldStartPosandoldEndPosare absolute playfield coordinates (~256, ~192). This comparison will always pass trivially due to the large coordinate difference, not because the middle control point is actually positioned correctly.Proposed fix: Compare against path-relative positions
AddAssert("Middle control point is not at start or end", () => - Vector2.Distance(selectedSlider.Path.ControlPoints[^2].Position, oldStartPos) > 1 && - Vector2.Distance(selectedSlider.Path.ControlPoints[^2].Position, oldEndPos) > 1 + Vector2.Distance(selectedSlider.Path.ControlPoints[^2].Position, selectedSlider.Path.ControlPoints[0].Position) > 1 && + Vector2.Distance(selectedSlider.Path.ControlPoints[^2].Position, selectedSlider.Path.ControlPoints[^1].Position) > 1 );🤖 Prompt for AI Agents