-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Allow beatmap conversion from non-std rulesets #32535
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
Open
WebFreak001
wants to merge
1
commit into
ppy:master
Choose a base branch
from
WebFreak001:custom-song-conversion-source-ruleset-v3
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.
Open
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
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
19 changes: 19 additions & 0 deletions
19
...scrolling-example/osu.Game.Rulesets.Pippidon/Beatmaps/PippidonRulesetConversionSupport.cs
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Game.Rulesets.Filter; | ||
|
||
namespace osu.Game.Rulesets.Pippidon.Beatmaps | ||
{ | ||
public class PippidonRulesetConversionSupport : IRulesetConvertSupport | ||
{ | ||
public bool CanBePlayed(RulesetInfo ruleset, bool conversionEnabled) | ||
{ | ||
// Always show ctb maps even without converts, since extensive playtesting has shown that the maps match | ||
// pippidon very well and we also don't have many maps to start out with yet. | ||
// Show std only when converts are enabled | ||
return ruleset.ShortName == "pippidon" || ruleset.ShortName == "fruits" || | ||
(conversionEnabled && ruleset.ShortName == "osu"); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Game.Screens.Select; | ||
|
||
namespace osu.Game.Rulesets.Filter | ||
{ | ||
/// <summary> | ||
/// Allows for changing which beatmap rulesets are displayed in song select (as implemented in <see cref="FilterCriteria"/>) | ||
/// with ruleset-specific criteria. | ||
/// </summary> | ||
public interface IRulesetConvertSupport | ||
{ | ||
/// <summary> | ||
/// Checks whether maps from the supplied <paramref name="ruleset"/> may be played with this ruleset with or | ||
/// without beatmap conversion enabled. | ||
/// </summary> | ||
/// <param name="ruleset">The foreign ruleset to check if it may be played.</param> | ||
/// <param name="conversionEnabled">Indicates if the player wants converts or not.</param> | ||
/// <returns> | ||
/// <c>true</c> if the beatmap can be played and should be shown in the beatmap list, | ||
/// <c>false</c> otherwise. | ||
/// </returns> | ||
bool CanBePlayed(RulesetInfo ruleset, bool conversionEnabled); | ||
} | ||
} |
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
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.
Any reason for a separate interface instead of using
IRulesetFilterCriteria
?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 made this a separate interface since the IRulesetFilterCriteria, which currently extends the functionality of the search bar, didn't really feel it'd fit / match what this does very well. (as well as being a breaking change for rulesets / requiring changes in implementation)
This new interface also is just a single function to implement, which makes this easier to implement than IRulesetFilterCriteria.
I think keeping it separate is more logical for rulesets as well as making it easier for rulesets to implement this. I have been using this in 2 separate rulesets now and I think it's working just like you'd expect it to and the introduced API is working pretty well.