TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ Initialize()

static void Terraria.ModLoader.MonoModHooks.Initialize ( )
inlinestaticpackage

Definition at line 117 of file MonoModHooks.cs.

118 {
119 if (isInitialized)
120 {
121 return;
122 }
123 DetourManager.DetourApplied += delegate(DetourInfo info)
124 {
125 Assembly assembly2 = info.Entry.DeclaringType.Assembly;
126 GetDetourList(assembly2).detours.Add(info);
127 string text = "Hook " + StringRep(((DetourBase)info).Method.Method) + " added by " + assembly2.GetName().Name;
128 MethodSignature val = MethodSignature.ForMethod(((DetourBase)info).Method.Method);
129 MethodSignature val2 = MethodSignature.ForMethod(info.Entry, true);
130 if (val2.ParameterCount != val.ParameterCount + 1 || (object)val2.FirstParameter.GetMethod("Invoke") == null)
131 {
132 text += " WARNING! No orig delegate, incompatible with other hooks to this method";
133 }
134 Logging.tML.Debug((object)text);
135 };
136 DetourManager.ILHookApplied += delegate(ILHookInfo info)
137 {
138 Assembly assembly = info.ManipulatorMethod.DeclaringType.Assembly;
139 GetDetourList(assembly).ilHooks.Add(info);
140 Logging.tML.Debug((object)("ILHook " + StringRep(((DetourBase)info).Method.Method) + " added by " + assembly.GetName().Name));
141 };
142 isInitialized = true;
143 }
static DetourList GetDetourList(Assembly asm)
static string StringRep(MethodBase m)

References Terraria.ModLoader.MonoModHooks.GetDetourList(), Terraria.ModLoader.MonoModHooks.isInitialized, Terraria.ModLoader.MonoModHooks.StringRep(), and Terraria.ModLoader.Logging.tML.

Referenced by Terraria.ModLoader.ModLoader.EngineInit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: