mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 15:33:05 +08:00
Merge pull request #24087 from peppy/less-tablet-error-spam
Ensure "tablet support disabled" notification is only shown once
This commit is contained in:
commit
fe2ca5cfef
@ -1164,7 +1164,9 @@ namespace osu.Game
|
|||||||
private void forwardTabletLogsToNotifications()
|
private void forwardTabletLogsToNotifications()
|
||||||
{
|
{
|
||||||
const string tablet_prefix = @"[Tablet] ";
|
const string tablet_prefix = @"[Tablet] ";
|
||||||
|
|
||||||
bool notifyOnWarning = true;
|
bool notifyOnWarning = true;
|
||||||
|
bool notifyOnError = true;
|
||||||
|
|
||||||
Logger.NewEntry += entry =>
|
Logger.NewEntry += entry =>
|
||||||
{
|
{
|
||||||
@ -1175,6 +1177,11 @@ namespace osu.Game
|
|||||||
|
|
||||||
if (entry.Level == LogLevel.Error)
|
if (entry.Level == LogLevel.Error)
|
||||||
{
|
{
|
||||||
|
if (!notifyOnError)
|
||||||
|
return;
|
||||||
|
|
||||||
|
notifyOnError = false;
|
||||||
|
|
||||||
Schedule(() =>
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
Notifications.Post(new SimpleNotification
|
Notifications.Post(new SimpleNotification
|
||||||
@ -1213,7 +1220,11 @@ namespace osu.Game
|
|||||||
Schedule(() =>
|
Schedule(() =>
|
||||||
{
|
{
|
||||||
ITabletHandler tablet = Host.AvailableInputHandlers.OfType<ITabletHandler>().SingleOrDefault();
|
ITabletHandler tablet = Host.AvailableInputHandlers.OfType<ITabletHandler>().SingleOrDefault();
|
||||||
tablet?.Tablet.BindValueChanged(_ => notifyOnWarning = true, true);
|
tablet?.Tablet.BindValueChanged(_ =>
|
||||||
|
{
|
||||||
|
notifyOnWarning = true;
|
||||||
|
notifyOnError = true;
|
||||||
|
}, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user