Beispiel #1
0
 private void DisableScore()
 {
     if (!Plugin.isScoreDisabled)
     {
         Logger.log.Notice("TransparentWall is enabled in HMD. ScoreSubmission has been disabled.");
         ScoreSubmission.ProlongedDisableSubmission("TransparentWall");
         Plugin.isScoreDisabled = true;
     }
 }
Beispiel #2
0
        private void Update()
        {
            try
            {
                var config = Settings.instance;

                mainController = config.SelectedController == "Left" ? InputDevices.GetDeviceAtXRNode(XRNode.LeftHand) : InputDevices.GetDeviceAtXRNode(XRNode.RightHand);

                mainController.TryGetFeatureValue(CommonUsages.primary2DAxisClick, out mainStickPress);
                float  mainStick = Input.GetAxis("Horizontal" + config.SelectedController + "Hand");
                string curscene  = SceneManager.GetActiveScene().name;

                turnStep = config.RotationStep;

                this.enabled = (config.EnableTurning && !(curscene == "GameCore" && !config.EnableInSongs));

                if (turnStep > 5 && config.SmoothTurn)
                {
                    turnStep            = 5;
                    config.RotationStep = 5;
                }

                mainController.TryGetFeatureValue(CommonUsages.secondary2DAxis, out hasJoystick);

                string conManu = mainController.manufacturer;
                if (hasJoystick != Vector2.zero || (conManu == "Oculus" || (conManu == "Valve" && config.InputType == "Default")) || config.InputType == "Touch")
                {
                    mainStickPress = Math.Abs(mainStick) > 0.1; // Devices with joysticks shouldn't require a full press, unless overridden in settings.
                }

                if (!isFinished && mainStickPress)
                {
                    switch (SceneManager.GetActiveScene().name)
                    {
                    case "GameCore" when config.EnableTurning && config.EnableInSongs:
                        ScoreSubmission.ProlongedDisableSubmission("SnapTurn");
                        break;

                    default:
                        break;
                    }

                    int spinDir = mainStick < 0 ? (0 - turnStep) : turnStep;
                    this.transform.Rotate(0, spinDir, 0, Space.World);
                    SetSceneRotations();
                }
                isFinished = (mainStickPress && !config.SmoothTurn);
            }
            catch (Exception)
            {
                throw;
            }
        }
        private void SetEnabled(bool value)
        {
            Config.Instance.IsEnabled = value;

            if (value)
            {
                ScoreSubmission.ProlongedDisableSubmission(Plugin.modName);
            }
            else
            {
                ScoreSubmission.RemoveProlongedDisable(Plugin.modName);
            }
        }
Beispiel #4
0
 public void ApplyHarmonyPatches()
 {
     try
     {
         Logger.log.Debug("Applying Harmony patches.");
         harmony.PatchAll(Assembly.GetExecutingAssembly());
         ScoreSubmission.ProlongedDisableSubmission("PlaneVisualizer");
     }
     catch (Exception ex)
     {
         Logger.log.Critical("Error applying Harmony patches: " + ex.Message);
         Logger.log.Debug(ex);
     }
 }
        internal static void DisableScoreSubmission(string reason)
        {
            lock (scoreBlockList)
            {
                if (!scoreBlockList.Contains(reason))
                {
                    scoreBlockList.Add(reason);
                }

                if (!ScoreIsBlocked)
                {
                    ScoreSubmission.ProlongedDisableSubmission(Plugin.PluginName);
                    ScoreIsBlocked = true;
                    Logger.log.Info("ScoreSubmission has been disabled.");
                }
            }
        }
Beispiel #6
0
        public void OnApplicationStart()
        {
            Log.Debug("OnApplicationStart");
            new GameObject("VisibleHitboxesController").AddComponent <VisibleHitboxesController>();
            _harmonyInstance = new Harmony("com.ryan.VisibleHitboxes");
            _harmonyInstance.PatchAll(Assembly.GetExecutingAssembly());

            if (Config.Instance.IsEnabled)
            {
                ScoreSubmission.ProlongedDisableSubmission(modName);
            }

            _menuButtonManager = new MenuButtonManager();
            _menuButtonManager.Setup();

            CreateMaterial();
            CreateCubeMesh();
        }