Exemplo n.º 1
0
        public static void GenerateLabels()
        {
            // Folder Parameters
            for (int i = 0; i < FolderParams.Count; i++)
            {
                labels.Add(FolderParams[i], new Label(Globals.Font["Franklin"], FolderParams[i].Name, new Rectangle(0, 0, 223, 88), Color.White));
            }
            // Level Labels
            for (int i = 0; i < 10; i++)
            {
                labels.Add("LEVEL" + (i + 1), new Label(Globals.Font["Franklin"], "LEVEL" + (i + 1), new Rectangle(0, 0, 225, 88), Color.White));
            }

            // Song Metadata
            foreach (var song in Songlist)
            {
                var titleFont = FontTools.ContainsJP(song.Title) ? "JP" : "Franklin";
                labels.Add(song.SongID + "-TITLE", new Label(Globals.Font[titleFont], song.Title, new Rectangle(0, 0, 200, 38), Color.White));

                var artistFont = FontTools.ContainsJP(song.Artist) ? "JP" : "Franklin";
                labels.Add(song.SongID + "-ARTIST", new Label(Globals.Font[artistFont], song.Artist, new Rectangle(0, 0, 160, 36), Color.White));
            }


            labels.Add("AUTO", new Label(Globals.Font["Franklin"], "AUTO MODE ENABLED", new Vector2(Globals.WindowSize.X - 10, 10), Color.White, Justification.Top | Justification.Right, LabelType.Default, 0.15f));
            labels.Add("NO-SONGS", new Label(Globals.Font["Franklin"], "NO SONGS FOUND", new Vector2(Globals.WindowSize.X / 2, Globals.WindowSize.Y / 2), Color.White, Justification.Center | Justification.Middle, LabelType.Default, 0.5f));
        }
Exemplo n.º 2
0
        public static void GenerateLabels(NoteCollection song)
        {
            labels.Clear();

            string titleFont  = FontTools.ContainsJP(song.Metadata.Title) ? "JP" : "Franklin";
            string artistFont = FontTools.ContainsJP(song.Metadata.Artist) ? "JP" : "Franklin";

            // Top Row
            plotLocation.X = 60;
            plotLocation.Y = TopRowLocation;
            labels.Add(new Label(Globals.Font["Franklin"], "SCROLL", plotLocation, Color.White, Justification.Center, LabelType.FixedHeight, 10.0f));
            plotLocation.X = 150;
            labels.Add(new Label(Globals.Font["Franklin"], "ACCURACY", plotLocation, Color.White, Justification.Left, LabelType.FixedHeight, 10.0f));
            plotLocation.X = 1140;
            labels.Add(new Label(Globals.Font[titleFont], song.Metadata.Title, plotLocation, Color.White, Justification.Right, LabelType.FixedHeight, 40.0f));
            plotLocation.X = 1200;
            labels.Add(new Label(Globals.Font["Franklin"], Enum.GetName(typeof(Difficulty), song.Metadata.Difficulty).ToUpper(), plotLocation, Color.White, Justification.Center, LabelType.FixedHeight, 10.0f));

            // Bottom row
            plotLocation.X = 60;
            plotLocation.Y = BottomRowLocation;
            labels.Add(new Label(Globals.Font["Franklin"], Globals.SpeedScale.ToString("F1"), plotLocation, Color.White, Justification.Center | Justification.Bottom, LabelType.FixedHeight, 50.0f));
            plotLocation.X = 150;
            labels.Add(new Label(Globals.Font["Franklin"], (song.CurrentScore / song.TotalNotes * 100.0).ToString("000.000"), plotLocation, Color.White, Justification.Left | Justification.Bottom, LabelType.FixedHeight, 40.0f));
            plotLocation.X = 395;
            labels.Add(new Label(Globals.Font["Franklin"], "/ 100.000%", plotLocation, Color.White, Justification.Left | Justification.Bottom, LabelType.FixedHeight, 20.0f));
            plotLocation.X = 1140;
            labels.Add(new Label(Globals.Font[artistFont], song.Metadata.Artist, plotLocation, Color.White, Justification.Right | Justification.Bottom, LabelType.FixedHeight, 30.0f));
            plotLocation.X = 1200;
            labels.Add(new Label(Globals.Font["Franklin"], song.Metadata.Level.ToString("D2"), plotLocation, Color.White, Justification.Center | Justification.Bottom, LabelType.FixedHeight, 50.0f));
        }
