mirror of
https://github.com/ppy/osu
synced 2025-01-24 14:53:18 +00:00
Move playing text added samples to private helper and fix it never playing the last sample
`RNG.Next` is exclusive of the upper bound, meaning that the last sample would never be played.
This commit is contained in:
parent
f2318d7e26
commit
af1e97b7c7
@ -86,6 +86,8 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
protected override Color4 SelectionColour => selectionColour;
|
protected override Color4 SelectionColour => selectionColour;
|
||||||
|
|
||||||
|
private void playTextAddedSample() => textAddedSamples[RNG.Next(0, textAddedSamples.Length)]?.Play();
|
||||||
|
|
||||||
protected override void OnUserTextAdded(string added)
|
protected override void OnUserTextAdded(string added)
|
||||||
{
|
{
|
||||||
base.OnUserTextAdded(added);
|
base.OnUserTextAdded(added);
|
||||||
@ -93,7 +95,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
if (added.Any(char.IsUpper) && AllowUniqueCharacterSamples)
|
if (added.Any(char.IsUpper) && AllowUniqueCharacterSamples)
|
||||||
capsTextAddedSample?.Play();
|
capsTextAddedSample?.Play();
|
||||||
else
|
else
|
||||||
textAddedSamples[RNG.Next(0, 3)]?.Play();
|
playTextAddedSample();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnUserTextRemoved(string removed)
|
protected override void OnUserTextRemoved(string removed)
|
||||||
|
Loading…
Reference in New Issue
Block a user