static bool Prefix(CyclopsExternalCams __instance)
        {
            if (!__instance.lightingPanel.cyclopsRoot.powerRelay.IsPowered())
            {
                return(false);
            }
            switch (CyclopsExternalCams.lightState)
            {
            case 0:
                __instance.cameraLight.enabled = false;
                return(false);

            case 1:
                __instance.cameraLight.range     = CyclopsSettings.cameraLightRange;
                __instance.cameraLight.intensity = CyclopsSettings.cameraLightIntensity;
                __instance.cameraLight.enabled   = true;
                return(false);

            case 2:
                __instance.cameraLight.range     = CyclopsSettings.cameraLightRange * 1.35f;
                __instance.cameraLight.intensity = CyclopsSettings.cameraLightIntensity * 1.35f;
                __instance.cameraLight.enabled   = true;
                return(false);

            default:
                return(false);
            }
        }
Ejemplo n.º 2
0
        public static void Postfix(CyclopsExternalCams __instance)
        {
            GameObject CyclopsRoot = __instance.transform.parent.gameObject;

            if (CyclopsRoot.name.Equals("__LIGHTMAPPED_PREFAB__"))
            {
                return;
            }

            CyclopsRoot.EnsureComponent <CannonControl>();

            SNLogger.Debug("CyclopsLaserCannonModule", $"Patch injected on class [CyclopsExternalCams] for this Cyclops instance: {CyclopsRoot.GetInstanceID()}. CannonControl component added.");
        }
        public static bool EnterCameraView_Prefix(CyclopsExternalCams __instance)
        {
            Traverse.Create(__instance).Field("usingCamera").SetValue(true);// Using Harmony Reflection Helper to set private variable usingCamera.
            InputHandlerStack.main.Push(__instance);
            Player main = Player.main;

            MainCameraControl.main.enabled = false;
            Player.main.SetHeadVisible(true);
            __instance.cameraLight.enabled = true;
            Traverse.Create(__instance).Method("ChangeCamera", 0).GetValue();// Call the private method ChangeCamera(0) using Harmony Reflection Helper
            if (__instance.lightingPanel)
            {
                __instance.lightingPanel.TempTurnOffFloodlights();
            }
            return(false);
        }
        public static bool EnterCameraView_Prefix(CyclopsExternalCams __instance)
        {
            Traverse.Create(__instance).Field("usingCamera").SetValue(true);
            InputHandlerStack.main.Push(__instance);
            Player main = Player.main;

            MainCameraControl.main.enabled = false;
            Player.main.SetHeadVisible(true);
            __instance.cameraLight.enabled = true;
            Traverse.Create(__instance).Method("ChangeCamera", new object[]
            {
                0
            }).GetValue();
            if (__instance.lightingPanel)
            {
                __instance.lightingPanel.TempTurnOffFloodlights();
            }
            return(false);
        }
Ejemplo n.º 5
0
 static bool Prefix(CyclopsExternalCams __instance, ref bool __result)
 {
     if (CyclopsSettings.alternativeCameraControls)
     {
         if (!__instance.usingCamera)
         {
             __result = false;
             return(false);
         }
         if (!__instance.liveMixin.IsAlive())
         {
             __instance.ExitCamera();
             __result = false;
             return(false);
         }
         if (GameInput.GetButtonUp(GameInput.Button.Exit) || Input.GetKeyUp(KeyCode.Escape))
         {
             __instance.ExitCamera();
             __result = false;
             return(false);
         }
         if (GameInput.GetButtonDown(GameInput.Button.CycleNext))
         {
             __instance.ChangeCamera(1);
         }
         else if (GameInput.GetButtonDown(GameInput.Button.CyclePrev))
         {
             __instance.ChangeCamera(-1);
         }
         if (GameInput.GetButtonUp(GameInput.Button.RightHand))
         {
             if (CycleLightUp())
             {
                 FMODUWE.PlayOneShot(__instance.lightingPanel.vn_lightsOn, __instance.cameraLight.transform.position, 1f);
             }
             __instance.SetLight();
         }
         if (GameInput.GetButtonUp(GameInput.Button.LeftHand))
         {
             if (CycleLightDown())
             {
                 FMODUWE.PlayOneShot(__instance.lightingPanel.vn_lightsOff, __instance.cameraLight.transform.position, 1f);
             }
             __instance.SetLight();
         }
         if (GameInput.GetButtonUp(GameInput.Button.Slot1))
         {
             __instance.cameraIndex = 1;
             __instance.ChangeCamera(0);
         }
         if (GameInput.GetButtonUp(GameInput.Button.Slot2))
         {
             __instance.cameraIndex = 2;
             __instance.ChangeCamera(0);
         }
         if (GameInput.GetButtonUp(GameInput.Button.Slot3))
         {
             __instance.cameraIndex = 0;
             __instance.ChangeCamera(0);
         }
         __result = true;
         return(false);
     }
     return(true);
 }
 static void Postfix(CyclopsExternalCams __instance, int __state)
 {
     CyclopsExternalCams.lightState = __state;
     __instance.SetLight();
 }
 static void Postfix(CyclopsExternalCams __instance)
 {
     CyclopsExternalCams.lightState = 0;
     __instance.cameraLight.color   = Color.white;
     __instance.cameraIndex         = 1;
 }