/// <summary> /// /// </summary> void DrawHistory() { if (Notes == null) { return; } DrawWindowArea(); historyScroll = GUILayout.BeginScrollView(historyScroll, "box"); bool bg = false; for (int i = Notes.HistoryNotes.Count - 1; i >= 0; i--) { bl_DevNotesInfo.Info note = Notes.HistoryNotes[i]; Rect r = EditorGUILayout.BeginHorizontal(); Rect sr = r; if (bg) { DrawWhiteBox(r, new Color(0, 0, 0, 0.2f)); } if (note.noteType == bl_DevNotesInfo.NoteType.Note) { sr.width = 3; Color c = Notes.AllCategorys[note.CategoryID].Color; DrawWhiteBox(sr, c); GUILayout.Space(4); sr = GUILayoutUtility.GetRect(60, EditorGUIUtility.singleLineHeight); DrawWhiteBox(sr, new Color(0, 0, 0, 0.3f)); EditorGUI.LabelField(sr, Notes.AllCategorys[note.CategoryID].Name); EditorGUILayout.LabelField(note.Note, miniLabelStyle); GUILayout.FlexibleSpace(); if (!string.IsNullOrEmpty(note.CompleteDate)) { var cDate = DateTime.Parse(note.CompleteDate, cultureInfo); string timeRelative = bl_DevNotesUtils.GetRelativeTimeName(cDate); EditorGUILayout.LabelField($"<size=8><i>{timeRelative}</i></size>", miniLabelStyle); } } else if (note.noteType == bl_DevNotesInfo.NoteType.Separator) { Rect lr = GUILayoutUtility.GetRect(position.width - 60, 15); lr.height = 1; lr.y += 9; DrawWhiteBox(lr, new Color(1, 1, 1, 0.5f)); } if (GUILayout.Button(new GUIContent(icons[0]), EditorStyles.label, GUILayout.Width(20))) { Notes.HistoryNotes.RemoveAt(i); SaveNotes(); } EditorGUILayout.EndHorizontal(); GUILayout.Space(2); bg = !bg; } GUILayout.EndScrollView(); GUILayout.EndArea(); }
void AddHistorySeparator() { bl_DevNotesInfo.Info info = new bl_DevNotesInfo.Info(); info.CategoryID = 0; info.Note = "--"; info.noteType = bl_DevNotesInfo.NoteType.Separator; Notes.HistoryNotes.Add(info); SaveNotes(); }
/// <summary> /// /// </summary> void AddNewJob() { if (Notes == null) { Notes = new bl_DevNotesInfo(); } bl_DevNotesInfo.Info info = new bl_DevNotesInfo.Info(); info.CategoryID = AddCat; info.Note = AddNote; info.Comment = AddComment; info.noteType = bl_DevNotesInfo.NoteType.Note; info.CreateDate = GetTodayDateAsString(); Notes.Notes.Add(info); SaveNotes(); showAddBox = false; AddComment = string.Empty; AddNote = string.Empty; Repaint(); }
void MoveField(int index, bool up) { if (up) { bl_DevNotesInfo.Info info = new bl_DevNotesInfo.Info(); info.CategoryID = Notes.Notes[index].CategoryID; info.Note = Notes.Notes[index].Note; Notes.Notes.RemoveAt(index); Notes.Notes.Insert(index - 1, info); } else { bl_DevNotesInfo.Info info = new bl_DevNotesInfo.Info(); info.CategoryID = Notes.Notes[index].CategoryID; info.Note = Notes.Notes[index].Note; Notes.Notes.RemoveAt(index); Notes.Notes.Insert(index + 1, info); } SaveNotes(); }