add: Item Manager

This commit is contained in:
h z
2025-02-28 08:49:32 +00:00
parent 91f749ccb7
commit ee4b8074f1

View File

@@ -33,7 +33,6 @@ public class Program
AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(dllPath, new ReaderParameters { }); AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(dllPath, new ReaderParameters { });
TypeDefinition targetType = assembly.MainModule.Types.First(t => t.Name == "ProjectUtils"); TypeDefinition targetType = assembly.MainModule.Types.First(t => t.Name == "ProjectUtils");
MethodDefinition method = targetType.Methods.First(m => m.Name == "EnsureGodotSdkIsUpToDate"); MethodDefinition method = targetType.Methods.First(m => m.Name == "EnsureGodotSdkIsUpToDate");
TypeReference? stringType = assembly.MainModule.ImportReference(typeof(string)); TypeReference? stringType = assembly.MainModule.ImportReference(typeof(string));
@@ -69,7 +68,6 @@ public class Program
method.Body.Variables.Clear(); method.Body.Variables.Clear();
ILProcessor il = method.Body.GetILProcessor(); ILProcessor il = method.Body.GetILProcessor();
//VariableDefinition root = new VariableDefinition(projectRootElementTypeDef); //VariableDefinition root = new VariableDefinition(projectRootElementTypeDef);
method.Body.Variables.Add(root); method.Body.Variables.Add(root);
@@ -139,9 +137,7 @@ public class Program
il.Append(il.Create(OpCodes.Ret)); il.Append(il.Create(OpCodes.Ret));
assembly.Write($"{dllPath}.2.dll"); assembly.Write($"{dllPath}.2.dll");
File.Replace($"{dllPath}.2.dll", dllPath, null); File.Replace($"{dllPath}.2.dll", dllPath, null);
} }
} }