Example #1
0
 internal void SetTrackingEntry(ScoreboardEntry tracking)
 {
     trackingEntry = tracking;
     trackingEntry.spriteBackground.StartColour = new Color(58, 110, 165, 180);
     if (!Entries.Contains(trackingEntry))
     {
         Add(trackingEntry);
     }
 }
Example #2
0
 internal virtual void SetTrackingEntry(ScoreboardEntry tracking)
 {
     trackingEntry = tracking;
     if (!Entries.Contains(trackingEntry))
     {
         Add(trackingEntry);
     }
     trackingEntry.SpriteBackground.InitialColour = new Color(250, 250, 250, 100);
 }
Example #3
0
        internal Scoreboard(int displayCount, ScoreboardEntry tracking, Vector2 topLeft, bool startVisible)
        {
            AlwaysVisible = startVisible;

            this.displayCount = displayCount;

            this.topLeft = topLeft;

            if (tracking != null)
            {
                SetTrackingEntry(tracking);
            }
        }
Example #4
0
        internal Scoreboard(int displayCount, ScoreboardEntry tracking, Vector2 topLeft, bool startVisible)
        {
            TextureManager.Load(@"scoreboard-explosion-1", SkinSource.Osu);
            TextureManager.Load(@"scoreboard-explosion-2", SkinSource.Osu);

            AlwaysVisible = startVisible;

            this.displayCount = displayCount;

            this.topLeft = topLeft;

            if (tracking != null)
            {
                SetTrackingEntry(tracking);
            }
        }
Example #5
0
        internal void Add(ScoreboardEntry s)
        {
            Entries.Add(s);
            if (DisplayOnRight)
            {
                s.AlignedToRight = DisplayOnRight;
            }
            s.scoreboard = this;

            if (s.allowUpdateRank)
            {
                if (s.rank == 0 && ShowLeader)
                {
                    s.SpriteBackground.InitialColour = new Color(97, 190, 255, 150);
                }
                else
                {
                    s.SpriteBackground.InitialColour = new Color(31, 115, 153, 150);
                }
            }

            spriteManager.Add(s.SpriteCollection);
        }
Example #6
0
 internal void Add(ScoreboardEntry s)
 {
     Entries.Add(s);
     spriteManager.Add(s.SpriteCollection);
 }
Example #7
0
        internal void Reposition(bool instant)
        {
            int trackingPos = Entries.IndexOf(trackingEntry);

            int startScore = trackingPos > displayCount - 1 ? trackingPos - (displayCount - 1) : 0;

            if (ShowLeader && startScore > 0)
            {
                startScore++;
            }

            int leftList  = 0;
            int rightList = 0;

            //local score is being displayed.  the rank delimiter should be decreased by one since the local score may pass this one.
            //todo: refactor this stuff.  should be a child class or something to handle these cases.
            int rankDelimiter = InputManager.ReplayMode && !InputManager.ReplayStreaming && !ModManager.CheckActive(Player.currentScore.EnabledMods, Mods.Autoplay) ? inputCount - 1 : Entries.Count - 1;

            if (!InputManager.ReplayMode && Entries.Count > 0 && Entries[Entries.Count - 1].Score != null && Entries[Entries.Count - 1].Score == BeatmapManager.Current.onlinePersonalScore)
            {
                rankDelimiter--;
            }

            int rank = 1;

            for (int i = 0; i < Entries.Count; i++)
            {
                ScoreboardEntry sbe = Entries[i];

                bool displayOnRight = Entries[i].AlignedToRight || DisplayOnRight;

                int m = displayOnRight ? rightList : leftList;

                //int m = i - startScore;
                bool displayable = i >= startScore && m < displayCount || (ShowLeader && i == 0);

                if (displayable && AutoColour && sbe != trackingEntry && sbe.allowUpdateRank)
                {
                    sbe.alpha = 0.8f - (float)i / inputCount * 0.3f;
                }

                if (i > 0 && (!AllowTies || Entries[i - 1].score != sbe.score))
                {
                    rank++;
                }

                if (AllowRankUpdates)
                {
                    sbe.rank = rank;

                    if (sbe.Passing)
                    {
                        sbe.UpdateRank((ConfigManager.sRankType != Select.RankingType.Friends && ConfigManager.sRankType != Select.RankingType.Local) &&
                                       sbe.rank > rankDelimiter && MatchSetup.Match == null ? -1 : i + 1);
                    }
                }

                sbe.MoveTo(topLeft + offset * m, displayable, instant);

                if (displayable)
                {
                    if (displayOnRight)
                    {
                        rightList++;
                    }
                    else
                    {
                        leftList++;
                    }
                }
            }
        }