示例#1
0
        static VehicleHarmony()
        {
            //harmony.PatchAll(Assembly.GetExecutingAssembly());
            //Harmony.DEBUG = true;
            Log.Message($"{LogLabel} version {Assembly.GetExecutingAssembly().GetName().Version}");

            IEnumerable <Type> patchCategories = GenTypes.AllTypes.Where(t => t.GetInterfaces().Contains(typeof(IPatchCategory)));

            foreach (Type patchCategory in patchCategories)
            {
                IPatchCategory patch = (IPatchCategory)Activator.CreateInstance(patchCategory, null);
                try
                {
                    patch.PatchMethods();
                }
                catch (Exception ex)
                {
                    SmashLog.Error($"Failed to Patch <type>{patch.GetType().FullName}</type>. Method=\"{methodPatching}\"");
                    throw ex;
                }
            }
            SmashLog.Message($"{LogLabel} <success>{Harmony.GetPatchedMethods().Count()} patches successfully applied.</success>");

            ResolveAllReferences();
            //Will want to be added via xml
            FillVehicleLordJobTypes();

            LoadedModManager.GetMod <VehicleMod>().InitializeTabs();
            VehicleMod.settings.Write();
        }
示例#2
0
 public static void Message(string text)
 {
     if (VehicleMod.settings.debug.debugLogging)
     {
         SmashLog.Message(text);
     }
 }