mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Move private method down
This commit is contained in:
@ -170,41 +170,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
selectionStarted = false;
|
selectionStarted = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void playSelectSample(SelectionSampleType selectionType)
|
|
||||||
{
|
|
||||||
if (Time.Current < sampleLastPlaybackTime + 15) return;
|
|
||||||
|
|
||||||
SampleChannel? channel;
|
|
||||||
double pitch = 0.98 + RNG.NextDouble(0.04);
|
|
||||||
|
|
||||||
switch (selectionType)
|
|
||||||
{
|
|
||||||
case SelectionSampleType.All:
|
|
||||||
channel = selectAllSample?.GetChannel();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SelectionSampleType.Word:
|
|
||||||
channel = selectWordSample?.GetChannel();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SelectionSampleType.Deselect:
|
|
||||||
channel = deselectSample?.GetChannel();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
channel = selectCharSample?.GetChannel();
|
|
||||||
pitch += (SelectedText.Length / (double)Text.Length) * 0.15f;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (channel == null) return;
|
|
||||||
|
|
||||||
channel.Frequency.Value = pitch;
|
|
||||||
channel.Play();
|
|
||||||
|
|
||||||
sampleLastPlaybackTime = Time.Current;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnImeComposition(string newComposition, int removedTextLength, int addedTextLength, bool caretMoved)
|
protected override void OnImeComposition(string newComposition, int removedTextLength, int addedTextLength, bool caretMoved)
|
||||||
{
|
{
|
||||||
base.OnImeComposition(newComposition, removedTextLength, addedTextLength, caretMoved);
|
base.OnImeComposition(newComposition, removedTextLength, addedTextLength, caretMoved);
|
||||||
@ -294,6 +259,41 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
SelectionColour = SelectionColour,
|
SelectionColour = SelectionColour,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private void playSelectSample(SelectionSampleType selectionType)
|
||||||
|
{
|
||||||
|
if (Time.Current < sampleLastPlaybackTime + 15) return;
|
||||||
|
|
||||||
|
SampleChannel? channel;
|
||||||
|
double pitch = 0.98 + RNG.NextDouble(0.04);
|
||||||
|
|
||||||
|
switch (selectionType)
|
||||||
|
{
|
||||||
|
case SelectionSampleType.All:
|
||||||
|
channel = selectAllSample?.GetChannel();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SelectionSampleType.Word:
|
||||||
|
channel = selectWordSample?.GetChannel();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SelectionSampleType.Deselect:
|
||||||
|
channel = deselectSample?.GetChannel();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
channel = selectCharSample?.GetChannel();
|
||||||
|
pitch += (SelectedText.Length / (double)Text.Length) * 0.15f;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (channel == null) return;
|
||||||
|
|
||||||
|
channel.Frequency.Value = pitch;
|
||||||
|
channel.Play();
|
||||||
|
|
||||||
|
sampleLastPlaybackTime = Time.Current;
|
||||||
|
}
|
||||||
|
|
||||||
private void playTextAddedSample() => textAddedSamples[RNG.Next(0, textAddedSamples.Length)]?.Play();
|
private void playTextAddedSample() => textAddedSamples[RNG.Next(0, textAddedSamples.Length)]?.Play();
|
||||||
|
|
||||||
private class OsuCaret : Caret
|
private class OsuCaret : Caret
|
||||||
|
Reference in New Issue
Block a user