-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add support for ruleset-specific blueprints in editor timeline #29973
Draft
OliBomby
wants to merge
3
commits into
ppy:master
Choose a base branch
from
OliBomby:ruleset-timeline
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions
22
osu.Game.Rulesets.Mania/Edit/ManiaTimelineBlueprintContainer.cs
This file contains 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// 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.Rulesets.Edit; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Screens.Edit.Compose.Components.Timeline; | ||
|
||
namespace osu.Game.Rulesets.Mania.Edit | ||
{ | ||
public partial class ManiaTimelineBlueprintContainer : TimelineBlueprintContainer | ||
{ | ||
public ManiaTimelineBlueprintContainer(HitObjectComposer composer) | ||
: base(composer) | ||
{ | ||
} | ||
|
||
public override TimelineHitObjectBlueprint? CreateTimelineBlueprintFor(HitObject hitObject) | ||
{ | ||
return null; | ||
} | ||
} | ||
} |
This file contains 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
17 changes: 17 additions & 0 deletions
17
osu.Game.Rulesets.Osu/Edit/Blueprints/Spinners/SpinnerTimelineBlueprint.cs
This file contains 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// 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.Rulesets.Objects; | ||
using osu.Game.Screens.Edit.Compose.Components.Timeline; | ||
|
||
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners | ||
{ | ||
public partial class SpinnerTimelineBlueprint : TimelineHitObjectBlueprint | ||
{ | ||
public SpinnerTimelineBlueprint(HitObject item) | ||
: base(item) | ||
{ | ||
SamplePointPiece.X = 1; | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
osu.Game.Rulesets.Osu/Edit/OsuTimelineBlueprintContainer.cs
This file contains 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// 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.Rulesets.Edit; | ||
using osu.Game.Rulesets.Objects; | ||
using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners; | ||
using osu.Game.Rulesets.Osu.Objects; | ||
using osu.Game.Screens.Edit.Compose.Components.Timeline; | ||
|
||
namespace osu.Game.Rulesets.Osu.Edit | ||
{ | ||
public partial class OsuTimelineBlueprintContainer : TimelineBlueprintContainer | ||
{ | ||
public OsuTimelineBlueprintContainer(HitObjectComposer composer) | ||
: base(composer) | ||
{ | ||
} | ||
|
||
public override TimelineHitObjectBlueprint? CreateTimelineBlueprintFor(HitObject hitObject) | ||
{ | ||
switch (hitObject) | ||
{ | ||
case Spinner spinner: | ||
return new SpinnerTimelineBlueprint(spinner); | ||
} | ||
|
||
return base.CreateTimelineBlueprintFor(hitObject); | ||
} | ||
} | ||
} |
This file contains 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 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 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 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 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
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.
If we're going to go and say that it's fine for the timeline to look differently on different rulesets, then I can already tell you that this API is too constrained and we'll need a higher-level primitive anyway to replace the entirety of the timeline.
Why, you ask? One of the most frequent pieces of feedback on scrolling rulesets (taiko and mania) are that scroll speed changes should be visible on the timeline. And osu!'s displays above hitobjects do not make sense there because that's not how speed changes work on those rulesets - they affect the entire playfield. So they should probably look closer to the red timing change markers.
So I think this sort of thing is too short-sighted and we'll have to tear it out sooner than later anyway. Not opposed to the idea, yet wholly opposed to this execution.
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.
This is valuable feedback.
Then we'll need to expand the API to allow showing additional things on the timeline apart from hit objects. I'm thinking such taiko/mania scroll speed changes would probably have to sit next to the
TimelineTimingChangeDisplay
in the drawable tree.My question is to what degree do we want rulesets to replace the timeline? You said "replace the entirety of the timeline", but maybe thats overdoing it? I think all rulesets will still share a lot of elements of the timeline like the zoom behaviour, centre marker, timing change display, waveform, ticks, etc. Whatever implementation we go with, it should be easy to add these elements to your ruleset's timeline, so we don't end up with lots of code duplication.
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.
I mean obviously, yes - that said, composition over inheritance please. I don't want to see any
BaseTimeline
shaped monstrosities. Just have the required components readily available for reuse.