mirror of
https://github.com/ppy/osu.git
synced 2025-01-30 01:32:55 +08:00
Touch up PlayerTouchInputHandler
This commit is contained in:
parent
4532d0ecdf
commit
3a6d65d395
@ -9,6 +9,7 @@ using osu.Game.Configuration;
|
|||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.OSD;
|
using osu.Game.Overlays.OSD;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play
|
namespace osu.Game.Screens.Play
|
||||||
{
|
{
|
||||||
@ -50,11 +51,15 @@ namespace osu.Game.Screens.Play
|
|||||||
if (touchDeviceMod == null)
|
if (touchDeviceMod == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
onScreenDisplay?.Display(new TouchDeviceDetectedToast());
|
// do not show the toast if the user hasn't hit anything yet.
|
||||||
|
// we're kind of assuming that the user just switches to touch for gameplay
|
||||||
|
// and we don't want to spam them with obvious toasts.
|
||||||
|
if (gameplayState.ScoreProcessor.HitEvents.Any(ev => ev.Result.IsHit()))
|
||||||
|
onScreenDisplay?.Display(new TouchDeviceDetectedToast());
|
||||||
|
|
||||||
// TODO: this is kinda crude. `Player` (probably rightly so) assumes immutability of mods.
|
// `Player` (probably rightly so) assumes immutability of mods,
|
||||||
// this probably should be shown immediately on screen in the HUD,
|
// so this will not be shown immediately on the mod display in the top right.
|
||||||
// which means that immutability will probably need to be revisited.
|
// if this is to change, the mod immutability should be revisited.
|
||||||
player.Score.ScoreInfo.Mods = player.Score.ScoreInfo.Mods.Append(touchDeviceMod).ToArray();
|
player.Score.ScoreInfo.Mods = player.Score.ScoreInfo.Mods.Append(touchDeviceMod).ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user