Skip to content
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 playing a per-ruleset sound when switching rulesets #12528

Merged
merged 5 commits into from
Apr 23, 2021

Conversation

nekodex
Copy link
Contributor

@nekodex nekodex commented Apr 22, 2021

I looked at doing this at a Ruleset level ala CreateIcon(), but instantiating a Sample there seemed... not ideal? So I went with this approach instead.

Samples for the base rulesets are added in ppy/osu-resources#122 which will be played when the ruleset is selected (via the Toolbar).

@@ -54,6 +59,9 @@ private void load()
}
}
});

foreach (var ruleset in Rulesets.AvailableRulesets)
selectionSamples[ruleset.ShortName] = audio.Samples.Get($"UI/ruleset-select-{ruleset.ShortName}");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mentioned that custom rulesets can also use this, but they won't be able to with this logic as it stands. The resource would need to be read from their storage, not the game's one.

Not sure if this is an issue just yet though. Might be something we add support for in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't realise that custom ruleset resources were independent... bad assumption on my behalf about how resources worked then, oops.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something similar to CreateIcon() is likely what we want, but I would probably recommend not doing that just yet due to concerns mentioned in #11240.

Copy link
Collaborator

@bdach bdach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems alright to get in as a first step. Can work on a ruleset API once we've figured out how to do the icons, too.

Not approving because conflicts.

@peppy peppy merged commit 8ee881b into ppy:master Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants