@@ -14,6 +14,10 @@ namespace Poltergeist
1414 [ HarmonyPatch ]
1515 public static class Patches
1616 {
17+ //Config things
18+ public static bool runBarebones = false ;
19+
20+ //Other fields
1721 public static GrabbableObject ignoreObj = null ;
1822
1923 /////////////////////////////// Needed to suppress certain base-game systems ///////////////////////////////
@@ -25,7 +29,7 @@ public static class Patches
2529 [ HarmonyPatch ( typeof ( StartOfRound ) , nameof ( StartOfRound . SetSpectateCameraToGameOverMode ) ) ]
2630 public static bool PreventSpectateFollow ( )
2731 {
28- return false ;
32+ return runBarebones ;
2933 }
3034
3135 /**
@@ -37,7 +41,8 @@ public static bool PreventSpectateFollow()
3741 [ HarmonyPatch ( typeof ( PlayerControllerB ) , "LateUpdate" ) ]
3842 public static void OverrideSpectateCam ( PlayerControllerB __instance )
3943 {
40- __instance . playersManager . overrideSpectateCamera = true ;
44+ if ( ! runBarebones )
45+ __instance . playersManager . overrideSpectateCamera = true ;
4146 }
4247
4348 /**
@@ -70,6 +75,10 @@ public static bool SuppressDuplicateHonk(GrabbableObject __instance) {
7075 [ HarmonyPatch ( typeof ( StartOfRound ) , nameof ( StartOfRound . SwitchCamera ) ) ]
7176 public static void ManageCameraController ( StartOfRound __instance , Camera newCamera )
7277 {
78+ //Cancel if in barebones mode
79+ if ( runBarebones )
80+ return ;
81+
7382 if ( newCamera == __instance . spectateCamera )
7483 SpectatorCamController . instance . EnableCam ( ) ;
7584 else
@@ -85,6 +94,10 @@ public static void ManageCameraController(StartOfRound __instance, Camera newCam
8594 [ HarmonyPatch ( typeof ( StartOfRound ) , "Awake" ) ]
8695 public static void MakeCamController ( StartOfRound __instance )
8796 {
97+ //Cancel if in barebones mode
98+ if ( runBarebones )
99+ return ;
100+
88101 __instance . spectateCamera . gameObject . AddComponent < SpectatorCamController > ( ) ;
89102 }
90103
@@ -99,8 +112,12 @@ public static void MakeCamController(StartOfRound __instance)
99112 [ HarmonyPatch ( typeof ( InteractTrigger ) , "Start" ) ]
100113 public static void AddGhostInteractor ( InteractTrigger __instance )
101114 {
115+ //Cancel if in barebones mode
116+ if ( runBarebones )
117+ return ;
118+
102119 //If it's a door, add the interactible
103- if ( __instance . gameObject . GetComponent < DoorLock > ( ) != null )
120+ if ( __instance . gameObject . GetComponent < DoorLock > ( ) != null )
104121 __instance . gameObject . AddComponent < GhostInteractible > ( ) ;
105122
106123 //If it's the lightswitch, add one there too
@@ -117,7 +134,11 @@ public static void AddGhostInteractor(InteractTrigger __instance)
117134 [ HarmonyPatch ( typeof ( NoisemakerProp ) , "Start" ) ]
118135 public static void AddInteractorForHorns ( NoisemakerProp __instance )
119136 {
120- if ( __instance . name . Contains ( "Airhorn" ) || __instance . name . Contains ( "Clownhorn" ) )
137+ //Cancel if in barebones mode
138+ if ( runBarebones )
139+ return ;
140+
141+ if ( __instance . name . Contains ( "Airhorn" ) || __instance . name . Contains ( "Clownhorn" ) )
121142 {
122143 __instance . gameObject . AddComponent < GhostInteractible > ( ) ;
123144 }
@@ -132,6 +153,10 @@ public static void AddInteractorForHorns(NoisemakerProp __instance)
132153 [ HarmonyPatch ( typeof ( BoomboxItem ) , "Start" ) ]
133154 public static void AddInteractorForBoombox ( BoomboxItem __instance )
134155 {
156+ //Cancel if in barebones mode
157+ if ( runBarebones )
158+ return ;
159+
135160 __instance . gameObject . AddComponent < GhostInteractible > ( ) ;
136161 }
137162
@@ -233,6 +258,7 @@ public static IEnumerable<CodeInstruction> AllowGroundHearing(IEnumerable<CodeIn
233258 return code ;
234259 }
235260
261+ /*
236262 [HarmonyPostfix]
237263 [HarmonyPatch(typeof(GrabbableObject), "UseItemOnClient")]
238264 public static void PrintClientUse()
@@ -253,5 +279,6 @@ public static void PrintClientRpc()
253279 {
254280 Poltergeist.DebugLog("Client Rpc called for object");
255281 }
282+ */
256283 }
257284}
0 commit comments