private void UpdateController()
 {
     if (GreenHellGame.IsPadControllerConnected() != this.m_PadControllerConnected)
     {
         this.OnChangeControllerOption();
     }
 }
    private void OnChangeControllerOption()
    {
        base.SetupController();
        bool flag = GreenHellGame.IsPadControllerConnected();

        this.m_ControllerButton.gameObject.SetActive(flag);
        this.m_ControllerButton.SetByOption(GreenHellGame.IsPCControllerActive() ? "No" : "Yes");
        if (GreenHellGame.IsPadControllerActive() && this.m_CursorVisible)
        {
            this.HideCursor();
        }
        else if (GreenHellGame.IsPCControllerActive() && !this.m_CursorVisible)
        {
            this.ShowCursor();
        }
        this.m_PadControllerConnected = flag;
    }
    public override void OnShow()
    {
        base.OnShow();
        this.m_ControllerButton.SetByOption((GreenHellGame.Instance.m_Settings.m_ControllerType == ControllerType.PC) ? "No" : "Yes");
        switch (GreenHellGame.Instance.m_Settings.m_ToggleRunOption)
        {
        case GameSettings.ToggleRunOption.No:
            this.m_ToggleRunButton.SetByOption("No");
            break;

        case GameSettings.ToggleRunOption.Yes:
            this.m_ToggleRunButton.SetByOption("Yes");
            break;

        case GameSettings.ToggleRunOption.Always:
            this.m_ToggleRunButton.SetByOption("On");
            break;
        }
        this.m_ToggleCrouchButton.SetByOption(GreenHellGame.Instance.m_Settings.m_ToggleCrouch ? "Yes" : "No");
        this.m_ToggleWatchButton.SetByOption(GreenHellGame.Instance.m_Settings.m_ToggleWatch ? "Yes" : "No");
        this.m_InvertMouseYButton.SetByOption(GreenHellGame.Instance.m_Settings.m_InvertMouseY ? "Yes" : "No");
        this.m_InvertMouseY             = GreenHellGame.Instance.m_Settings.m_InvertMouseY;
        this.m_XSensitivitySlider.value = GreenHellGame.Instance.m_Settings.m_XSensitivity;
        this.m_YSensitivitySlider.value = GreenHellGame.Instance.m_Settings.m_YSensitivity;
        if (GreenHellGame.Instance.m_Settings.m_LookRotationSpeed > 50f)
        {
            this.m_MouseSmoothing.value = CJTools.Math.GetProportionalClamp(0f, 0.5f, GreenHellGame.Instance.m_Settings.m_LookRotationSpeed, 200f, 50f);
        }
        else
        {
            this.m_MouseSmoothing.value = CJTools.Math.GetProportionalClamp(0.5f, 1f, GreenHellGame.Instance.m_Settings.m_LookRotationSpeed, 50f, 12f);
        }
        this.m_CursorVisible = GreenHellGame.IsPCControllerActive();
        this.m_KeyBindingsButton.gameObject.SetActive(GreenHellGame.IsPCControllerActive());
        this.m_PadControllerConnected = GreenHellGame.IsPadControllerConnected();
        this.m_ControllerButton.gameObject.SetActive(this.m_PadControllerConnected);
    }