protected virtual void LoadScore(Score score) { if (score == null) { return; } foreach (pSprite ps in leftPanel) { ps.FadeOut(100); ps.AlwaysDraw = false; } leftPanel.Clear(); rankingElements.Clear(); this.score = score; if (score.Processor != null || score.PlayMode == PlayModes.OsuMania) { stringTotalScore = string.Format("{0:0000000}", score.TotalScore); } else { stringTotalScore = string.Format("{0:00000000}", score.TotalScore); } s_score1 = new pSpriteText("", SkinManager.Current.FontScore, SkinManager.Current.FontScoreOverlap, Fields.TopLeft, Origins.Centre, Clocks.Game, new Vector2(220, 94), 0.8F, true, Color.White); s_score1.Scale = SkinManager.UseNewLayout ? 1.3f : 1.05f; if (SkinManager.UseNewLayout) { s_score1.SpacingOverlap = -2; } s_score1.TextConstantSpacing = true; spriteManagerWideScrolling.Add(s_score1); leftPanel.Add(s_score1); const int textx1 = 80; const int imgx1 = 40; const int textx2 = 280; const int imgx2 = 240; const int row1 = 160; const int row2 = 220; const int row3 = 280; const int row4 = 320; RankingElement e; switch (score.PlayMode) { case PlayModes.Osu: { rankingElements.Add(new RankingElement(@"hit300", new Vector2(imgx1, row1), String.Format("{0}x", score.Count300))); rankingElements.Add(new RankingElement(@"hit100", new Vector2(imgx1, row2), String.Format("{0}x", score.Count100))); rankingElements.Add(new RankingElement(@"hit50", new Vector2(imgx1, row3), String.Format("{0}x", score.Count50))); rankingElements.Add(new RankingElement(@"hit300g", new Vector2(imgx2, row1), String.Format("{0}x", score.CountGeki))); rankingElements.Add(new RankingElement(@"hit100k", new Vector2(imgx2, row2), String.Format("{0}x", score.CountKatu))); rankingElements.Add(new RankingElement(@"hit0", new Vector2(imgx2, row3), String.Format("{0}x", score.CountMiss))); break; } case PlayModes.Taiko: { rankingElements.Add(new RankingElement(@"taiko-hit300", new Vector2(imgx1, row1), String.Format("{0}x", score.Count300 - score.CountGeki))); rankingElements.Add(new RankingElement(@"taiko-hit100", new Vector2(imgx1, row2), String.Format("{0}x", score.Count100 - score.CountKatu))); rankingElements.Add(new RankingElement(@"taiko-hit0", new Vector2(imgx1, row3), String.Format("{0}x", score.CountMiss))); rankingElements.Add(new RankingElement(@"taiko-hit300g", new Vector2(imgx2, row1), String.Format("{0}x", score.CountGeki))); rankingElements.Add(new RankingElement(@"taiko-hit100k", new Vector2(imgx2, row2), String.Format("{0}x", score.CountKatu))); break; } case PlayModes.CatchTheBeat: { // overlays are added first to prevent a minor display bug rankingElements.Add(new RankingElement(@"fruit-orange-overlay", new Vector2(imgx1, row1), null, true)); e = new RankingElement(@"fruit-orange", new Vector2(imgx1, row1), String.Format("{0}x", score.Count300)); e.image.InitialColour = Color.Orange; rankingElements.Add(e); e = new RankingElement(@"fruit-drop", new Vector2(imgx1, row2), String.Format("{0}x", score.Count100)); e.ChangeScale(1F, 0.6F); e.image.InitialColour = Color.YellowGreen; rankingElements.Add(e); e = new RankingElement(@"fruit-drop", new Vector2(imgx1, row3), String.Format("{0}x", score.Count50)); e.ChangeScale(1F, 0.4F); e.ApplyRotation(4f); e.image.InitialColour = Color.LightBlue; rankingElements.Add(e); e = new RankingElement(@"fruit-orange-overlay", new Vector2(imgx2, row1), null, true); e.ChangeScale(1f, 0.4f); e.ApplyRotation(0.8f); rankingElements.Add(e); e = new RankingElement(@"hit0", new Vector2(imgx2, row1) - new Vector2(20, 20), null, true); e.ChangeScale(0.7f, 0.2f); rankingElements.Add(e); e = new RankingElement(@"fruit-orange", new Vector2(imgx2, row1), String.Format("{0}x", score.CountMiss)); e.ChangeScale(1f, 0.4f); e.ApplyRotation(0.8f); e.image.InitialColour = Color.LightGray; rankingElements.Add(e); break; } case PlayModes.OsuMania: { rankingElements.Add(new RankingElement(@"mania-hit300", new Vector2(imgx1, row1), String.Format("{0}x", score.Count300))); rankingElements.Add(new RankingElement(@"mania-hit200", new Vector2(imgx1, row2), String.Format("{0}x", score.CountKatu))); rankingElements.Add(new RankingElement(@"mania-hit50", new Vector2(imgx1, row3), String.Format("{0}x", score.Count50))); rankingElements.Add(new RankingElement(@"mania-hit300g", new Vector2(imgx2, row1), String.Format("{0}x", score.CountGeki))); rankingElements.Add(new RankingElement(@"mania-hit100", new Vector2(imgx2, row2), String.Format("{0}x", score.Count100))); rankingElements.Add(new RankingElement(@"mania-hit0", new Vector2(imgx2, row3), String.Format("{0}x", score.CountMiss))); break; } } int row4Offset = (SkinManager.UseNewLayout ? 20 : 8); e = new RankingElement(@"ranking-maxcombo", new Vector2(imgx1 - 35, row4 - row4Offset), null, false, 0, Origins.TopLeft); e.ChangeScale(1F, 1F); e.image.Depth = 0.81F; // we're adding the text separately here because of the unusual offset. e.LoadScoreText(String.Format("{0}x", score.MaxCombo), new Vector2(textx1 - 65, row4 + 10)); e.text.Depth = 0.8F; rankingElements.Add(e); e = new RankingElement(@"ranking-accuracy", new Vector2(imgx2 - 58, row4 - row4Offset), null, false, 0, Origins.TopLeft); e.ChangeScale(1F, 1F); e.image.Depth = 0.81F; e.LoadScoreText(String.Format("{0:0.00}%", score.Accuracy * 100), new Vector2(textx2 - 86, row4 + 10)); e.text.Depth = 0.8F; rankingElements.Add(e); // show average error as hint string hint = ""; if (score.HitErrors != null && score.HitErrors.Count != 0) { List <double> result = GetErrorStatisticsArray(score.HitErrors); if (result != null) { #if DEBUG hint = String.Format("Accuracy:\nError: {0:0.00}ms - {1:0.00}ms avg / {3:0.00}ms - {4:0.00}ms max \nUnstable Rate: {2:0.00}\n", result[0], result[1], result[4] * 10, result[6], result[5]); #else hint = String.Format("Accuracy:\nError: {0:0.00}ms - {1:0.00}ms avg\nUnstable Rate: {2:0.00}\n", result[0], result[1], result[4] * 10, result[6], result[5]); #endif } } if (score.SpinningRates != null && score.SpinningRates.Count != 0) { List <double> result = GetErrorStatisticsArray(score.SpinningRates); if (result != null) { hint += String.Format("Spin:\nSpeed: {0:000}(Max:{1:000}rpm)\nUnstable Rate: {2:0.00}\n", result[2], result[5], result[4] * 2); } } if (hint != "") { spriteRankingGraph.HandleInput = true; spriteRankingGraph.ToolTip = hint; } if (score.Perfect) { e = new RankingElement(@"ranking-perfect", new Vector2(SkinManager.UseNewLayout ? 260 : 200, 430), null, false, 300); e.ChangeScale(1.1F, 1F); e.image.Depth = 0.99F; rankingElements.Add(e); } int timeOffset = AddRankingSprites(); LoadRanking(timeOffset); if (healthGraph != null) { spriteManagerWideScrolling.Remove(healthGraph); healthGraph.Dispose(); } //Actual graph position relative to the graph sprite float healthGraphX = spriteRankingGraph.InitialPosition.X + (SkinManager.UseNewLayout ? 5 : 10); float healthGraphY = spriteRankingGraph.InitialPosition.Y + (SkinManager.UseNewLayout ? 5 : 10); healthGraph = new HealthGraph(startTime, 4000, score, new RectangleF(healthGraphX, healthGraphY, 186, 86)); spriteManagerWideScrolling.Add(healthGraph); LoadMods(); s_white = new pSprite(GameBase.WhitePixel, Fields.TopLeft, Origins.TopLeft, Clocks.Game, Vector2.Zero, 1, false, Color.TransparentWhite); s_white.ScaleToWindowRatio = false; s_white.Additive = true; s_white.VectorScale = new Vector2(GameBase.WindowManager.Width, GameBase.WindowManager.Height); Transformation t = new Transformation(TransformationType.Fade, 0.5f, 0, startTime + timeOffset + 1000, startTime + timeOffset + 2400); s_white.Transformations.Add(t); spriteManagerWideAbove.Add(s_white); leftPanel.Add(s_white); }