@@ -6,8 +6,8 @@ namespace DebugMod
66{
77 public class DebugMod : Mod
88 {
9- private const string _modVersion = "8.0 " ;
10- private DebugHUD counter = null ;
9+ private const string _modVersion = "8.2 " ;
10+ private DebugHUD modHUD = null ;
1111 private static GameObject go = null ;
1212 private readonly Vector3 npcPos = new Vector3 ( 926f , 44f , 364.7f ) ;
1313 private float npcDistance = 0.0f ;
@@ -19,19 +19,27 @@ public DebugMod() : base("DebugMod")
1919
2020 public override void Initialize ( )
2121 {
22+ go = new GameObject ( ) ;
23+ modHUD = go . AddComponent < DebugHUD > ( ) ;
24+ Object . DontDestroyOnLoad ( go ) ;
25+
2226 SceneManager . activeSceneChanged += OnSceneChange ;
2327 ModHooks . Instance . OnParseScriptHook += Instance_OnParseScriptHook ;
2428 On . PlayerMachine . Jump_SuperUpdate += PlayerMachine_Jump_SuperUpdate ;
29+ On . HiddenPlatform . Activate += HiddenPlatform_Activate ;
30+ }
2531
26- go = new GameObject ( ) ;
27- counter = go . AddComponent < DebugHUD > ( ) ;
28- Object . DontDestroyOnLoad ( go ) ;
32+ private void HiddenPlatform_Activate ( On . HiddenPlatform . orig_Activate orig , HiddenPlatform self )
33+ {
34+ bool temp = self . flag ;
35+ orig ( self ) ;
36+ if ( modHUD . CamEventReset && temp ) self . flag = false ;
2937 }
3038
3139 //For noclip fun
3240 private void PlayerMachine_Jump_SuperUpdate ( On . PlayerMachine . orig_Jump_SuperUpdate orig , PlayerMachine self )
3341 {
34- if ( DebugHUD . NoClipActive )
42+ if ( modHUD . NoClipActive )
3543 {
3644 self . Gravity = 0f ;
3745 orig ( self ) ;
@@ -47,7 +55,7 @@ private void PlayerMachine_Jump_SuperUpdate(On.PlayerMachine.orig_Jump_SuperUpda
4755 }
4856 else
4957 {
50- orig ( self ) ;
58+ orig ( self ) ;
5159 }
5260 }
5361
@@ -58,11 +66,11 @@ private void OnSceneChange(Scene oldScene, Scene newScene)
5866 var playerMachine = Manager . Player . GetComponent < PlayerMachine > ( ) ;
5967 if ( playerMachine )
6068 {
61- counter . ToggleState ( true , playerMachine ) ;
69+ modHUD . ToggleState ( true , playerMachine ) ;
6270 }
6371 else
6472 {
65- if ( counter ) counter . ToggleState ( false , null ) ;
73+ if ( modHUD ) modHUD . ToggleState ( false , null ) ;
6674 }
6775
6876 if ( newScene . name == "void" )
0 commit comments