Display Important/Error logging in notifications for now.

This commit is contained in:
Dean Herbert 2017-02-15 12:37:57 +09:00
parent 580584a015
commit 753232533a
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
1 changed files with 11 additions and 0 deletions

View File

@ -25,6 +25,7 @@
using System.Linq;
using osu.Framework.Graphics.Primitives;
using System.Collections.Generic;
using osu.Game.Overlays.Notifications;
namespace osu.Game
{
@ -130,6 +131,16 @@ protected override void LoadComplete()
Origin = Anchor.TopRight,
}).Preload(this, overlayContent.Add);
Logger.NewEntry += entry =>
{
if (entry.Level < LogLevel.Important) return;
notificationManager.Post(new SimpleNotification
{
Text = $@"{entry.Level}: {entry.Message}"
});
};
Dependencies.Cache(options);
Dependencies.Cache(musicController);
Dependencies.Cache(notificationManager);