2020-05-17 18:13:45 +00:00
|
|
|
using System;
|
|
|
|
using GamecraftModdingAPI.Blocks;
|
|
|
|
|
|
|
|
namespace GamecraftModdingAPI.Utility
|
|
|
|
{
|
2020-05-17 21:23:06 +00:00
|
|
|
public static class GameClient
|
2020-05-17 18:13:45 +00:00
|
|
|
{
|
|
|
|
private static DebugInterfaceEngine _engine = new DebugInterfaceEngine();
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Saves the extra information to be displayed on the debug view.
|
|
|
|
/// The provided getter function is called each time the view updates so make sure it returns quickly.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">A global ID for the custom information</param>
|
|
|
|
/// <param name="contentGetter">A function that returns the current information</param>
|
2020-05-17 21:23:06 +00:00
|
|
|
public static void SetDebugInfo(string id, Func<string> contentGetter) => _engine.SetInfo(id, contentGetter);
|
2020-05-17 18:13:45 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Removes an information provided by a plugin.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="id">The ID of the custom information</param>
|
|
|
|
/// <returns></returns>
|
2020-05-17 21:23:06 +00:00
|
|
|
public static bool RemoveDebugInfo(string id) => _engine.RemoveInfo(id);
|
2020-05-17 18:13:45 +00:00
|
|
|
|
|
|
|
public static void Init()
|
|
|
|
{
|
|
|
|
GameEngineManager.AddGameEngine(_engine);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|