Files
RAGECOOP-V/Client/Scripts/Debug.cs

48 lines
1.1 KiB
C#
Raw Normal View History

2022-05-22 15:55:26 +08:00
using System;
using System.Collections.Generic;
2022-10-23 19:02:39 +08:00
using GTA.UI;
2022-05-22 15:55:26 +08:00
namespace RageCoop.Client
{
internal enum TimeStamp
{
AddPeds,
PedTotal,
AddVehicles,
VehicleTotal,
SendPed,
SendPedState,
2022-05-22 15:55:26 +08:00
SendVehicle,
SendVehicleState,
UpdatePed,
2022-05-22 15:55:26 +08:00
UpdateVehicle,
CheckProjectiles,
GetAllEntities,
Receive,
2022-10-23 19:02:39 +08:00
ProjectilesTotal
2022-05-22 15:55:26 +08:00
}
2022-10-23 19:02:39 +08:00
2022-05-22 15:55:26 +08:00
internal static class Debug
{
public static Dictionary<TimeStamp, long> TimeStamps = new Dictionary<TimeStamp, long>();
private static int _lastNfHandle;
2022-10-23 19:02:39 +08:00
2022-05-22 15:55:26 +08:00
static Debug()
{
2022-10-23 19:02:39 +08:00
foreach (TimeStamp t in Enum.GetValues(typeof(TimeStamp))) TimeStamps.Add(t, 0);
2022-05-22 15:55:26 +08:00
}
2022-10-23 19:02:39 +08:00
2022-05-22 15:55:26 +08:00
public static string Dump(this Dictionary<TimeStamp, long> d)
{
2022-10-23 19:02:39 +08:00
var s = "";
foreach (var kvp in d) s += kvp.Key + ":" + kvp.Value + "\n";
2022-05-22 15:55:26 +08:00
return s;
}
2022-10-23 19:02:39 +08:00
2022-05-22 15:55:26 +08:00
public static void ShowTimeStamps()
{
2022-10-23 19:02:39 +08:00
Notification.Hide(_lastNfHandle);
_lastNfHandle = Notification.Show(TimeStamps.Dump());
2022-05-22 15:55:26 +08:00
}
}
2022-10-23 19:02:39 +08:00
}