/* Copyright 2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty All rights reserved. */ using Il2CppInspector.Reflection; using NoisyCowStudios.Bin2Object; // This is the ONLY line to update when the API version changes using Il2CppInspector.PluginAPI.V100; namespace Il2CppInspector { // Internal helpers to call the same hook on every plugin // Does not include hooks that should be called individually, eg. OptionsChanged internal static class PluginHooks { public static PluginPreProcessMetadataEventInfo PreProcessMetadata(BinaryObjectStream stream) => PluginManager.Try((p, e) => { stream.Position = 0; p.PreProcessMetadata(stream, e); }); public static PluginPostProcessMetadataEventInfo PostProcessMetadata(Metadata metadata) => PluginManager.Try((p, e) => p.PostProcessMetadata(metadata, e)); public static PluginGetStringsEventInfo GetStrings(Metadata metadata) => PluginManager.Try((p, e) => p.GetStrings(metadata, e)); public static PluginGetStringLiteralsEventInfo GetStringLiterals(Metadata metadata) => PluginManager.Try((p, e) => p.GetStringLiterals(metadata, e)); public static PluginPostProcessPackageEventInfo PostProcessPackage(Il2CppInspector package) => PluginManager.Try((p, e) => p.PostProcessPackage(package, e)); public static PluginPostProcessTypeModelEventInfo PostProcessTypeModel(TypeModel typeModel) => PluginManager.Try((p, e) => p.PostProcessTypeModel(typeModel, e)); } }