Beispiel #1
0
        protected override void Dispose(bool isDisposing)
        {
            base.Dispose(isDisposing);

            Ruleset.UnbindAll();
            SelectedMods.UnbindAll();
        }
            internal override void UnbindAllInternal()
            {
                base.UnbindAllInternal();

                // optimisation to ensure cleanup happens aggressively.
                // without this, the central parameters bindable's internal WeakList can balloon out of control due to the
                // weak reference cleanup only occurring on Value retrieval (which rarely/never happens in this case).
                parameters?.UnbindAll();
            }
Beispiel #3
0
        public void SetContent(DifficultyIconTooltipContent content)
        {
            difficultyName.Text = content.BeatmapInfo.DifficultyName;

            starDifficulty.UnbindAll();
            starDifficulty.BindTo(content.Difficulty);
            starDifficulty.BindValueChanged(difficulty =>
            {
                starRating.Text       = $"{difficulty.NewValue.Stars:0.##}";
                difficultyFlow.Colour = colours.ForStarDifficulty(difficulty.NewValue.Stars);
            }, true);
        }
Beispiel #4
0
        protected override void Dispose(bool isDisposing)
        {
            base.Dispose(isDisposing);

            if (spectatorClient != null)
            {
                foreach (var(userId, _) in userMap)
                {
                    spectatorClient.StopWatchingUser(userId);
                }
            }

            managerUpdated?.UnbindAll();
        }
Beispiel #5
0
        protected override void Dispose(bool isDisposing)
        {
            base.Dispose(isDisposing);

            if (spectatorStreaming != null)
            {
                spectatorStreaming.OnUserBeganPlaying    -= userBeganPlaying;
                spectatorStreaming.OnUserFinishedPlaying -= userFinishedPlaying;
                spectatorStreaming.OnNewFrames           -= userSentFrames;

                spectatorStreaming.StopWatchingUser(targetUser.Id);
            }

            managerUpdated?.UnbindAll();
        }
Beispiel #6
0
        protected override void OnApply()
        {
            base.OnApply();

            TextBindable.BindTo(HitObject.TextBindable);
            AlternativeTextBindable.BindTo(HitObject.AlternativeTextBindable);
            DisplayBindable.BindTo(HitObject.DisplayBindable);
            ToneBindable.BindTo(HitObject.ToneBindable);

            if (HitObject.ParentLyric != null)
            {
                HitObject.ParentLyricBindable.BindValueChanged(x =>
                {
                    SingersBindable.UnbindAll();
                    SingersBindable.BindTo(x.NewValue.SingersBindable);
                }, true);
            }
        }
Beispiel #7
0
            public bool SetContent(object content)
            {
                if (!(content is DifficultyIconTooltipContent iconContent))
                {
                    return(false);
                }

                difficultyName.Text = iconContent.Beatmap.Version;

                starDifficulty.UnbindAll();
                starDifficulty.BindTo(iconContent.Difficulty);
                starDifficulty.BindValueChanged(difficulty =>
                {
                    starRating.Text       = $"{difficulty.NewValue.Stars:0.##}";
                    difficultyFlow.Colour = colours.ForDifficultyRating(difficulty.NewValue.DifficultyRating, true);
                }, true);

                return(true);
            }
Beispiel #8
0
        protected override void Dispose(bool isDisposing)
        {
            base.Dispose(isDisposing);

            if (spectatorClient != null)
            {
                spectatorClient.OnUserBeganPlaying    -= userBeganPlaying;
                spectatorClient.OnUserFinishedPlaying -= userFinishedPlaying;
                spectatorClient.OnNewFrames           -= userSentFrames;

                lock (stateLock)
                {
                    foreach (var(userId, _) in userMap)
                    {
                        spectatorClient.StopWatchingUser(userId);
                    }
                }
            }

            managerUpdated?.UnbindAll();
        }
Beispiel #9
0
 public void Dispose()
 {
     apiState.UnbindAll();
     cancelExistingConnect();
 }