Ejemplo n.º 1
0
        static public void ReloadTestFromFile()
        {
            if (WindowInstance != null)
            {
                WindowInstance.ClearAllBoxesAndLinks();

                if (CurrentlyOpenTest != null)
                {
                    MonsterTestManager.SwapActiveMonsterTestManager(CurrentlyOpenTest);
                }

                MonsterTestManager.LoadTest();

                WindowInstance.PreInit();

                List <MonsterTestBase> AllTestStates = MonsterTestManager.EditorGetTestStateList();

                foreach (MonsterTestBase CurrentTestState in AllTestStates)
                {
                    MonsterTestBaseBox NewBox = (MonsterTestBaseBox)TypeUtils.GetEditorBoxForTypeString(CurrentTestState.GetEntityName(), WindowInstance, CurrentTestState);
                    WindowInstance.AddBox(NewBox);
                }

                WindowInstance.PostInit();
            }
        }
Ejemplo n.º 2
0
        static public void SaveTestStateList()
        {
            MonsterTestManager.GetActiveInstance().SaveEntities();

            if (CurrentlyOpenTest != null)
            {
                CurrentlyOpenTest.EditorSaveMonsterTest();
            }

            MonsterTestWindow.GetInstance().SerializeBoxMetadata(true);
        }
Ejemplo n.º 3
0
        public virtual MonsterTestBaseBox SetupNewBox(string EntityTypeName, MonsterTestState NewEntity)
        {
            MonsterTestManager.AddTestState(NewEntity);

            MonsterTestBaseBox NewBox = (MonsterTestBaseBox)TypeUtils.GetEditorBoxForTypeString(EntityTypeName, MonsterTestWindow.WindowInstance, NewEntity);

            NewBox.InitializeNewBox();

            NewBox.MoveBoxTo(InputState.GetLocalMousePosition(this, -GetWindowOffset()));

            MonsterTestWindow.WindowInstance.AddBox(NewBox);

            return(NewBox);
        }
Ejemplo n.º 4
0
        public static MonsterTestManager SwapActiveMonsterTestManager(MonsterTest NewTest)
        {
            if (Instance != null)
            {
                Instance.UnloadTests();
            }

            Instance = new MonsterTestManager();

            EntityListFilename = NewTest.GetTestStateListFilename();
            Owner = NewTest;

            XMLSerializable.SerializeFromXML <MonsterTestManager>(NewTest.GetTestStateListFilename(), ref Instance, false);

            return(Instance);
        }
Ejemplo n.º 5
0
        public override void SetModifiedState(ModifiedState NewState, string VariableName)
        {
            if (NewState == ModifiedState.PreModify)
            {
            }

            base.SetModifiedState(NewState, VariableName);

            if (NewState == ModifiedState.Modified)
            {
                if (MonsterTestManager.GetActiveInstance() != null)
                {
                    MonsterTestManager.GetActiveInstance().SaveEntities();
                }
            }
        }
Ejemplo n.º 6
0
 public static void Log(string Message)
 {
     if (MonsterTestCore.MonsterTestCoreInst != null && MonsterTestManager.GetActiveInstance() != null)
     {
         if (IgorDebug.Logger != null)
         {
             IgorDebug.Logger.Log(MonsterTestCore.MonsterTestCoreInst, " - " + MonsterTestManager.GetActiveInstance().GetOwnerFilename() + Message);
         }
         else
         {
             Debug.Log("Igor Log: " + MonsterTestCore.MonsterTestCoreInst + " - " + MonsterTestManager.GetActiveInstance().GetOwnerFilename() + " : " + Message);
         }
     }
     else
     {
         CoreLog(Message);
     }
 }
Ejemplo n.º 7
0
        static public void FullGraphRefreshFromCurrentData()
        {
            if (WindowInstance != null)
            {
                WindowInstance.ClearAllBoxesAndLinks();

                WindowInstance.PreInit();

                List <MonsterTestBase> AllTestStates = MonsterTestManager.EditorGetTestStateList();

                foreach (MonsterTestBase CurrentTestState in AllTestStates)
                {
                    MonsterTestBaseBox NewBox = (MonsterTestBaseBox)TypeUtils.GetEditorBoxForTypeString(CurrentTestState.GetEntityName(), WindowInstance, CurrentTestState);
                    WindowInstance.AddBox(NewBox);
                }

                WindowInstance.PostInit();
            }
        }
Ejemplo n.º 8
0
        public static void CriticalError(string Message)
        {
            if (MonsterTestCore.MonsterTestCoreInst != null && MonsterTestManager.GetActiveInstance() != null)
            {
                if (IgorDebug.Logger != null)
                {
                    IgorDebug.Logger.CriticalError(MonsterTestCore.MonsterTestCoreInst, " - " + MonsterTestManager.GetActiveInstance().GetOwnerFilename() + Message);
                }
                else
                {
                    Debug.LogError("Igor Error: " + MonsterTestCore.MonsterTestCoreInst + " - " + MonsterTestManager.GetActiveInstance().GetOwnerFilename() + " : " + Message);

                    throw new UnityException(MonsterTestCore.MonsterTestCoreInst + " - " + MonsterTestManager.GetActiveInstance().GetOwnerFilename() + " : " + Message);
                }
            }
            else
            {
                CoreLog(Message);
            }
        }
