-
-
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 playing a per-ruleset sound when switching rulesets #12528
Conversation
@@ -54,6 +59,9 @@ private void load() | |||
} | |||
} | |||
}); | |||
|
|||
foreach (var ruleset in Rulesets.AvailableRulesets) | |||
selectionSamples[ruleset.ShortName] = audio.Samples.Get($"UI/ruleset-select-{ruleset.ShortName}"); |
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.
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.
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.
Oh, I didn't realise that custom ruleset resources were independent... bad assumption on my behalf about how resources worked then, oops.
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.
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.
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.
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.
I looked at doing this at a
Ruleset
level alaCreateIcon()
, but instantiating aSample
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).