Pass input state in OnSelected.

This commit is contained in:
Huo Yaoyuan
2017-08-04 00:09:41 +08:00
parent df3f75b842
commit 44fd0eb78b
4 changed files with 14 additions and 23 deletions

View File

@ -106,7 +106,7 @@ namespace osu.Game.Screens.Select
Origin = Anchor.CentreRight,
SelectionChanged = carouselSelectionChanged,
BeatmapsChanged = carouselBeatmapsLoaded,
StartRequested = carouselRaisedStart,
StartRequested = () => carouselRaisedStart(),
});
Add(FilterControl = new FilterControl
{
@ -143,7 +143,7 @@ namespace osu.Game.Screens.Select
Add(Footer = new Footer
{
OnBack = Exit,
OnStart = carouselRaisedStart,
OnStart = () => carouselRaisedStart(),
});
FooterPanels.Add(BeatmapOptions = new BeatmapOptionsOverlay());
@ -193,7 +193,7 @@ namespace osu.Game.Screens.Select
carousel.SelectNext();
}
private void carouselRaisedStart()
private void carouselRaisedStart(InputState state = null)
{
// if we have a pending filter operation, we want to run it now.
// it could change selection (ie. if the ruleset has been changed).
@ -206,7 +206,7 @@ namespace osu.Game.Screens.Select
selectionChangedDebounce = null;
}
OnSelected();
OnSelected(state);
}
private ScheduledDelegate selectionChangedDebounce;
@ -270,7 +270,7 @@ namespace osu.Game.Screens.Select
carousel.SelectNextRandom();
}
protected abstract void OnSelected();
protected abstract void OnSelected(InputState state);
private void filterChanged(FilterCriteria criteria, bool debounce = true)
{
@ -393,7 +393,7 @@ namespace osu.Game.Screens.Select
{
case Key.KeypadEnter:
case Key.Enter:
carouselRaisedStart();
carouselRaisedStart(state);
return true;
case Key.Delete:
if (state.Keyboard.ShiftPressed)