void CreateTodoList()
 {
     todosList = new ReorderableList(inkFile.metaInfo.todos, typeof(string), false, false, false, false);
     todosList.elementHeight      = 18;
     todosList.drawHeaderCallback = (Rect rect) => {
         EditorGUI.LabelField(rect, "To do");
     };
     todosList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) => {
         Rect labelRect             = new Rect(rect.x, rect.y, rect.width - 80, rect.height);
         Rect buttonRect            = new Rect(labelRect.xMax, rect.y, 80, rect.height - 2);
         InkMetaFile.InkFileLog log = ((List <InkMetaFile.InkFileLog>)todosList.list)[index];
         string label = log.content;
         GUI.Label(labelRect, label);
         string openLabel = "Open" + (log.lineNumber == -1 ? "" : " (" + log.lineNumber + ")");
         if (GUI.Button(buttonRect, openLabel))
         {
             OpenInEditor(inkFile.filePath, log.lineNumber);
         }
     };
 }
Пример #2
0
        void CreateErrorList()
        {
            errorList = new ReorderableList(inkFile.metaInfo.errors, typeof(string), false, false, false, false);
            errorList.elementHeight       = 18;
            errorList.drawHeaderCallback  = (Rect rect) => { EditorGUI.LabelField(rect, new GUIContent(InkBrowserIcons.errorIcon), new GUIContent("Errors")); };
            errorList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
            {
                Rect labelRect             = new Rect(rect.x, rect.y, rect.width - 80, rect.height);
                Rect buttonRect            = new Rect(labelRect.xMax, rect.y, 80, rect.height - 2);
                InkMetaFile.InkFileLog log = ((List <InkMetaFile.InkFileLog>)errorList.list)[index];
                string label = log.content;
                GUI.Label(labelRect, label);
                string openLabel = "Open" + (log.lineNumber == -1 ? "" : " (" + log.lineNumber + ")");
                if (GUI.Button(buttonRect, openLabel))
                {
                    InternalEditorUtility.OpenFileAtLineExternal(inkFile.filePath, log.lineNumber);
//					AssetDatabase.OpenAsset(masterInkFile.inkFile, lineNumber);
                }
            };
        }