public void OnGUI()
        {
            //windowScrollPos = EditorGUILayout.BeginScrollView(windowScrollPos);
            Skin.StartSection("Log Entry", false);
            if (GUILayout.Button("New Entry"))
            {
                isNewEntry           = true;
                windowScrollPos      = Vector2.zero;
                shortText            = "";
                status               = DevLogEntry.Status.Idea;
                detailScrollPosition = Vector2.zero;
                detailText           = "";
                assets               = new List <Object>();
                isSocial             = false;
                gitCommit            = "";
                newMetaDataItem      = "";
            }

            LogEntryGUI();
            Skin.EndSection();

            Skin.StartSection("Assets", false);
            AssetsDataGUI();
            Skin.EndSection();

            Skin.StartSection("Meta Data", false);
            MetaDataGUI();
            Skin.EndSection();
            //EditorGUILayout.EndScrollView();
        }
        internal void EditEntry(DevLogEntry entry)
        {
            isNewEntry           = false;
            windowScrollPos      = Vector2.zero;
            status               = entry.status;
            detailScrollPosition = Vector2.zero;
            shortText            = entry.shortDescription;
            detailText           = entry.longDescription;
            assets               = entry.assets;
            isSocial             = entry.isSocial;
            gitCommit            = entry.commitHash;

            MetaDataItems items = EntryPanelSettings.GetSuggestedMetaDataItems();

            for (int i = 0; i < items.Count; i++)
            {
                if (devLogWindow.currentEntry.metaData.Contains(items.GetItem(i).name))
                {
                    items.GetItem(i).IsSelected = true;
                }
            }

            List <string> mediaFilePaths = new List <string>();

            for (int i = 0; i < ScreenCaptures.Count; i++)
            {
                DevLogScreenCapture capture = ScreenCaptures.captures[i];
                if (devLogWindow.currentEntry.captures.Contains(capture))
                {
                    ScreenCaptures.captures[i].IsSelected = true;
                }
            }
        }
Exemple #3
0
        public DevLogList(DevLogEntries elements, DevLogEntry.Status status)
            : base(elements.GetEntries(status), typeof(DevLogEntry), true, true, true, true)
        {
            allEntries = elements;

            validEntries = elements.GetEntries(status);
            this.list    = elements.GetEntries(status);

            title = status.ToString();
        }
Exemple #4
0
        private void LogEntryGUI()
        {
            status = (DevLogEntry.Status)EditorGUILayout.EnumPopup("Status", status, GUILayout.Height(35));

            EditorStyles.textField.wordWrap = true;
            EditorGUILayout.LabelField(EntryPanelSettings.guiShortTextLabel);
            shortText = EditorGUILayout.TextArea(shortText, GUILayout.Height(35));

            EditorGUILayout.LabelField("Long Entry (optional)");
            detailScrollPosition = GUILayout.BeginScrollView(detailScrollPosition);
            detailText           = EditorGUILayout.TextArea(detailText, GUILayout.ExpandHeight(true));
            GUILayout.EndScrollView();
        }
Exemple #5
0
        private DevLogList ConfigureList(DevLogEntry.Status status)
        {
            DevLogList list = new DevLogList(entries, status);

            list.drawElementCallback   = list.DrawLogListElement;
            list.drawHeaderCallback    = list.DrawHeader;
            list.elementHeightCallback = list.ElementHeightCallback;
            list.onReorderCallback     = list.SaveReorderedList;
            list.onSelectCallback      = list.OnSelect;
            list.displayAdd            = false;

            return(list);
        }
        public DevLogList(DevLogEntries elements, DevLogEntry.Status status)
            : base(elements.GetEntries(status), typeof(DevLogEntry), true, true, true, true)
        {
            allEntries = elements;

            validEntries = elements.GetEntries(status);
            this.list    = elements.GetEntries(status);

            title = status.ToString();

            drawElementCallback   = DrawLogListElement;
            drawHeaderCallback    = DrawHeader;
            elementHeightCallback = ElementHeightCallback;
            onReorderCallback     = SaveReorderedList;
            onSelectCallback      = OnSelect;
            displayAdd            = false;
            onChangedCallback     = SaveReorderedList;

            devLoggerWindow = EditorWindow.GetWindow(typeof(DevLoggerWindow)) as DevLoggerWindow;
        }
 /// <summary>
 /// Get all the elements in this set of entries that are of a specified status.
 /// </summary>
 /// <param name="status">The status we want to retrieve.</param>
 /// <returns>A list of entries with the given status</returns>
 internal List <DevLogEntry> GetEntries(DevLogEntry.Status status)
 {
     return((List <DevLogEntry>)Enumerable.ToList(m_Entries.Where(l => l.status == status)));
 }