Ejemplo n.º 9
0
 public override void SaveEntities()
 {
     MonsterTestManager.SaveTest();
 }
Ejemplo n.º 10
0
 public override void RemoveEntity()
 {
     MonsterTestManager.RemoveTestState(MonsterTestBaseInst);
 }
Ejemplo n.º 11
0
 public static void AddTestState(MonsterTestBase NewTestState)
 {
     MonsterTestManager.GetActiveInstance().AddEntity(NewTestState);
 }
Ejemplo n.º 12
0
 public override string GetUniqueFilename(string OriginalFilename)
 {
     return(MonsterTestManager.EditorGetUniqueTestStateFilename(OriginalFilename));
 }
Ejemplo n.º 13
0
 public static List <MonsterTestBase> EditorGetTestStateList()
 {
     return(MonsterTestManager.GetActiveInstance().Entities);
 }
Ejemplo n.º 14
0
 public static void RemoveTestState(MonsterTestBase TestStateToRemove)
 {
     MonsterTestManager.GetActiveInstance().RemoveEntity(TestStateToRemove);
 }
Ejemplo n.º 15
0
/*	public virtual void AddLine()
 *      {
 *              Line NewLine = new Line();
 *
 *              SetupNewLineBox(NewLine);
 *      }
 *
 *      public virtual void ConnectLine()
 *      {
 *              Line NewLine = new Line();
 *
 *              NewLine.CreateStaticNodesIfNotPresent();
 *
 *              LineBox NewBox = SetupNewLineBox(NewLine);
 *
 *              if(NewBox.GetAllAnchors().Count > 0)
 *              {
 *                      Anchor<ConversationBase> NewBoxAnchor = NewBox.GetAllAnchors()[0];
 *
 *                      ConnectInputToOutput(NewBoxAnchor, StartingAnchorForNewBox);
 *              }
 *      }
 *
 *      public virtual LineBox SetupNewLineBox(Line NewLine)
 *      {
 *              ConversationManager.AddConversation(NewLine);
 *
 *              LineBox NewBox = new LineBox(ConversationWindow.WindowInstance, NewLine);
 *
 *              NewBox.InitializeNewBox();
 *
 *              NewBox.MoveBoxTo(InputState.GetLocalMousePosition(this, -GetWindowOffset()));
 *
 *              ConversationWindow.WindowInstance.AddBox(NewBox);
 *
 *              return NewBox;
 *      }*/

        public override string GetBoxMetadataFile()
        {
            return(MonsterTestCore.MonsterLocalDirectoryRoot + "/Config/Editor/MonsterTests/MonsterTestBoxes" + MonsterTestManager.GetActiveInstance().GetOwnerFilename() + ".xml");
        }
Ejemplo n.º 16
0
 public override void SaveRequested()
 {
     MonsterTestManager.SaveTest();
 }
Ejemplo n.º 17
0
 public override void CreateStaticNodesIfNotPresent()
 {
     MonsterTestManager.GetActiveInstance().CreateStaticNodesIfNotPresent();
 }
Ejemplo n.º 18
0
 public static string EditorGetUniqueTestStateFilename(string OriginalFilename)
 {
     return(MonsterTestManager.GetActiveInstance().EditorGetUniqueEntityFilename(OriginalFilename));
 }
Ejemplo n.º 19
0
 public static void SaveTest()
 {
     MonsterTestManager.GetActiveInstance().SaveEntities();
 }
Ejemplo n.º 20
0
 public override LinkedEntityManager <MonsterTestBase> GetManager()
 {
     return(MonsterTestManager.GetActiveInstance());
 }
Ejemplo n.º 21
0
 public override MonsterTestBase GetLinkedEntityForFilename(string Filename)
 {
     return(MonsterTestManager.GetActiveInstance().GetEntityByFileName(Filename));
 }
Ejemplo n.º 22
0
 public virtual void UnloadTests()
 {
     Instance = null;
 }
Ejemplo n.º 23
0
 public static void LoadTest()
 {
     MonsterTestManager.GetActiveInstance().LoadEntities();
 }
Ejemplo n.º 24
0
        public override void OnInspectorGUIClickedSaveButton()
        {
            MonsterTestManager.SaveTest();

            Owner.SerializeBoxMetadata(true);
        }
Ejemplo n.º 25
0
 public virtual void LoadTestStates()
 {
     TestStates = MonsterTestManager.SwapActiveMonsterTestManager(this);
 }