Exemplo n.º 3
0
        public static void Draw(SpriteBatch sb, NoteCollection song)
        {
            if (song == null)
            {
                return;
            }

            var log = Globals.DrawTempLog;

            sb.Begin();
            sb.Draw(Globals.Textures["GpLowerBG"], new Vector2(0, 599), Color.Black);
            string titleFont  = FontTools.ContainsJP(song.Metadata.Title) ? "JP" : "Franklin";
            string artistFont = FontTools.ContainsJP(song.Metadata.Artist) ? "JP" : "Franklin";

            if (Globals.DrawProfiling)
            {
                log.AddEvent(Globals.DrawStopwatch.ElapsedMilliseconds, "UI: BG");
            }

            foreach (var label in labels)
            {
                label.Draw(sb);

                if (Globals.DrawProfiling)
                {
                    if (labels.IndexOf(label) == 3)
                    {
                        log.AddEvent(Globals.DrawStopwatch.ElapsedMilliseconds, "UI: Top Row");
                    }
                    if (labels.IndexOf(label) == 8)
                    {
                        log.AddEvent(Globals.DrawStopwatch.ElapsedMilliseconds, "UI: Bottom Row");
                    }
                }
            }

            if (Globals.AutoMode != GameSettingsScreen.AutoMode.Off)
            {
                plotLocation.X = Globals.WindowSize.X - 10;
                plotLocation.Y = 10;
                string str = Globals.AutoMode == GameSettingsScreen.AutoMode.Auto ? "AUTO MODE ENABLED" : "AUTO DOWN ENABLED";
                sb.DrawStringJustify(Globals.Font["Franklin"], str, plotLocation, Color.White, 0.1f, Justification.Top | Justification.Right);
            }

            sb.End();
        }
Exemplo n.º 4
0
        public static void UpdateMetaLabels()
        {
            // Update Selected Song Metadata
            string bpm = "???";

            if (Songlist[currentSongIndex].BpmIndex.Count > 0)
            {
                bpm = Songlist[currentSongIndex].BpmIndex.First().Value.ToString("F0");
            }
            else if (Songlist[currentSongIndex].IsMetadataFile && Songlist[currentSongIndex].BpmIndex.Count == 0 && Songlist[currentSongIndex].ChildMetadata.Count > 0)
            {
                bpm = Songlist[currentSongIndex].ChildMetadata.First().BpmIndex.First().Value.ToString("F0");
            }

            var titleFont  = FontTools.ContainsJP(Songlist[currentSongIndex].Title) ? "JP" : "Franklin";
            var artistFont = FontTools.ContainsJP(Songlist[currentSongIndex].Artist) ? "JP" : "Franklin";

            labels["META-TITLE"]  = new Label(Globals.Font[titleFont], Songlist[currentSongIndex].Title, new Vector2(1220, 570), Color.White, Justification.Bottom | Justification.Right, LabelType.FixedHeight, 40.0f);
            labels["META-ARTIST"] = new Label(Globals.Font[titleFont], Songlist[currentSongIndex].Artist, new Vector2(1220, 610), Color.White, Justification.Bottom | Justification.Right, LabelType.FixedHeight, 30.0f);
            labels["META-BPM"]    = new Label(Globals.Font[titleFont], bpm + " BPM", new Vector2(1220, 640), Color.White, Justification.Bottom | Justification.Right, LabelType.FixedHeight, 20.0f);
            labels["META-CHOREO"] = new Label(Globals.Font[titleFont], "Choreo: " + Songlist[currentSongIndex].GetPropertyFromChild("Designer", currentSongLevelIndex), new Vector2(1220, 670), Color.White, Justification.Bottom | Justification.Right, LabelType.FixedHeight, 20.0f);
        }
