Skip to content

Commit

Permalink
Use bfix patching method for DisableSimAnimations +readme
Browse files Browse the repository at this point in the history
  • Loading branch information
m22spencer committed Oct 10, 2019
1 parent 7a39b96 commit 2b10eb6
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 51 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ For an install guide see here: [https://github.com/janxious/ModTek/wiki/The-Drop
- Replace the MechLab UI with a virtual one, which allocates only enough prefabs for what you're currently seeing on the screen.
- This fix sees more gain for late game players with lots of items inventory.
- DMFix
- Fix exponential dependency checking explosion (Drops around 2 minutes from loads in roguetech)
- Fix exponential dependency checking explosion (Drops around 2 minutes from loads in roguetech).
- RemovedFlashpointFix
- This fix removes invalid flashpoints allowing saves to load if a user created flashpoint was removed from the mods in use
- This fix removes invalid flashpoints allowing saves to load if a user created flashpoint was removed from the mods in use.
- DisableSimAnimations
- Make all simgame room transitions instant.

# Experimental patches
- MDDB_TagsetQueryInChunks
Expand Down
2 changes: 1 addition & 1 deletion source/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.10.2.*")]
[assembly: AssemblyVersion("2.10.3.*")]
3 changes: 2 additions & 1 deletion source/BattletechPerformanceFix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<Compile Include="ContractLagFix.cs" />
<Compile Include="DisableSensitiveDataLogDump.cs" />
<Compile Include="DisableDeployAudio.cs" />
<Compile Include="DisableSimAnimations.cs" />
<Compile Include="ExtraLogging.cs" />
<Compile Include="GhostBlipOverride.cs" />
<Compile Include="Logging.cs" />
Expand Down Expand Up @@ -129,4 +130,4 @@
<PostBuildEvent Condition="$(IsLinux) == true">yes | cp "$(TargetDir)$(TargetName).dll" "$(SolutionDir)../../Mods/BattletechPerformanceFix/$(TargetName).dll"</PostBuildEvent>
<PostBuildEvent Condition="$(IsOSX) == true">yes | cp "$(TargetDir)$(TargetName).dll" "$(SolutionDir)../../Mods/BattletechPerformanceFix/$(TargetName).dll"</PostBuildEvent>
</PropertyGroup>
</Project>
</Project>
25 changes: 0 additions & 25 deletions source/DisableCombatTurnDelays.cs

This file was deleted.

29 changes: 8 additions & 21 deletions source/DisableSimAnimations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,22 @@ namespace BattletechPerformanceFix
class DisableSimAnimations : Feature
{
public void Activate()
{
var init = "Init";
var transitionMech = "TransitionMech";

init.Pre<SimGameCameraController>();
transitionMech.Pre<SGRoomController_MechBay>();
{
"Init".Pre<SimGameCameraController>();
"TransitionMech".Pre<SGRoomController_MechBay>();
}

// disables scene transition animation
[HarmonyPatch(typeof(SimGameCameraController), "Init")]
public static class Init_Pre
public static void Init_Pre(ref float ___betweenRoomTransitionTime, ref float ___inRoomTransitionTime)
{
public static void Prefix(
ref float ___betweenRoomTransitionTime, ref float ___inRoomTransitionTime)
{
___betweenRoomTransitionTime = ___inRoomTransitionTime = 0f;
}
___betweenRoomTransitionTime = ___inRoomTransitionTime = 0f;
}

// disables mech transition animation
[HarmonyPatch(typeof(SGRoomController_MechBay), "TransitionMech")]
public static class TransitionMech_Pre
public static void TransitionMech_Pre(ref float fadeDuration)
{
// ReSharper disable once RedundantAssignment
public static void Prefix(ref float fadeDuration)
{
UnityGameInstance.BattleTechGame.Simulation.CameraController.mechLabSpin = null;
fadeDuration = 0f;
}
UnityGameInstance.BattleTechGame.Simulation.CameraController.mechLabSpin = null;
fadeDuration = 0f;
}
}
}
3 changes: 2 additions & 1 deletion source/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ public static void Start(string modDirectory, string json)
{ typeof(ShaderDependencyOverride), true },
{ typeof(GhostBlipOverride), true },
{ typeof(DisableDeployAudio), false },
{ typeof(RemovedFlashpointFix), true }
{ typeof(RemovedFlashpointFix), true },
{ typeof(DisableSimAnimations), false },
};

Dictionary<Type, bool> want = allFeatures.ToDictionary(f => f.Key, f => settings.features.TryGetValue(f.Key.Name, out var userBool) ? userBool : f.Value);
Expand Down

0 comments on commit 2b10eb6

Please sign in to comment.