From a78fab0e7d74d41b58ecefbe74854370ffee08c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 3 Nov 2023 00:17:29 +0100 Subject: [PATCH] Do not hardcode ruleset name in touch device detection toast --- osu.Game/Overlays/OSD/TouchDeviceDetectedToast.cs | 6 ++++-- osu.Game/Screens/Play/PlayerTouchInputHandler.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/OSD/TouchDeviceDetectedToast.cs b/osu.Game/Overlays/OSD/TouchDeviceDetectedToast.cs index 0b5e3fffbe..266e10ab1f 100644 --- a/osu.Game/Overlays/OSD/TouchDeviceDetectedToast.cs +++ b/osu.Game/Overlays/OSD/TouchDeviceDetectedToast.cs @@ -1,12 +1,14 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using osu.Game.Rulesets; + namespace osu.Game.Overlays.OSD { public partial class TouchDeviceDetectedToast : Toast { - public TouchDeviceDetectedToast() - : base("osu!", "Touch device detected", "Touch Device mod applied to score") + public TouchDeviceDetectedToast(RulesetInfo ruleset) + : base(ruleset.Name, "Touch device detected", "Touch Device mod applied to score") { } } diff --git a/osu.Game/Screens/Play/PlayerTouchInputHandler.cs b/osu.Game/Screens/Play/PlayerTouchInputHandler.cs index 728b3c846b..a7d41de105 100644 --- a/osu.Game/Screens/Play/PlayerTouchInputHandler.cs +++ b/osu.Game/Screens/Play/PlayerTouchInputHandler.cs @@ -55,7 +55,7 @@ namespace osu.Game.Screens.Play // 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()); + onScreenDisplay?.Display(new TouchDeviceDetectedToast(gameplayState.Ruleset.RulesetInfo)); // `Player` (probably rightly so) assumes immutability of mods, // so this will not be shown immediately on the mod display in the top right.