Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        protected override void OnTargetChanged()
        {
            if (Target != null || GameRources.GetInstance().selectedBookIndex >= 0)
            {
                var workingBook = Target as BookDataControl ?? Controller.Instance.SelectedChapterDataControl
                                  .getBooksList().getBooks()[GameRources.GetInstance().selectedBookIndex];

                bookDrawer.Book = workingBook.getContent() as Book;
                bookContentsList.SetData(workingBook.getBookParagraphsList(),
                                         (content) => content != null ? (content as BookParagraphsListDataControl).getBookParagraphs().Cast <DataControl>().ToList() : new List <DataControl>());
            }
            else
            {
                bookDrawer.Book = null;
                bookContentsList.SetData(null, _ => new List <DataControl>());
            }
        }
Exemplo n.º 4
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);
        }
 public override void OnSceneSelected(SceneDataControl scene)
 {
     base.OnSceneSelected(scene);
     if (scene == null)
     {
         return;
     }
     barriersList.SetData(scene.getBarriersList(),
                          (dc) => (dc as BarriersListDataControl).getBarriers().Cast <DataControl>().ToList());
 }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
 private void UpdateList()
 {
     linesList.SetData(myNode, (node) => (node as ConversationNodeDataControl).getLines().Cast <DataControl>().ToList());
 }
        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);
                }
            }
        }