private void updateActiveState(bool isActive)
 {
     if (isActive)
     {
         this.TransformBindableTo(inactiveVolumeFade, 1, 400, Easing.OutQuint);
     }
     else
     {
         this.TransformBindableTo(inactiveVolumeFade, LocalConfig.Get <double>(OsuSetting.VolumeInactive), 4000, Easing.OutQuint);
     }
 }
Exemple #2
0
        public bool OnPressed(GlobalAction action)
        {
            if (intro == null)
            {
                return(false);
            }

            switch (action)
            {
            case GlobalAction.ToggleChat:
                chat.ToggleVisibility();
                return(true);

            case GlobalAction.ToggleSocial:
                social.ToggleVisibility();
                return(true);

            case GlobalAction.ResetInputSettings:
                var sensitivity = frameworkConfig.GetBindable <double>(FrameworkSetting.CursorSensitivity);

                sensitivity.Disabled = false;
                sensitivity.Value    = 1;
                sensitivity.Disabled = true;

                frameworkConfig.Set(FrameworkSetting.IgnoredInputHandlers, string.Empty);
                frameworkConfig.GetBindable <ConfineMouseMode>(FrameworkSetting.ConfineMouseMode).SetDefault();
                return(true);

            case GlobalAction.ToggleToolbar:
                Toolbar.ToggleVisibility();
                return(true);

            case GlobalAction.ToggleSettings:
                settings.ToggleVisibility();
                return(true);

            case GlobalAction.ToggleDirect:
                direct.ToggleVisibility();
                return(true);

            case GlobalAction.ToggleGameplayMouseButtons:
                LocalConfig.Set(OsuSetting.MouseDisableButtons, !LocalConfig.Get <bool>(OsuSetting.MouseDisableButtons));
                return(true);
            }

            return(false);
        }