예제 #1
0
        public override void Draw(int aID)
        {
            var variables = Controller.Instance.VarFlagSummary.getVars();

            Available = variables != null && variables.Length > 0;

            var windowHeight = Rect.height;

            GUILayout.Label(TC.get("Analytics.GameStart") + Controller.Instance.SelectedChapterDataControl.getInitialScene());
            GUILayout.Label(TC.get("Analytics.GameEnd"));

            end = EditorGUILayout.Popup(end, endOptions);

            GUILayout.Label(TC.get("Analytics.GameProgress"));

            progress = EditorGUILayout.Popup(progress, progressOptions);

            if (progress == 1)
            {
                GUILayout.Button(TC.get("Analytics.EditProgress"));
            }

            completables = Controller.Instance.SelectedChapterDataControl.getCompletables();
            completablesList.SetData(completables, (c) => (c as CompletableListDataControl).getCompletables().Cast <DataControl>().ToList());
            completablesList.DoList(windowHeight - 150);
        }
예제 #2
0
            protected override void DrawInspector()
            {
                var scenesListDataControl = Controller.Instance.ChapterList.getSelectedChapterDataControl().getScenesList();

                sceneList.SetData(scenesListDataControl, data => (data as ScenesListDataControl).getScenes().Cast <DataControl>().ToList());

                sceneList.DoList(160);
            }
예제 #3
0
        public override void Draw(int aID)
        {
            var windowWidth  = m_Rect.width;
            var windowHeight = m_Rect.height;

            macroList.SetData(Controller.Instance.SelectedChapterDataControl.getMacrosListDataControl(),
                              (data) => (data as MacroListDataControl).getMacros().Cast <DataControl>().ToList());
            macroList.DoList(windowHeight - 60f);
        }
예제 #4
0
        protected void OnGUI()
        {
            if (score.getMethod() == Completable.Score.ScoreMethod.SINGLE)
            {
                EditorGUILayout.HelpBox("The score subscores you're trying to edit is in SINGLE mode. Select the SUM or AVERAGE modes to edit its subscores.", MessageType.Error);
                return;
            }

            scoresList.SetData(score, s => (s as ScoreDataControl).getScores().Cast <DataControl>().ToList());
            scoresList.DoList(position.height - 15);
        }
예제 #5
0
        public void draw()
        {
            using (new GUILayout.VerticalScope())
            {
                EditorGUILayout.HelpBox(TC.get("ConversationEditor.AtLeastOne"), MessageType.None);

                var min = linesList.headerHeight + linesList.footerHeight + linesList.elementHeight + 5;
                linesList.DoList(Mathf.Max(min, Mathf.Min(200, linesList.elementHeight * (linesList.count - 1) + min)));

                EditorGUILayout.HelpBox(TC.get("ConversationEditor.NodeOption"), MessageType.None);

                using (new GUILayout.HorizontalScope())
                {
                    using (new EditorGUI.DisabledGroupScope(myNode.getChildCount() > 0 || myNode.getAddableNodes().Length == 0))
                    {
                        if (GUILayout.Button(TC.get("ConversationEditor.CreateChild")))
                        {
                            var options = new List <GUIContent>();
                            foreach (var addable in Node.getAddableNodes())
                            {
                                options.Add(new GUIContent("Create " + TC.get("Element.Name" + addable)));
                            }

                            EditorUtility.DisplayCustomMenu(new Rect(Event.current.mousePosition, Vector2.one), options.ToArray(), -1, (param, ops, selected) =>
                            {
                                var option = Node.getAddableNodes()[selected];
                                parent.Content.addNode(myNode, option);
                            }, Event.current.mousePosition);
                        }
                    }

                    if (GUILayout.Button(TC.get("ConversationEditor.SetChild")))
                    {
                        parent.StartSetChild(this.myNode, 0);
                    }

                    var hasEffects = myNode.getEffects().getEffects().Count > 0;
                    if (GUILayout.Button(hasEffects ? effectTex : noEffectTex, noBackgroundSkin.button, GUILayout.Width(24), GUILayout.Height(24)))
                    {
                        EffectEditorWindow window = (EffectEditorWindow)ScriptableObject.CreateInstance(typeof(EffectEditorWindow));
                        window.Init(myNode.getEffects());
                    }
                }
            }
        }
