1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-21 18:42:56 +08:00
osu-lazer/osu.Game/Overlays/Volume/VolumeControlReceptor.cs

22 lines
905 B
C#
Raw Normal View History

2018-04-13 17:19:50 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input;
using osu.Framework.Input.Bindings;
using osu.Game.Input.Bindings;
namespace osu.Game.Overlays.Volume
{
2018-07-05 15:50:04 +08:00
public class VolumeControlReceptor : Container, IScrollBindingHandler<GlobalAction>, IHandleGlobalInput
2018-04-13 17:19:50 +08:00
{
public Func<GlobalAction, bool> ActionRequested;
2018-07-05 15:50:04 +08:00
public Func<GlobalAction, float, bool, bool> ScrollActionRequested;
2018-04-13 17:19:50 +08:00
public bool OnPressed(GlobalAction action) => ActionRequested?.Invoke(action) ?? false;
2018-07-05 15:50:04 +08:00
public bool OnScroll(GlobalAction action, float amount, bool isPrecise) => ScrollActionRequested?.Invoke(action, amount, isPrecise) ?? false;
2018-04-13 17:19:50 +08:00
public bool OnReleased(GlobalAction action) => false;
}
}