mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-09 12:54:51 +00:00
42cb791c5d
Co-authored-by: Mister_Nebula <41904486+misternebula@users.noreply.github.com>
46 lines
1.2 KiB
C#
46 lines
1.2 KiB
C#
using System.Linq;
|
|
using OWML.Common;
|
|
using UnityEngine;
|
|
|
|
namespace QSB.Utility
|
|
{
|
|
public class DebugLog : MonoBehaviour
|
|
{
|
|
private static string JoinAll(params object[] logObjects)
|
|
{
|
|
return string.Join(" ", logObjects.Select(o => o.ToString()).ToArray());
|
|
}
|
|
|
|
public static void ToConsole(string message)
|
|
{
|
|
QSB.Helper.Console.WriteLine(message, MessageType.Message);
|
|
}
|
|
|
|
public static void ToConsole(string message, MessageType type)
|
|
{
|
|
QSB.Helper.Console.WriteLine(message, type);
|
|
}
|
|
|
|
public static void ToHud(params object[] logObjects)
|
|
{
|
|
if (Locator.GetPlayerBody() == null)
|
|
{
|
|
return;
|
|
}
|
|
var data = new NotificationData(NotificationTarget.Player, JoinAll(logObjects));
|
|
NotificationManager.SharedInstance.PostNotification(data);
|
|
}
|
|
|
|
public static void ToAll(MessageType type, params object[] logObjects)
|
|
{
|
|
ToConsole(JoinAll(logObjects), type);
|
|
ToHud(logObjects);
|
|
}
|
|
|
|
public static void ToAll(params object[] logObjects)
|
|
{
|
|
ToAll(MessageType.Message, logObjects);
|
|
}
|
|
}
|
|
}
|