Handle other button clicks in HoverClickSounds

As suggested in review, remove previously introduced HoverMouseUpSounds
and instead change effect playing logic in HoverClickSounds by moving it
out of OnClick() to OnMouseUp().

Users of the class can either use the existing constructor to play
the effect only on left click or use the newly introduced constructor
with the MouseButton[] parameter to specify which button clicks should
trigger the sound.
This commit is contained in:
Bartłomiej Dach
2019-08-31 20:16:16 +02:00
parent a1c72db5f6
commit 658e0edc3e
3 changed files with 29 additions and 48 deletions

View File

@ -11,7 +11,6 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Input.Events;
@ -284,7 +283,7 @@ namespace osu.Game.Overlays.Mods
Anchor = Anchor.TopCentre,
Font = OsuFont.GetFont(size: 18)
},
new HoverMouseUpSounds(new List<MouseButton> { MouseButton.Left, MouseButton.Right })
new HoverClickSounds(new[] { MouseButton.Left, MouseButton.Right })
};
Mod = mod;