예제 #6
0
        public void OnGUI()
        {
            GUILayout.Label("Analytics.Milestone.Progress".Traslate());

            EditorGUI.BeginChangeCheck();
            var newProgressType =
                (Completable.Progress.ProgressType)EditorGUILayout.Popup((int)progress.getType(),
                                                                         milestoneTypeTexts.Traslate());

            if (EditorGUI.EndChangeCheck())
            {
                progress.setType(newProgressType);
            }

            if (progress.getType() != currentMode)
            {
                currentMode = progress.getType();
                switch (currentMode)
                {
                default:     // ProgressType.SUM:
                    if (progressList.Columns.Contains(progressColumn))
                    {
                        progressList.Columns.Remove(progressColumn);
                    }
                    break;

                case Completable.Progress.ProgressType.SPECIFIC:
                    if (!progressList.Columns.Contains(progressColumn))
                    {
                        progressList.Columns.Add(progressColumn);
                    }
                    break;
                }
            }

            progressList.SetData(progress, (p) =>
            {
                var progressDataControl = p as ProgressDataControl;
                return(progressDataControl == null ? new List <DataControl>() : progressDataControl.getMilestones().ConvertAll(m => m as DataControl));
            });
            progressList.DoList(position.height - 55);
        }
 protected override void DrawInspector()
 {
     barriersList.DoList(160);
     GUILayout.Space(20);
 }
 protected override void DrawInspector()
 {
     bookContentsList.DoList(240);
 }
        public override void Draw(int aID)
        {
            var workingTimerList = Controller.Instance.SelectedChapterDataControl.getTimersList();

            timerList.SetData(workingTimerList, (data) => (data as TimersListDataControl).getTimers().Cast <DataControl>().ToList());
            timerList.DoList(220);

            using (new EditorGUI.DisabledScope(timerList.index < 0 || timerList.index >= workingTimerList.getTimers().Count))
            {
                var workingTimer = timerList.index >= 0 ? workingTimerList.getTimers()[timerList.index] : new TimerDataControl(new Timer());

                // ################
                // ### Time section
                // ################

                EditorGUI.BeginChangeCheck();
                var showTime = EditorGUILayout.BeginToggleGroup(TC.get("TimersList.Display"), workingTimer.isShowTime());
                if (EditorGUI.EndChangeCheck())
                {
                    workingTimer.setShowTime(showTime);
                }
                {
                    EditorGUI.indentLevel++;

                    // Display name
                    EditorGUI.BeginChangeCheck();
                    var id = EditorGUILayout.TextField(TC.get("Item.Name"), workingTimer.getDisplayName());
                    if (EditorGUI.EndChangeCheck())
                    {
                        workingTimer.setDisplayName(id);
                    }

                    // CountDown
                    EditorGUI.BeginChangeCheck();
                    var countDown = EditorGUILayout.ToggleLeft(TC.get("Timer.CountDown"), workingTimer.isCountDown());
                    if (EditorGUI.EndChangeCheck())
                    {
                        workingTimer.setCountDown(countDown);
                    }

                    // Show when stopped
                    EditorGUI.BeginChangeCheck();
                    var shownWhenStopped = EditorGUILayout.ToggleLeft(TC.get("Timer.ShowWhenStopped"), workingTimer.isShowWhenStopped());
                    if (EditorGUI.EndChangeCheck())
                    {
                        workingTimer.setShowWhenStopped(shownWhenStopped);
                    }

                    EditorGUI.indentLevel--;
                }
                EditorGUILayout.EndToggleGroup();

                // ################
                // ### Loop Control
                // ################

                GUILayout.Label(TC.get("Timer.LoopControl"));
                {
                    EditorGUI.indentLevel++;

                    // Show when stopped
                    EditorGUI.BeginChangeCheck();
                    var multipleStarts = EditorGUILayout.ToggleLeft(TC.get("Timer.MultipleStarts"), workingTimer.isMultipleStarts());
                    if (EditorGUI.EndChangeCheck())
                    {
                        workingTimer.setMultipleStarts(multipleStarts);
                    }

                    EditorGUILayout.HelpBox(TC.get("Timer.MultipleStartsDesc"), MessageType.Info);

                    // Show when stopped
                    EditorGUI.BeginChangeCheck();
                    var runsInLoop = EditorGUILayout.ToggleLeft(TC.get("Timer.RunsInLoop"), workingTimer.isRunsInLoop());
                    if (EditorGUI.EndChangeCheck())
                    {
                        workingTimer.setRunsInLoop(runsInLoop);
                    }

                    EditorGUILayout.HelpBox(TC.get("Timer.RunsInLoopDesc"), MessageType.Info);

                    EditorGUI.indentLevel--;
                }

                // ################
                // ### Conditions
                // ################

                // Init conditions
                GUILayout.Label(TC.get("Timer.InitConditions"));
                {
                    EditorGUI.indentLevel++;

                    if (GUILayout.Button(TC.get("GeneralText.EditInitConditions")))
                    {
                        ConditionEditorWindow window = (ConditionEditorWindow)ScriptableObject.CreateInstance(typeof(ConditionEditorWindow));
                        window.Init(workingTimer.getInitConditions());
                    }

                    EditorGUI.indentLevel--;
                }

                // End conditions
                GUILayout.Label(TC.get("Timer.EndConditions"));
                {
                    EditorGUI.indentLevel++;

                    EditorGUI.BeginChangeCheck();
                    var usesEndCondition = EditorGUILayout.BeginToggleGroup(TC.get("Timer.UsesEndConditionShort"), workingTimer.isUsesEndCondition());
                    if (EditorGUI.EndChangeCheck())
                    {
                        workingTimer.setUsesEndCondition(usesEndCondition);
                    }

                    if (GUILayout.Button(TC.get("GeneralText.EditEndConditions")))
                    {
                        ConditionEditorWindow window = (ConditionEditorWindow)ScriptableObject.CreateInstance(typeof(ConditionEditorWindow));
                        window.Init(workingTimer.getEndConditions());
                    }

                    EditorGUILayout.EndToggleGroup();
                    EditorGUI.indentLevel--;
                }

                // ################
                // ### Effects
                // ################

                // Header
                GUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                GUILayout.Label(TC.get("Timer.Effects"));
                GUILayout.FlexibleSpace();
                GUILayout.Label(TC.get("Timer.PostEffects"));
                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();
                // Buttons
                GUILayout.BeginHorizontal();
                if (GUILayout.Button(TC.get("GeneralText.EditEffects")))
                {
                    EffectEditorWindow window =
                        (EffectEditorWindow)ScriptableObject.CreateInstance(typeof(EffectEditorWindow));
                    window.Init(workingTimer.getEffects());
                }
                if (GUILayout.Button(TC.get("GeneralText.EditPostEffects")))
                {
                    EffectEditorWindow window =
                        (EffectEditorWindow)ScriptableObject.CreateInstance(typeof(EffectEditorWindow));
                    window.Init(workingTimer.getPostEffects());
                }
                GUILayout.EndHorizontal();


                GUILayout.Label(TC.get("Timer.Documentation"));
                EditorGUI.BeginChangeCheck();
                var newDocumentation = GUILayout.TextArea(workingTimer.getDocumentation() ?? string.Empty, GUILayout.ExpandHeight(true));
                if (EditorGUI.EndChangeCheck())
                {
                    workingTimer.setDocumentation(newDocumentation);
                }
            }
        }
