Changeset 93 for binary-improvements/NamePatcher
- Timestamp:
- Jul 20, 2014, 8:50:13 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/NamePatcher/NamePatcher.cs
r86 r93 58 58 static void applyManualPatches (ModuleDefinition mainModule) 59 59 { 60 NameNormalizer.setName (mainModule.GetType ("ItemBlock").BaseType.Resolve (), "ItemBase"); 61 62 foreach (FieldDefinition fd in mainModule.GetType("PlayerDataFile").Fields) { 63 TypeReference fdType = fd.FieldType; 64 if (fd.Name.Equals ("inventory") && fdType.IsArray) { 65 foreach (FieldDefinition fd2 in fdType.Resolve().Fields) { 66 TypeReference fd2Type = fd2.FieldType; 67 if (fd2Type.FullName.Equals ("System.Int32")) { 68 Console.WriteLine ("Renaming inventory field field -> count"); 69 NameNormalizer.setName (fd2, "count"); 70 } 71 if (fd2Type.FullName.Equals ("ItemValue")) { 72 Console.WriteLine ("Renaming inventory field field -> itemValue"); 73 NameNormalizer.setName (fd2, "itemValue"); 74 } 75 } 76 Console.WriteLine ("Renaming inventory field class -> InventoryField"); 77 NameNormalizer.setName (fdType.Resolve (), "InventoryField"); 78 } 79 } 80 60 81 foreach (FieldDefinition fd in mainModule.GetType ("AdminTools").Fields) { 61 82 TypeReference fdType = fd.FieldType;
Note:
See TracChangeset
for help on using the changeset viewer.