57 lines
1.9 KiB
C#
Raw Normal View History

2022-07-20 17:50:01 +08:00
using GTA;
2022-05-22 15:55:26 +08:00
using LemonUI.Menus;
using System.Drawing;
2022-05-22 15:55:26 +08:00
namespace RageCoop.Client
{
internal static class DebugMenu
{
2022-07-20 17:50:01 +08:00
public static NativeMenu Menu = new NativeMenu("RAGECOOP", "Debug", "Debug settings")
{
UseMouse = false,
Alignment = Main.Settings.FlipMenu ? GTA.UI.Alignment.Right : GTA.UI.Alignment.Left
};
public static NativeMenu DiagnosticMenu = new NativeMenu("RAGECOOP", "Diagnostic", "Performence and Diagnostic")
{
2022-05-22 15:55:26 +08:00
UseMouse = false,
Alignment = Main.Settings.FlipMenu ? GTA.UI.Alignment.Right : GTA.UI.Alignment.Left
};
2022-07-20 17:50:01 +08:00
private static NativeItem d1 = new NativeItem("PositionPrediction");
2022-05-22 15:55:26 +08:00
static DebugMenu()
{
Menu.Banner.Color = Color.FromArgb(225, 0, 0, 0);
Menu.Title.Color = Color.FromArgb(255, 165, 0);
2022-07-20 17:50:01 +08:00
d1.Activated+=(sender, e) =>
2022-05-22 15:55:26 +08:00
{
2022-07-20 17:50:01 +08:00
try { SyncParameters.PositioinPredictionDefault =float.Parse(Game.GetUserInput(WindowTitle.EnterMessage20, SyncParameters.PositioinPredictionDefault.ToString(), 20)); }
2022-05-22 15:55:26 +08:00
catch { }
Update();
};
2022-07-20 17:50:01 +08:00
2022-05-22 15:55:26 +08:00
Menu.Add(d1);
Menu.AddSubMenu(DiagnosticMenu);
2022-07-20 17:50:01 +08:00
Menu.Opening+=(sender, e) => Update();
DiagnosticMenu.Opening+=(sender, e) =>
{
DiagnosticMenu.Clear();
2022-05-23 19:19:56 +08:00
DiagnosticMenu.Add(new NativeItem("EntityPool", EntityPool.DumpDebug()));
foreach (var pair in Debug.TimeStamps)
{
DiagnosticMenu.Add(new NativeItem(pair.Key.ToString(), pair.Value.ToString(), pair.Value.ToString()));
}
};
2022-05-22 15:55:26 +08:00
Update();
}
2022-05-26 17:11:37 +08:00
2022-07-20 17:50:01 +08:00
2022-05-26 17:11:37 +08:00
2022-05-22 15:55:26 +08:00
private static void Update()
{
d1.AltTitle = SyncParameters.PositioinPredictionDefault.ToString();
2022-05-22 15:55:26 +08:00
}
}
}