示例#1
0
 /// <summary>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnDownloadProgressChanged(object sender, BindableValueChangedEventArgs <DownloadProgressChangedEventArgs> e)
 {
     if (CurrentDownload.MapsetId == Game.MapsetId)
     {
         Creator.Text = $"Downloading Map: {e.Value.ProgressPercentage}%";
     }
 }
 /// <summary>
 ///     Called when the filter type has changed.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnSelectedOnlineUserFilterTypeChanged(object sender,
                                                    BindableValueChangedEventArgs <OnlineUserFilterType> e)
 {
     AllFilterButton.Selected     = e.Value == OnlineUserFilterType.All;
     FriendsFilterButton.Selected = e.Value == OnlineUserFilterType.Friends;
     CountryFilterButton.Selected = e.Value == OnlineUserFilterType.Country;
 }
示例#3
0
 /// <summary>
 ///     Called when changing the order by.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnSelectOrderMapsetsByChanged(object sender, BindableValueChangedEventArgs <OrderMapsetsBy> e)
 {
     ButtonOrderByArtist.Selected    = e.Value == OrderMapsetsBy.Artist;
     ButtonOrderByTitle.Selected     = e.Value == OrderMapsetsBy.Title;
     ButtonOrderByCreator.Selected   = e.Value == OrderMapsetsBy.Creator;
     ButtonOrderByDateAdded.Selected = e.Value == OrderMapsetsBy.DateAdded;
 }
示例#4
0
 private void OnConnectionStatusChanged(object sender, BindableValueChangedEventArgs <ConnectionStatus> e)
 {
     if (e.Value != ConnectionStatus.Connected)
     {
         DialogManager.Dismiss(this);
     }
 }
示例#5
0
        /// <summary>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnSelectedMultiplayerUserChanged(object sender, BindableValueChangedEventArgs <ScoreboardUser> e)
        {
            MultiplayerContainer.ClearAnimations();
            MainContainer.ClearAnimations();

            var animationTime = 500;

            var screen = (ResultScreen)Screen;

            if (e.Value == null)
            {
                MultiplayerContainer.MoveToX(0, Easing.OutQuint, animationTime);
                MainContainer.MoveToX(-WindowManager.Width, Easing.OutQuint, animationTime);
            }
            else
            {
                MultiplayerContainer.MoveToX(WindowManager.Width, Easing.OutQuint, animationTime);
                MainContainer.MoveToX(0, Easing.OutQuint, animationTime);

                // Get rid of the old container
                ScoreContainer.Visible = false;

                // Swap for the new container
                ScoreContainer           = screen.CachedScoreContainers[e.Value];
                ScoreContainer.Alignment = Alignment.BotCenter;
                ScoreContainer.Y         = -66;
                ScoreContainer.Visible   = true;
            }
        }
示例#6
0
 /// <summary>
 ///     Called when the user changes the option for displaying failed scores.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnDisplayFailedScoresChanged(object sender, BindableValueChangedEventArgs <bool> e)
 {
     if (ConfigManager.LeaderboardSection.Value == LeaderboardType.Local)
     {
         ConfigManager.LeaderboardSection.Value = LeaderboardType.Local;
     }
 }
示例#7
0
        /// <summary>
        ///     This method is an event handler specifically for handling the case of when the value of the binded value
        ///     has changed. This will automatically set the progress position.
        ///
        ///     This is mainly for cases such as volume, where it can be controlled through means other than the slider
        ///     (example: keybinds), and if the slider is displayed, it should update as well.
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnValueChanged(object sender, BindableValueChangedEventArgs <int> e)
        {
            // Play a sound effect
            //PlaySoundEffectWhenChanged(e.Value);

            // Update the previous value.
            PreviousValue = e.Value;
        }
示例#8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnLeaderboardSectionChange(object sender, BindableValueChangedEventArgs <LeaderboardType> e)
        {
            Sections[e.OldValue].ClearScores();
            Sections[e.OldValue].Visible = false;
            Sections[e.Value].Visible    = true;

            LoadNewScores();
        }
