Fix scroll wheel being handled by base test scene

This commit is contained in:
Dean Herbert 2020-09-30 16:39:02 +09:00
parent 1dd354120b
commit e760ed8e01
2 changed files with 7 additions and 0 deletions

View File

@ -17,6 +17,8 @@ namespace osu.Game.Tests.Visual.Editing
[Cached(typeof(IBeatSnapProvider))] [Cached(typeof(IBeatSnapProvider))]
private readonly EditorBeatmap editorBeatmap; private readonly EditorBeatmap editorBeatmap;
protected override bool ScrollUsingMouseWheel => false;
public TestSceneTimingScreen() public TestSceneTimingScreen()
{ {
editorBeatmap = new EditorBeatmap(CreateBeatmap(new OsuRuleset().RulesetInfo)); editorBeatmap = new EditorBeatmap(CreateBeatmap(new OsuRuleset().RulesetInfo));

View File

@ -20,6 +20,8 @@ namespace osu.Game.Tests.Visual
protected readonly BindableBeatDivisor BeatDivisor = new BindableBeatDivisor(); protected readonly BindableBeatDivisor BeatDivisor = new BindableBeatDivisor();
protected new readonly EditorClock Clock; protected new readonly EditorClock Clock;
protected virtual bool ScrollUsingMouseWheel => true;
protected EditorClockTestScene() protected EditorClockTestScene()
{ {
Clock = new EditorClock(new ControlPointInfo(), 5000, BeatDivisor) { IsCoupled = false }; Clock = new EditorClock(new ControlPointInfo(), 5000, BeatDivisor) { IsCoupled = false };
@ -57,6 +59,9 @@ namespace osu.Game.Tests.Visual
protected override bool OnScroll(ScrollEvent e) protected override bool OnScroll(ScrollEvent e)
{ {
if (!ScrollUsingMouseWheel)
return false;
if (e.ScrollDelta.Y > 0) if (e.ScrollDelta.Y > 0)
Clock.SeekBackward(true); Clock.SeekBackward(true);
else else