1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 20:32:55 +08:00

Do not hardcode ruleset name in touch device detection toast

This commit is contained in:
Bartłomiej Dach 2023-11-03 00:17:29 +01:00
parent a613292802
commit a78fab0e7d
No known key found for this signature in database
2 changed files with 5 additions and 3 deletions

View File

@ -1,12 +1,14 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Game.Rulesets;
namespace osu.Game.Overlays.OSD namespace osu.Game.Overlays.OSD
{ {
public partial class TouchDeviceDetectedToast : Toast public partial class TouchDeviceDetectedToast : Toast
{ {
public TouchDeviceDetectedToast() public TouchDeviceDetectedToast(RulesetInfo ruleset)
: base("osu!", "Touch device detected", "Touch Device mod applied to score") : base(ruleset.Name, "Touch device detected", "Touch Device mod applied to score")
{ {
} }
} }

View File

@ -55,7 +55,7 @@ namespace osu.Game.Screens.Play
// we're kind of assuming that the user just switches to touch for gameplay // 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. // and we don't want to spam them with obvious toasts.
if (gameplayState.ScoreProcessor.HitEvents.Any(ev => ev.Result.IsHit())) if (gameplayState.ScoreProcessor.HitEvents.Any(ev => ev.Result.IsHit()))
onScreenDisplay?.Display(new TouchDeviceDetectedToast()); onScreenDisplay?.Display(new TouchDeviceDetectedToast(gameplayState.Ruleset.RulesetInfo));
// `Player` (probably rightly so) assumes immutability of mods, // `Player` (probably rightly so) assumes immutability of mods,
// so this will not be shown immediately on the mod display in the top right. // so this will not be shown immediately on the mod display in the top right.