示例#9
0
        /// <summary>
        ///     Called when the user changes whether they want to load osu maps or not
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnAutoLoadOsuBeatmapsChanged(object sender, BindableValueChangedEventArgs <bool> e)
        {
            if (e.Value == MapDatabaseCache.LoadedMapsFromOtherGames)
            {
                return;
            }

            Exit(() => new ImportingScreen());
        }
        /// <summary>
        ///     Called when the user clicks on a new mapset, so we can display its banner and information.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnSelectedMapsetChanged(object sender, BindableValueChangedEventArgs <DownloadableMapset> e)
        {
            if (e.Value != null)
            {
                ShowPreview(e.Value.Mapset);
                return;
            }

            HidePreview();
        }
        /// <summary>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnSelectedLayerChanged(object sender, BindableValueChangedEventArgs <int> e)
        {
            var selectedLayer = View.LayerCompositor.ScrollContainer.AvailableItems[e.Value];

            NameTextbox.RawText        = selectedLayer.Name;
            NameTextbox.InputText.Text = selectedLayer.Name;

            SelectedColor.Tint     = ColorHelper.ToXnaColor(selectedLayer.GetColor());
            TextSelectedColor.Text = $"(R:{SelectedColor.Tint.R}, G:{SelectedColor.Tint.G}, B:{SelectedColor.Tint.B})";
        }
        /// <summary>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnSelectedWindowChanged(object sender, BindableValueChangedEventArgs <JudgementWindows> e)
        {
            BindableSliderValues[Judgement.Marv].Value  = (int)e.Value.Marvelous;
            BindableSliderValues[Judgement.Perf].Value  = (int)e.Value.Perfect;
            BindableSliderValues[Judgement.Great].Value = (int)e.Value.Great;
            BindableSliderValues[Judgement.Good].Value  = (int)e.Value.Good;
            BindableSliderValues[Judgement.Okay].Value  = (int)e.Value.Okay;
            BindableSliderValues[Judgement.Miss].Value  = (int)e.Value.Miss;

            StyleSliders();
        }
示例#13
0
 /// <summary>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnSelectedHitsoundsChanged(object sender, BindableValueChangedEventArgs <HitSounds> e)
 {
     if (e.Value.HasFlag(Hitsounds))
     {
         ActivatedSprite.Image = FontAwesome.Get(FontAwesomeIcon.fa_check_sign_in_a_rounded_black_square);
         ActivatedSprite.Tint  = Color.LimeGreen;
     }
     else
     {
         ActivatedSprite.Image = FontAwesome.Get(FontAwesomeIcon.fa_remove_symbol);
         ActivatedSprite.Tint  = Color.Crimson;
     }
 }
示例#14
0
        /// <summary>
        ///     Called when the user's online status has changed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnOnlineStatusChanged(object sender, BindableValueChangedEventArgs <ConnectionStatus> e)
        {
            try
            {
                switch (e.Value)
                {
                case ConnectionStatus.Disconnected:
                    if (LeftAlignedItems.Contains(DownloadMapsButton))
                    {
                        DownloadMapsButton.Parent = null;
                        LeftAlignedItems.Remove(DownloadMapsButton);
                    }

                    if (LeftAlignedItems.Contains(OpenChatButton))
                    {
                        OpenChatButton.Parent = null;
                        LeftAlignedItems.Remove(OpenChatButton);
                    }

                    AlignLeftItems();
                    break;

                case ConnectionStatus.Connecting:
                    break;

                case ConnectionStatus.Connected:
                    if (!LeftAlignedItems.Contains(DownloadMapsButton))
                    {
                        LeftAlignedItems.Add(DownloadMapsButton);
                    }

                    if (!LeftAlignedItems.Contains(OpenChatButton))
                    {
                        LeftAlignedItems.Add(OpenChatButton);
                    }

                    AlignLeftItems();
                    break;

                case ConnectionStatus.Reconnecting:
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex, LogType.Runtime);
            }
        }
示例#15
0
        /// <summary>
        ///     Called whenever the user's onlinestatus is changed.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <exception cref="NotImplementedException"></exception>
        private void OnOnlineStatusChange(object sender, BindableValueChangedEventArgs <ConnectionStatus> e)
        {
            if (e.Value != ConnectionStatus.Connected || e.OldValue == ConnectionStatus.Connected)
            {
                return;
            }

            if (ConfigManager.LeaderboardSection.Value != LeaderboardType.Global && ConfigManager.LeaderboardSection.Value != LeaderboardType.Mods)
            {
                return;
            }

            // When the user connects again, load scores.
            LoadNewScores();
        }
示例#16
0
        /// <summary>
        ///     Called when the user is searching/finishes searching.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnIsSearchingValueChanged(object sender, BindableValueChangedEventArgs <bool> e)
        {
            ClearAnimations();

            var val = e.Value ? 0.85f : 0;

            Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, Alpha, val, 150));

            LoadingWheel.ClearAnimations();
            LoadingWheel.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, Alpha, (e.Value ? 1 : 0), 150));

            Icon.ClearAnimations();
            Icon.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, Alpha, e.Value ? 1 : 0, 150));

            Header.ClearAnimations();
            Header.Animations.Add(new Animation(AnimationProperty.Alpha, Easing.Linear, Alpha, e.Value ? 1 : 0, 150));
        }
