Esempio n. 1
0
        public override void OnInspectorGUIClickedSaveButton()
        {
            base.OnInspectorGUIClickedSaveButton();

            MonsterTestList.SaveMonsterTestList();

            Owner.RebuildList();
        }
Esempio n. 2
0
        public virtual string DrawTestDropdown(string CurrentTestName)
        {
            List <string> TestNames = new List <string>();

            if (MonsterTestList.GetInstance() != null)
            {
                for (int CurrentIndex = 0; CurrentIndex < MonsterTestList.GetInstance().EditorGetListCount(); ++CurrentIndex)
                {
                    MonsterTest CurrentValue = MonsterTestList.GetInstance().EditorGetValueAtIndex(CurrentIndex);

                    if (CurrentValue != null)
                    {
                        TestNames.Add(CurrentValue.GetFilename());
                    }
                }
            }

            TestNames.Add("Create new test");

            int CurrentTestIndex = TestNames.IndexOf(CurrentTestName);

            if (CurrentTestIndex == -1)
            {
                CurrentTestIndex = 0;
            }

            int NewTestIndex = EditorGUILayout.Popup("Test to run", CurrentTestIndex, TestNames.ToArray());

            bool bCreatedNew = false;

            if (NewTestIndex != CurrentTestIndex || TestNames.Count == 1)
            {
                if (NewTestIndex == (TestNames.Count - 1))
                {
                    if (TestNames.Count > 1 || MonsterTestListWindow.GetInstance() == null)
                    {
                        MonsterTestListWindow.Init();
                    }

                    bCreatedNew = true;
                }

                CurrentTestIndex = NewTestIndex;
            }

            if (!bCreatedNew)
            {
                CurrentTestName = TestNames[CurrentTestIndex];
            }

            return(CurrentTestName);
        }
Esempio n. 3
0
        public static MonsterTest CreateNewMonsterTest()
        {
            MonsterTest NewTest = new MonsterTest();

            NewTest.CreateStaticNodesIfNotPresent();

            NewTest.LoadTestStates();
            NewTest.EditorSetFilename(MonsterTestListWindow.NewTestName);
            NewTest.EditorSaveMonsterTest();

            MonsterTestWindow.CurrentlyOpenTest = NewTest;
            MonsterTestWindow.Init();

            MonsterTestList.EditorMoveTestToMainList(NewTest);

            return(NewTest);
        }
Esempio n. 4
0
        protected override ListItem <MonsterTest> CreateNewItem(int IndexToWatch)
        {
            if (IndexToWatch == -1)
            {
                MonsterTest NewTest = MonsterTestItem.CreateNewMonsterTest();

                string CompareString = NewTest.GetFilename();

                IndexToWatch = GetManager().EditorHasCompareString(CompareString);

                MonsterTestList.SaveMonsterTestList();

                RebuildList();
            }

            return(new MonsterTestItem(this, IndexToWatch));
        }
Esempio n. 5
0
 public static void EditorMoveTestToMainList(MonsterTest NewTest)
 {
     MonsterTestList.GetInstance().EditorInternalMoveTestToMainList(NewTest);
 }
Esempio n. 6
0
 public static void EditorAddMonsterTest(MonsterTest NewTest)
 {
     MonsterTestList.GetInstance().EditorInternalAddTest(NewTest);
 }
Esempio n. 7
0
 public static void EditorRemoveMonsterTests(string CompareName)
 {
     MonsterTestList.GetInstance().EditorInternalRemoveTest(CompareName);
 }
Esempio n. 8
0
 public static MonsterTest GetMonsterTestForID(string TestName)
 {
     return(MonsterTestList.GetInstance().InternalGetTestForID(TestName));
 }
Esempio n. 9
0
        public static void LoadMonsterTestList()
        {
            MonsterTestList.ManagerInst = new MonsterTestList();

            SerializeFromXML <MonsterTestList>(GetManagerFilename(), ref MonsterTestList.ManagerInst, false);
        }
Esempio n. 10
0
 public static string EditorGetUniqueID(string NewName)
 {
     return(MonsterTestList.GetInstance().EditorInternalGetUniqueID(NewName));
 }
Esempio n. 11
0
 public override ManagerList <MonsterTest> GetManager()
 {
     return(MonsterTestList.GetInstance());
 }
Esempio n. 12
0
        protected override void RemoveItemWithCompareString(string CompareString)
        {
            MonsterTestList.EditorRemoveMonsterTests(CompareString);

            MonsterTestList.SaveMonsterTestList();
        }