-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Debug.cs
117 lines (97 loc) · 3.24 KB
/
Debug.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#if DEBUG
using System;
#endif
namespace ShockwaveGORN
{
internal static class Debug
{
#if DEBUG
private static bool Config_Register = false;
internal static bool Config_Load = false;
internal static bool Config_PrintMsg = false;
private static bool FieldRef_Get = true;
private static bool FieldRef_Found = true;
private static bool Method_Get = true;
private static bool Method_Found = true;
private static bool Patch_Init = true;
private static bool Damage_Fist = false;
private static bool Damage_Weapon = false;
internal static void LogConfigRegister(string identifier, string filepath)
{
if (!Config_Register)
return;
ShockwaveGORN.Logger?.Msg($"Registered ReflectiveCategory [{identifier}] to [{filepath}]");
}
#endif
internal static void LogFieldRefGet(string identifier)
{
#if DEBUG
if (!FieldRef_Get)
return;
#endif
ShockwaveGORN.Logger?.Msg($"Getting FieldRef {identifier}...");
}
internal static void LogFieldRefFound(string identifier, object obj)
{
#if DEBUG
if (!FieldRef_Found)
return;
#endif
if (obj == null)
{
ShockwaveGORN.Logger?.Error($"Failed to Find FieldRef {identifier}!");
return;
}
ShockwaveGORN.Logger?.Msg($"Found FieldRef {identifier}!");
}
internal static void LogMethodGet(string identifier)
{
#if DEBUG
if (!Method_Get)
return;
#endif
ShockwaveGORN.Logger?.Msg($"Getting Method {identifier}...");
}
internal static void LogMethodFound(string identifier, object obj)
{
#if DEBUG
if (!Method_Found)
return;
#endif
if (obj == null)
{
ShockwaveGORN.Logger?.Error($"Failed to Find Method {identifier}!");
return;
}
ShockwaveGORN.Logger?.Msg($"Found Method {identifier}!");
}
internal static void LogPatchInit(string identifier)
{
#if DEBUG
if (!Patch_Init)
return;
#endif
ShockwaveGORN.Logger?.Msg($"Patching Method {identifier}...");
}
#if DEBUG
internal static void LogDamageFist(CaestusType caestusType, DamageType damageType, bool is_left)
{
if (!Damage_Fist)
return;
ShockwaveGORN.Logger?.Msg($"OnFistDamage\n" +
$"is_left = {is_left}\n" +
$"caestusType = {Enum.GetName(typeof(CaestusType), caestusType)}\n" +
$"damageType = {Enum.GetName(typeof(DamageType), damageType)}");
}
internal static void LogDamageWeapon(WeaponType weaponType, DamageType damageType, bool is_left)
{
if (!Damage_Weapon)
return;
ShockwaveGORN.Logger?.Msg($"OnWeaponDamage\n" +
$"is_left = {is_left}\n" +
$"weaponType = {Enum.GetName(typeof(WeaponType), weaponType)}\n" +
$"damageType = {Enum.GetName(typeof(DamageType), damageType)}");
}
#endif
}
}