示例#17
0
        /// <summary>
        ///     Called when the user's username changes.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnConfigUsernameChanged(object sender, BindableValueChangedEventArgs <string> e)
        {
            UsernameText.Text = e.Value;
            Resize();

            var parent = Parent;

            while (parent != null && parent.GetType().IsAssignableFrom(typeof(Navbar)))
            {
                parent = parent.Parent;

                if (!parent.GetType().IsAssignableFrom(typeof(Navbar)))
                {
                    continue;
                }

                var navbar = parent as Navbar;
                navbar?.AlignRightItems();
            }
        }
        /// <summary>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnActiveLayerInterfaceChanged(object sender, BindableValueChangedEventArgs <EditorLayerInterface> e)
        {
            switch (e.Value)
            {
            case EditorLayerInterface.Composition:
                LayerCompositor.ClearAnimations();
                LayerCompositor.MoveToX(0, Easing.OutQuint, 350);
                LayerEditor.ClearAnimations();
                LayerEditor.MoveToX(LayerEditor.Width, Easing.OutQuint, 350);
                break;

            case EditorLayerInterface.Editing:
                LayerCompositor.ClearAnimations();
                LayerCompositor.MoveToX(LayerCompositor.Width, Easing.OutQuint, 350);
                LayerEditor.ClearAnimations();
                LayerEditor.MoveToX(0, Easing.OutQuint, 350);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
示例#19
0
        private void OnDownloadCompleted(object sender, BindableValueChangedEventArgs <AsyncCompletedEventArgs> e)
        {
            CurrentDownload.Dispose();

            if (e.Value.Error != null)
            {
                NotificationManager.Show(NotificationLevel.Error, "Download Failed!");
            }

            if (CurrentDownload.MapsetId == Game.MapsetId)
            {
                NotificationManager.Show(NotificationLevel.Success, "Download Complete!");

                var game = GameBase.Game as QuaverGame;

                if (game?.CurrentScreen.Type == QuaverScreenType.Multiplayer || game?.CurrentScreen.Type == QuaverScreenType.Select)
                {
                    game?.CurrentScreen.Exit(() => new ImportingScreen(Screen), 0, QuaverScreenChangeType.AddToStack);
                }
            }

            CurrentDownload = null;
        }
示例#20
0
 /// <summary>
 ///     Updates the text when the key is changed.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void OnKeybindChanged(object sender, BindableValueChangedEventArgs <Keys> args) => KeyText.Text = XnaKeyHelper.GetStringFromKey(args.Value);
 /// <summary>
 ///     Called when the user wants to display/not display measure lines
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnOnlyShowMeasureLinesChanged(object sender, BindableValueChangedEventArgs <bool> e) => ShowMeasureLineIfApplicable();
 /// <summary>
 ///     Called when the user changes their snap colors in config.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnBeatSnapColorTypeChanged(object sender, BindableValueChangedEventArgs <EditorBeatSnapColor> e) => RecolorLines();
示例#23
0
 /// <summary>
 ///     Called when the selected map is changed.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnMapChange(object sender, BindableValueChangedEventArgs <Map> e)
 {
     // LoadBanner(e.OldValue);
     UpdateText(e.Value);
 }
示例#24
0
 /// <summary>
 ///     Config Autosave functionality for Bindable<T>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="d"></param>
 private static void AutoSaveConfiguration <T>(object sender, BindableValueChangedEventArgs <T> d)
 {
     // ReSharper disable once ArrangeMethodOrOperatorBody
     CommonTaskScheduler.Add(CommonTask.WriteConfig);
 }
示例#25
0
 /// <summary>
 ///     Called when the user changes whether they want to load osu maps or not
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnAutoLoadOsuBeatmapsChanged(object sender, BindableValueChangedEventArgs <bool> e) => Exit(() => new ImportingScreen());
示例#26
0
 /// <summary>
 ///     Called when the connection status has changed.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnConnectionStatusChanged(object sender, BindableValueChangedEventArgs <ConnectionStatus> e)
 {
     UpdateConnectionStatus();
     UpdateButtons();
 }
示例#27
0
 /// <summary>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnBindableValueChanged(object sender, BindableValueChangedEventArgs <FpsLimitType> e) => Selector.SelectIndex((int)e.Value);
示例#28
0
 /// <summary>
 ///     Called when the user changes whether they want to load osu maps or not
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnAutoLoadOsuBeatmapsChanged(object sender, BindableValueChangedEventArgs <bool> e) => Exit(
     () => new ImportingScreen(MultiplayerScreen), 0, QuaverScreenChangeType.AddToStack);
示例#29
0
 /// <summary>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnValueChanged(object sender, BindableValueChangedEventArgs <int> e) => Value.Text = Display(e.Value);
示例#30
0
 /// <summary>
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void RefilterGames(object sender, BindableValueChangedEventArgs <bool> e) => MatchContainer.FilterGames(Searchbox.RawText, true);