예제 #10
0
        public void draw()
        {
            using (new GUILayout.VerticalScope())
            {
                // Options configuration
                using (new GUILayout.HorizontalScope())
                {
                    // KeepShowing
                    questionContent.tooltip = TC.get("Conversation.KeepShowing");
                    EditorGUI.BeginChangeCheck();
                    var keepShowing = GUILayout.Toggle(myNode.KeepShowing, questionContent, "Button");
                    if (EditorGUI.EndChangeCheck())
                    {
                        myNode.KeepShowing = keepShowing;
                    }

                    // KeepShowing
                    shuffleContent.tooltip = TC.get("Conversation.OptionRandomly");
                    EditorGUI.BeginChangeCheck();
                    var random = GUILayout.Toggle(myNode.Random, shuffleContent, "Button");
                    if (EditorGUI.EndChangeCheck())
                    {
                        myNode.Random = random;
                    }

                    // Show User Option
                    answerContent.tooltip = TC.get("Conversation.ShowUserOption");
                    EditorGUI.BeginChangeCheck();
                    var showUserOption = GUILayout.Toggle(myNode.ShowUserOption, answerContent, "Button");
                    if (EditorGUI.EndChangeCheck())
                    {
                        myNode.ShowUserOption = showUserOption;
                    }
                }

                EditorGUILayout.HelpBox(TC.get("ConversationEditor.AtLeastOne"), MessageType.None);

                using (new GUILayout.HorizontalScope())
                {
                    GUILayout.Label("Question ID: ");
                    EditorGUI.BeginChangeCheck();
                    var newXApiQuestion = EditorGUILayout.TextField(myNode.getXApiQuestion());
                    if (EditorGUI.EndChangeCheck())
                    {
                        myNode.setXApiQuestion(newXApiQuestion);
                    }

                    if (myNode.getXApiQuestion() == "")
                    {
                        var lastRect = GUILayoutUtility.GetLastRect();
                        var guistyle = new GUIStyle(GUI.skin.label);
                        guistyle.normal.textColor = Color.gray;
                        GUI.Label(lastRect, " Required for analytics", guistyle);
                    }
                }

                var min = linesList.headerHeight + linesList.footerHeight + linesList.elementHeight + 5;
                linesList.DoList(Mathf.Max(min, Mathf.Min(150, linesList.elementHeight * (linesList.count - 1) + min)));

                // Timer
                using (new GUILayout.HorizontalScope())
                {
                    if (EditorGUILayout.Toggle("Timeout: ", myNode.Timeout >= 0))
                    {
                        myNode.Timeout = Mathf.Clamp(EditorGUILayout.FloatField(myNode.Timeout), 0.1f, float.MaxValue);
                        GUILayout.Space(5);
                        DoConditionsEditor(GUILayoutUtility.GetRect(15, 15), myNode.TimeoutConditions);
                        DoChildEditor(GUILayoutUtility.GetRect(15, 15), myNode.getChildCount() - 1);
                    }
                    else
                    {
                        myNode.Timeout = -1f;
                    }
                }

                using (new GUILayout.HorizontalScope())
                {
                    var hasEffects = myNode.getEffects().getEffects().Count > 0;
                    if (GUILayout.Button(hasEffects ? effectTex : noEffectTex, noBackgroundSkin.button, GUILayout.Width(24), GUILayout.Height(24)))
                    {
                        EffectEditorWindow window = (EffectEditorWindow)ScriptableObject.CreateInstance(typeof(EffectEditorWindow));
                        window.Init(myNode.getEffects());
                    }
                }
            }
        }
예제 #11
0
 public override void DrawMenu(Rect rect, GUIStyle style)
 {
     dataControlList.DoList(rect.height);
 }