Esempio n. 1
0
        public static float GetHighScorePercentage(string songID)
        {
            //Get the needed data
            HighScoreRecords.HighScoreInfo highScoreInfo = HighScoreRecords.GetHighScore(songID);
            float highScore        = Convert.ToSingle(highScoreInfo.score);
            float maxPossibleScore = Convert.ToSingle(starThresholds.GetMaxRawScore(songID, highScoreInfo.difficulty));

            //Calculate score percentage
            float percentage = (highScore / maxPossibleScore) * 100;

            return(percentage);
        }
Esempio n. 2
0
        public static void ScoreKeeperDisplayUpdate(ScoreKeeperDisplay scoreKeeperDisplay)
        {
            if (!KataConfig.I.practiceMode)
            {
                int   score      = ScoreKeeper.I.mScore;
                float percentage = GetScorePercentage(selectedSong, score, KataConfig.I.GetDifficulty());

                //Make pretty-ish strings
                string scoreString      = "<size=" + inGameCurrentScoreSize + ">" + String.Format("{0:n0}", score).Replace(",", " ") + "</size>";
                string percentageString = "<size=" + inGameCurrentPercentSize + "> (" + String.Format("{0:0.00}", percentage) + "%)</size>";

                scoreKeeperDisplay.scoreDisplay.text = scoreString + percentageString;

                HighScoreRecords.HighScoreInfo highScoreInfo = HighScoreRecords.GetHighScore(selectedSong);
                float highScore           = Convert.ToSingle(highScoreInfo.score);
                float highScorePercentage = GetHighScorePercentage(selectedSong);

                string highScoreString           = "<size=" + inGameHighScoreSize + ">" + String.Format("{0:n0}", highScore).Replace(",", " ") + "</size>";
                string highScorePercentageString = "<size=" + inGamePercentSize + "> (" + String.Format("{0:0.00}", highScorePercentage) + "%)</size>";

                scoreKeeperDisplay.highScoreDisplay.text = "<size=" + inGameHighScoreLabelSize + ">" + inGameHighScoreLabelText + "</size>" + highScoreString + highScorePercentageString;
            }
        }