-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'UI_speedups' of git://github.com/gnivler/BattletechPerf…
…ormanceFix into gnivler-UI_speedups
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using BattleTech.UI; | ||
using Harmony; | ||
|
||
namespace BattletechPerformanceFix | ||
{ | ||
public class DisableCombatTurnDelays : Feature | ||
{ | ||
public void Activate() | ||
{ | ||
var fadeOut = "FadeOutNotificationOverSecondsCoroutine"; | ||
var showTeam = "ShowTeamNotification"; | ||
fadeOut.Pre<TurnEventNotification>(); | ||
showTeam.Pre<TurnEventNotification>(); | ||
} | ||
|
||
[HarmonyPatch(typeof(TurnEventNotification), "FadeOutNotificationOverSecondsCoroutine")] | ||
public class FadeOutNotificationOverSecondsCoroutine_Pre | ||
{ | ||
public static void Prefix(ref float seconds) | ||
{ | ||
seconds = 0; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using BattleTech; | ||
using BattleTech.UI; | ||
using Harmony; | ||
|
||
namespace BattletechPerformanceFix | ||
{ | ||
class DisableSimAnimations : Feature | ||
{ | ||
public void Activate() | ||
{ | ||
var init = "Init"; | ||
var transitionMech = "TransitionMech"; | ||
|
||
init.Pre<SimGameCameraController>(); | ||
transitionMech.Pre<SGRoomController_MechBay>(); | ||
} | ||
|
||
// disables scene transition animation | ||
[HarmonyPatch(typeof(SimGameCameraController), "Init")] | ||
public static class Init_Pre | ||
{ | ||
public static void Prefix( | ||
ref float ___betweenRoomTransitionTime, ref float ___inRoomTransitionTime) | ||
{ | ||
___betweenRoomTransitionTime = ___inRoomTransitionTime = 0f; | ||
} | ||
} | ||
|
||
// disables mech transition animation | ||
[HarmonyPatch(typeof(SGRoomController_MechBay), "TransitionMech")] | ||
public static class TransitionMech_Pre | ||
{ | ||
// ReSharper disable once RedundantAssignment | ||
public static void Prefix(ref float fadeDuration) | ||
{ | ||
UnityGameInstance.BattleTechGame.Simulation.CameraController.mechLabSpin = null; | ||
fadeDuration = 0f; | ||
} | ||
} | ||
} | ||
} |