Exemple #8
0
        internal void DrawLogListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            DevLogEntry entry = validEntries[index];

            Rect labelRect = new Rect(rect.x, rect.y, listLabelWidth, EditorGUIUtility.singleLineHeight);
            Rect fieldRect = new Rect(labelRect.x, labelRect.y, rect.width, EditorGUIUtility.singleLineHeight);

            DevLogEntry.Status originalStatus = entry.status;
            entry.status = (DevLogEntry.Status)EditorGUI.EnumPopup(fieldRect, entry.status);
            if (originalStatus != entry.status)
            {
                isDirty = true;
            }

            labelRect = new Rect(labelRect.x, labelRect.y + EditorGUIUtility.singleLineHeight, labelRect.width, labelRect.height);
            EditorGUI.PrefixLabel(labelRect, new GUIContent("Title"));
            fieldRect = new Rect(fieldRect.x + listLabelWidth, labelRect.y, fieldRect.width - listLabelWidth, labelRect.height);
            entry.shortDescription = EditorGUI.TextField(fieldRect, entry.shortDescription);

            labelRect = new Rect(labelRect.x, labelRect.y + EditorGUIUtility.singleLineHeight, labelRect.width, labelRect.height);
            EditorGUI.PrefixLabel(labelRect, new GUIContent("Description"));
            fieldRect             = new Rect(fieldRect.x, labelRect.y, fieldRect.width, EditorGUIUtility.singleLineHeight * listDescriptionLines);
            entry.longDescription = EditorGUI.TextArea(fieldRect, entry.longDescription);

            labelRect = new Rect(labelRect.x, labelRect.y + EditorGUIUtility.singleLineHeight * listDescriptionLines, labelRect.width, labelRect.height);
            EditorGUI.PrefixLabel(labelRect, new GUIContent("Created"));
            fieldRect = new Rect(fieldRect.x, labelRect.y, fieldRect.width, labelRect.height);
            EditorGUI.LabelField(fieldRect, entry.created.ToString("dd MMM yyyy"));

            labelRect = new Rect(labelRect.x, labelRect.y + EditorGUIUtility.singleLineHeight, labelRect.width, labelRect.height);
            if (validEntries[index].metaData.Count != 0)
            {
                EditorGUI.PrefixLabel(labelRect, new GUIContent("Meta Data"));
                for (int i = 0; i < entry.metaData.Count; i++)
                {
                    fieldRect         = new Rect(fieldRect.x, labelRect.y + EditorGUIUtility.singleLineHeight * i, fieldRect.width, EditorGUIUtility.singleLineHeight);
                    entry.metaData[i] = EditorGUI.TextField(fieldRect, entry.metaData[i]);
                }
            }

            labelRect = new Rect(labelRect.x, labelRect.y + EditorGUIUtility.singleLineHeight * validEntries[index].metaData.Count, labelRect.width, labelRect.height);
            if (validEntries[index].captures.Count != 0)
            {
                EditorGUI.PrefixLabel(labelRect, new GUIContent("Captures"));
                for (int i = 0; i < entry.captures.Count; i++)
                {
                    fieldRect = new Rect(fieldRect.x, labelRect.y + EditorGUIUtility.singleLineHeight * i, fieldRect.width, EditorGUIUtility.singleLineHeight);
                    EditorGUI.ObjectField(fieldRect, entry.captures[i], typeof(ScreenCapture), false);
                }
            }

            labelRect = new Rect(labelRect.x, labelRect.y + EditorGUIUtility.singleLineHeight * validEntries[index].captures.Count, labelRect.width, labelRect.height);
            EditorGUI.PrefixLabel(labelRect, new GUIContent("Commit"));
            fieldRect = new Rect(fieldRect.x, labelRect.y, fieldRect.width, EditorGUIUtility.singleLineHeight);
            EditorGUI.TextArea(fieldRect, entry.commitHash);

            labelRect = new Rect(labelRect.x, labelRect.y + EditorGUIUtility.singleLineHeight, labelRect.width, labelRect.height);
            EditorGUI.PrefixLabel(labelRect, new GUIContent("Social?"));
            fieldRect      = new Rect(fieldRect.x, labelRect.y, fieldRect.width, EditorGUIUtility.singleLineHeight);
            entry.isSocial = EditorGUI.Toggle(fieldRect, entry.isSocial);

            labelRect = new Rect(labelRect.x, labelRect.y + EditorGUIUtility.singleLineHeight, labelRect.width, labelRect.height);
            EditorGUI.PrefixLabel(labelRect, new GUIContent("Tweeted?"));
            fieldRect = new Rect(fieldRect.x, labelRect.y, fieldRect.width, EditorGUIUtility.singleLineHeight);
            EditorGUI.Toggle(fieldRect, entry.tweeted);
            if (entry.tweeted)
            {
                Rect timeRect = new Rect(fieldRect.x + 20, fieldRect.y, fieldRect.width - 50, fieldRect.height);
                EditorGUI.LabelField(timeRect, " most recent " + entry.lastTweetPrettyTime);
            }

            labelRect = new Rect(labelRect.x, labelRect.y + EditorGUIUtility.singleLineHeight, labelRect.width, labelRect.height);
            EditorGUI.PrefixLabel(labelRect, new GUIContent("Discord?"));
            fieldRect = new Rect(fieldRect.x, labelRect.y, fieldRect.width, EditorGUIUtility.singleLineHeight);
            EditorGUI.Toggle(fieldRect, entry.discordPost);
            if (entry.discordPost)
            {
                Rect timeRect = new Rect(fieldRect.x + 20, fieldRect.y, fieldRect.width - 50, fieldRect.height);
                EditorGUI.LabelField(timeRect, "most recent" + entry.lastDiscordPostPrettyTime);
            }
        }
        private DevLogList ConfigureList(DevLogEntry.Status status)
        {
            DevLogList list = new DevLogList(entries, status);

            return(list);
        }