예제 #1
0
        private void OnGUIDeferred(Event e)
        {
            using (var scrollViewScope = new EditorGUILayout.ScrollViewScope(_scrollVector))
            {
                _scrollVector = scrollViewScope.scrollPosition;

                foreach (var task in Ledger.Manifest.DeferredTasks)
                {
                    TaskMaster.DrawTask(task, e);
                }
            }
        }
예제 #2
0
 public EditTaskPopUp(Task task)
 {
     _task     = task;
     _tempTask = TaskMaster.Clone(task);
 }
예제 #3
0
        public override void OnGUI(Rect rect)
        {
            GUILayout.Space(6);
            EditorGUILayout.BeginVertical(Style.PopUp);
            GUI.backgroundColor = Color.white;

            EditorGUILayout.LabelField("Edit Task", EditorStyles.boldLabel);

            GUI.SetNextControlName("TaskString");
            _tempTask.Title = EditorGUILayout.TextField(string.Empty, _tempTask.Title);

            GUILayout.Space(8);

            EditorGUILayout.BeginHorizontal("Button");
            _tempTask.HasDetails = GUILayout.Toggle(_tempTask.HasDetails, "Add Details", Style.AlignCenter, GUILayout.Height(24));
            _tempTask.HasDetails = GUILayout.Toggle(_tempTask.HasDetails, string.Empty, Style.OnOffSwitch);
            EditorGUILayout.EndHorizontal();

            if (_tempTask.HasDetails)
            {
                _detailsHeight    = DETAILS_HEIGHT;
                _tempTask.Details = EditorGUILayout.TextArea(_tempTask.Details, Style.WordWrap, GUILayout.Height(58));
            }
            else
            {
                _detailsHeight = 0;
            }

            EditorGUILayout.BeginHorizontal("Button");
            _tempTask.IsColored = GUILayout.Toggle(_tempTask.IsColored, "Colorize", Style.AlignCenter, GUILayout.Height(24));
            _tempTask.IsColored = GUILayout.Toggle(_tempTask.IsColored, string.Empty, Style.OnOffSwitch);
            EditorGUILayout.EndHorizontal();

            if (_tempTask.IsColored)
            {
                _colorHeight        = COLOR_HEIGHT;
                _tempTask.DrawColor = EditorGUILayout.ColorField(_tempTask.DrawColor);
            }
            else
            {
                _colorHeight = 0;
            }

            GUILayout.Space(8);

            EditorGUILayout.BeginHorizontal();

            if (GUILayout.Button("Apply", GUILayout.Height(22)))
            {
                TaskMaster.Assimilate(_tempTask, _task);
                Ledger.Manifest.Save();
                editorWindow.Close();
            }

            if (GUILayout.Button("Cancel", GUILayout.Height(22)))
            {
                editorWindow.Close();
            }

            EditorGUILayout.EndHorizontal();
            GUILayout.Space(6);
            EditorGUILayout.EndVertical();
        }
        private void OnGUIOutstanding(Event e)
        {
            using (var scrollViewScope = new EditorGUILayout.ScrollViewScope(_scrollVector))
            {
                _scrollVector = scrollViewScope.scrollPosition;

                foreach (var task in Ledger.Manifest.OutstandingTasks)
                {
                    TaskMaster.DrawTask(task, e);
                }
            }

            GUI.backgroundColor = Style.DimColor;
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            GUI.backgroundColor = Style.ResetColor;
            GUILayout.Space(6);

            if (!DoAdd)
            {
                DoAdd = GUILayout.Toggle(DoAdd, Ikon.More, "Button", GUILayout.Height(26));
            }

            if (DoAdd)
            {
                EditorGUILayout.LabelField("Task*");
                GUI.backgroundColor = TaskAlertColor;
                TaskString          = EditorGUILayout.TextField(string.Empty, TaskString);
                GUI.backgroundColor = Style.ResetColor;

                GUILayout.Space(8);

                EditorGUILayout.BeginHorizontal("Button");
                DoDetails = GUILayout.Toggle(DoDetails, "Add Details", Style.AlignCenter, GUILayout.Height(24));
                DoDetails = GUILayout.Toggle(DoDetails, string.Empty, Style.OnOffSwitch);
                EditorGUILayout.EndHorizontal();


                if (DoDetails)
                {
                    DetailsString = EditorGUILayout.TextArea(DetailsString, Style.WordWrap, GUILayout.Height(58));
                }

                EditorGUILayout.BeginHorizontal("Button");
                DoColor = GUILayout.Toggle(DoColor, "Colorize", Style.AlignCenter, GUILayout.Height(24));
                DoColor = GUILayout.Toggle(DoColor, string.Empty, Style.OnOffSwitch);
                EditorGUILayout.EndHorizontal();


                if (DoColor)
                {
                    ColorizeColor = EditorGUILayout.ColorField(ColorizeColor);
                }

                GUILayout.Space(8);

                EditorGUILayout.BeginHorizontal();

                if (GUILayout.Button(Ikon.Add, GUILayout.Height(26)))
                {
                    Scribe.WriteTask();
                }

                if (GUILayout.Button(Ikon.Check, GUILayout.Height(26)))
                {
                    DoAdd = !Scribe.WriteTask();
                }

                if (GUILayout.Button(Ikon.Close, GUILayout.Height(26)))
                {
                    DoAdd = false;
                }

                EditorGUILayout.EndHorizontal();
            }

            GUILayout.Space(6);
            EditorGUILayout.EndVertical();

            GUILayout.FlexibleSpace();
        }