Exemple #1
0
    protected override void OnViewShow()
    {
        base.OnViewShow();

        m_SliderSoundVolume.RegisterChangeValueDelegate(OnSoundVolumeChanged);
        m_SliderMusicVolume.RegisterChangeValueDelegate(OnMusicVolumeChanged);
        m_SwitchMusic.RegisterDelegate(OnMusicToggled);
    }
Exemple #2
0
    //---------------------------------------------------------
    public static GUIBase_Slider RegisterSliderDelegate(GUIBase_Layout layout, string sliderName, GUIBase_Slider.ChangeValueDelegate d)
    {
        GUIBase_Slider control = GetControl <GUIBase_Slider>(layout, sliderName);

        if (control != null)
        {
            control.RegisterChangeValueDelegate(d);
        }
        else
        {
            Debug.LogError("Can't find slider '" + sliderName + "'");
        }
        return(control);
    }
Exemple #3
0
    // PRIVATE METHODS

    void BindControls(bool state)
    {
        // bind callbacks
#if MADFINGER_KEYBOARD_MOUSE
        m_KeyboardButton.RegisterReleaseDelegate(state ? OnKeyboardPressed : (GUIBase_Button.ReleaseDelegate)null);
#else
        if (!GamepadInputManager.Instance.IsNvidiaShield())
        {
            m_ControlSchemeEnum.RegisterDelegate(state ? OnControlSchemeChanged : (GUIBase_Enum.ChangeValueDelegate)null);
            m_FireButtonSize.RegisterChangeValueDelegate(state ? OnFireButtonSize : (GUIBase_Slider.ChangeValueDelegate)null);
            m_SwitchLefthanded.RegisterDelegate(state ? OnLefthandedToggled : (GUIBase_Switch.SwitchDelegate)null);
            m_CustomizeButton.RegisterReleaseDelegate(state ? OnCustomizePressed : (GUIBase_Button.ReleaseDelegate)null);
            m_MogaHelpButton.RegisterReleaseDelegate(state ? OnMogaHelpPressed : (GUIBase_Button.ReleaseDelegate)null);

            // enable/disable controls
            m_CustomizeButton.SetDisabled(m_CustomizeControls != null ? false : true);
            m_CustomizeButton.Widget.Show((m_CustomizeControls != null), true);
        }
#endif
        m_SliderSensitivity.RegisterChangeValueDelegate(state ? OnSensitivityChanged : (GUIBase_Slider.ChangeValueDelegate)null);
        m_SwitchYAxis.RegisterDelegate(state ? OnInvertYToggled : (GUIBase_Switch.SwitchDelegate)null);
        m_GamepadButton.RegisterReleaseDelegate(state ? OnGamepadPressed : (GUIBase_Button.ReleaseDelegate)null);
    }