Exemplo n.º 5
0
        public static void UpdateText(NoteCollection song)
        {
            // Note Counts
            updatedableLabels[LabelField.StylishCount] = new Label(Globals.Font["Franklin"], song.PerfectCount.ToString("D4"), gradeTotalPoint, Color.White, Justification.Right | Justification.Bottom, LabelType.FixedHeight, fontHeightMain, defaultStroke);
            updatedableLabels[LabelField.CoolCount]    = new Label(Globals.Font["Franklin"], song.GreatCount.ToString("D4"), gradeTotalPoint + gradeLabelOffset, Color.White, Justification.Right | Justification.Bottom, LabelType.FixedHeight, fontHeightMain, defaultStroke);
            updatedableLabels[LabelField.GoodCount]    = new Label(Globals.Font["Franklin"], song.GoodCount.ToString("D4"), gradeTotalPoint + 2 * gradeLabelOffset, Color.White, Justification.Right | Justification.Bottom, LabelType.FixedHeight, fontHeightMain, defaultStroke);
            updatedableLabels[LabelField.MissCount]    = new Label(Globals.Font["Franklin"], song.MissCount.ToString("D4"), gradeTotalPoint + 3 * gradeLabelOffset, Color.White, Justification.Right | Justification.Bottom, LabelType.FixedHeight, fontHeightMain, defaultStroke);

            // Score
            updatedableLabels[LabelField.Score] = new Label(Globals.Font["Franklin"], (song.CurrentScore / song.TotalNotes * 100.0f).ToString("F3") + "%", new Vector2(780, 500), Color.White, Justification.Right | Justification.Bottom, LabelType.FixedHeight, 50.0f, defaultStroke);

            // Clear/Fail String
            string result    = "";
            Color  fontCol   = Color.White;
            Color  strokeCol = Color.Black;

            switch (song.SongEnd)
            {
            case SongEndReason.Undefined:
                break;

            case SongEndReason.Forfeit:
                result    = "Forfeited";
                fontCol   = Color.LightGray;
                strokeCol = Color.Gray;
                break;

            case SongEndReason.Failed:
                result    = "Failed";
                fontCol   = ThemeColors.FailedFont;
                strokeCol = ThemeColors.FailedStroke;
                break;

            case SongEndReason.Cleared:
                if (song.MissCount > 0)
                {
                    result    = "Cleared";
                    fontCol   = ThemeColors.ClearedFont;
                    strokeCol = ThemeColors.ClearedStroke;
                }
                else
                {
                    result    = "Full Combo";
                    fontCol   = ThemeColors.FullComboFont;
                    strokeCol = ThemeColors.FullComboStroke;
                }
                break;

            default:
                break;
            }
            updatedableLabels[LabelField.Result] = new Label(Globals.Font["Franklin"], result, gradeTotalPoint - gradeLabelOffset, fontCol, Justification.Right | Justification.Bottom, LabelType.FixedHeight, fontHeightMain, new Label.Stroke(2.0f, strokeCol));

            // Song Info
            string titleFont  = FontTools.ContainsJP(song.Metadata.Title) ? "JP" : "Franklin";
            string artistFont = FontTools.ContainsJP(song.Metadata.Artist) ? "JP" : "Franklin";

            updatedableLabels[LabelField.Title]  = new Label(Globals.Font[titleFont], song.Metadata.Title, new Vector2(Globals.WindowSize.X / 2, 100), Color.White, Justification.Center | Justification.Top, LabelType.FixedHeight, fontHeightMain + 5.0f, defaultStroke);
            updatedableLabels[LabelField.Artist] = new Label(Globals.Font[artistFont], song.Metadata.Artist, new Vector2(Globals.WindowSize.X / 2, 140), Color.White, Justification.Center | Justification.Top, LabelType.FixedHeight, fontHeightMain, defaultStroke);
            updatedableLabels[LabelField.Level]  = new Label(Globals.Font["Franklin"], "Lv. " + song.Metadata.Level.ToString("D2"), new Vector2(Globals.WindowSize.X / 2, 170), Color.White, Justification.Center | Justification.Top, LabelType.FixedHeight, fontHeightMain, defaultStroke);
        }