949bde76ce
This also adds an experimental, usually slower, threaded gas grid mode and implements a workaround for the whole mod and game failing to start when opening prepatcher's mod manager with unfortunate timing
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
// Copyright (c) 2023 bradson
|
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
using System.Diagnostics;
|
|
using PerformanceFish.Prepatching;
|
|
|
|
namespace PerformanceFish;
|
|
|
|
public sealed class UtilityPrepatches : ClassWithFishPrepatches
|
|
{
|
|
public sealed class CreateModClassesPatch : FishPrepatch
|
|
{
|
|
public override string? Description { get; }
|
|
= "Hook for very early loading of patches, right after the game finishes loading up game assemblies into "
|
|
+ "its process and before it launches any processes on them. Certain patches require this.";
|
|
|
|
public override bool Enabled => true;
|
|
|
|
public override bool ShowSettings => false;
|
|
|
|
public override MethodBase TargetMethodBase { get; }
|
|
= methodof(LoadedModManager.CreateModClasses);
|
|
|
|
public static void Prefix()
|
|
{
|
|
try
|
|
{
|
|
OnAssembliesLoaded.Start();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Log.Error($"Exception caught within OnAssembliesLoaded:\n{e}\n{new StackTrace(true)}");
|
|
}
|
|
}
|
|
}
|
|
} |