public SplitNotes(List <String> notes, NotesComponentSettings settings)
        {
            Settings = settings;
            Name     = "";

            foreach (string curNote in notes)
            {
                if (!(curNote.Length <= 3))
                {
                    string   strType = curNote.Substring(0, 3);
                    NoteType type    = NoteType.Comment;
                    string   note    = curNote.Substring(0, curNote.Length);

                    switch (strType)
                    {
                    case "!!!":
                        Name = curNote.Substring(3, curNote.Length - 3);
                        type = NoteType.Title;
                        break;

                    case ">>>":
                        type = NoteType.LevelUp;
                        break;

                    case "$$$":
                        type = NoteType.ItemTracking;
                        break;

                    case "<<<":
                        type = NoteType.Teleport;
                        break;

                    case "---":
                        type = NoteType.Drop;
                        break;

                    case "&&&":
                        type = NoteType.Kill;
                        break;

                    case "///":
                        type = NoteType.Skip;
                        break;

                    case "###":
                        type = NoteType.Trophy;
                        break;
                    }

                    if (type != NoteType.Comment)
                    {
                        note = curNote.Substring(3, curNote.Length - 3);
                    }

                    Notes.Add(new Note(type, note, Settings));
                }
            }

            VisibleComponents = Notes;
        }
Beispiel #2
0
 public NotesComponent(LiveSplitState state)
 {
     Settings = new NotesComponentSettings(state)
     {
         CurrentState = state
     };
     readFile();
 }
        public Note(NoteType type, string note, NotesComponentSettings settings)
        {
            Settings = settings;
            Type     = type;
            Text     = note;

            VerticalHeight  = 10f;
            HorizontalWidth = 100f;

            switch (type)
            {
            case NoteType.LevelUp:
                bgColor  = Settings.LevelUpBgColor;
                txtColor = Settings.LevelUpTxtColor;
                break;

            case NoteType.ItemTracking:
                bgColor  = Settings.ItemTrackingBgColor;
                txtColor = Settings.ItemTrackingTxtColor;
                break;

            case NoteType.Teleport:
                bgColor  = Settings.TeleportBgColor;
                txtColor = Settings.TeleportTxtColor;
                break;

            case NoteType.Drop:
                bgColor  = Settings.DropBgColor;
                txtColor = Settings.DropTxtColor;
                break;

            case NoteType.Kill:
                bgColor  = Settings.KillBgColor;
                txtColor = Settings.KillTxtColor;
                break;

            case NoteType.Skip:
                bgColor  = Settings.SkipBgColor;
                txtColor = Settings.SkipTxtColor;
                break;

            case NoteType.Trophy:
                bgColor  = Settings.TrophyBgColor;
                txtColor = Settings.TrophyTxtColor;
                break;

            default:
                bgColor  = Settings.BackgroundColor;
                txtColor = Color.White;
                break;
            }
        }