Exemple #1
0
        static void Main()
        {
            // Handle float edition in PropertyGrid
            //http://visualhint.com/blog/70/how-to-format-a-number-with-a-specific-cultureinfonumberformatinfo-in-the-propert
            System.Threading.Thread.CurrentThread.CurrentCulture   = new System.Globalization.CultureInfo("en-US");
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Core
            EditorCore.FillDefaultImageList();
            EditorCore.InitDefaultWindow();
            EditorCore.InitDefaultLists();

            EditorCore.VersionProject = "1.0.0";

            //......
            // Custom overrides should come here !
            //......

            // MainWindow
            EditorCore.MainWindow.Init();

            // Add the event handler for handling UI thread exceptions to the event.
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(WIN32.ShowCrashMessage);

            // Run
            Application.Run(EditorCore.MainWindow);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            EditorCore.FillDefaultImageList();
            EditorCore.InitDefaultLists();

            Project project = ResourcesHandler.CreateProjectInstance("TestProject");

            //Declare some actors
            Actor actorA = new Actor();

            actorA.ID   = "Actor01";
            actorA.Name = "Jim";
            project.AddActor(actorA);

            Actor actorB = new Actor();

            actorB.ID   = "Actor02";
            actorB.Name = "Bob";
            project.AddActor(actorB);

            //Dialogue is created in Window constructor
            Application.Run(new Window());
        }
Exemple #3
0
        static void Main()
        {
            // Handle float edition in PropertyGrid
            //http://visualhint.com/blog/70/how-to-format-a-number-with-a-specific-cultureinfonumberformatinfo-in-the-propert
            System.Threading.Thread.CurrentThread.CurrentCulture   = new System.Globalization.CultureInfo("en-US");
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Core
            EditorCore.FillDefaultImageList();
            EditorCore.InitDefaultWindow();
            EditorCore.InitDefaultLists();

            EditorCore.VersionProject = "1.0.0";

            //..............................................................
            // Here you can declare custom types, bindings and menus

            // Animations
            EditorCore.Animations.Add("Common", new List <string>()
            {
                "WaveHands", "CrossArms"
            });
            EditorCore.Animations.Add("Angry", new List <string>()
            {
                "Speak_01", "Speak_02"
            });

            // Additional lists items
            EditorCore.CustomLists["Builds"].Add("Dwarf", "Dwarf");

            // Bind Nodes Attributes
            EditorCore.BindAttribute(typeof(NodeConditionHasHonor), "ConditionHasHonor", "Has Honor");
            EditorCore.BindAttribute(typeof(NodeActionAddHonor), "ActionAddHonor", "Add Honor");

            // Delegate post-load project
            EditorCore.OnProjectLoad = delegate
            {
                //...
                // Here you can start additional processes like filling the loaded project/dialogues with some imported data
                //...
            };

            // Delegate to check custom errors
            EditorCore.OnCheckDialogueErrors = delegate(Dialogue dialogue)
            {
                //...
                // Here you can plug custom checks, using this kind of messages :
                //EditorCore.LogError(String.Format("{0} {1} - Sentence has no Speaker", dialogue.GetName(), node.ID), dialogue, node);
                //...
            };

            //..............................................................

            // MainWindow
            EditorCore.MainWindow.Init();

            // Add the event handler for handling UI thread exceptions to the event.
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(WIN32.ShowCrashMessage);

            // Run
            Application.Run(EditorCore.MainWindow);
        }
Exemple #4
0
        static void Main()
        {
            // Handle float edition in PropertyGrid
            //http://visualhint.com/blog/70/how-to-format-a-number-with-a-specific-cultureinfonumberformatinfo-in-the-propert
            System.Threading.Thread.CurrentThread.CurrentCulture   = new System.Globalization.CultureInfo("en-US");
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Core
            EditorCore.FillDefaultImageList();
            EditorCore.InitDefaultWindow();
            EditorCore.InitDefaultLists();

            Dictionary <string, string> dialogueChoicesToValues;

            if (!EditorCore.CustomLists.TryGetValue("DialogueChoices", out dialogueChoicesToValues))
            {
                EditorCore.CustomLists["DialogueChoices"] = dialogueChoicesToValues = new Dictionary <string, string>();
            }

            dialogueChoicesToValues["GuestItemsSelection"] = "Guest's Items Selection";
            dialogueChoicesToValues["CirceItemsSelection"] = "Circe's Items Selection";
            dialogueChoicesToValues["DialoguesSelection"]  = "Dialogues Selection";

            EditorCore.VersionProject = "1.0.0";

            //..............................................................
            // Here you can declare custom types, bindings and menus

            // Additional lists items
            EditorCore.CustomLists["Builds"].Add("Dwarf", "Dwarf");

            // Bind Nodes Attributes
            BindType <NodeConditionHasItemStack>();
            BindType <NodeConditionPOIHasState>();
            BindType <NodeConditionHasTag>();

            BindType <NodeActionItemStack>();
            BindType <NodeActionTag>();
            BindType <NodeActionLoadScene>();
            BindType <NodeActionSetPOIState>();
            BindType <NodeActionSetPOICurrentDialog>();

            // Delegate post-load project
            EditorCore.OnProjectLoad = delegate
            {
                //...
                // Here you can start additional processes like filling the loaded project/dialogues with some imported data
                //...
            };

            // Delegate to check custom errors
            EditorCore.OnCheckDialogueErrors = delegate(Dialogue dialogue)
            {
                //...
                // Here you can plug custom checks, using this kind of messages :
                //EditorCore.LogError(String.Format("{0} {1} - Sentence has no Speaker", dialogue.GetName(), node.ID), dialogue, node);
                //...
            };

            //..............................................................

            // MainWindow
            EditorCore.MainWindow.Init();

            // Add the event handler for handling UI thread exceptions to the event.
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(WIN32.ShowCrashMessage);

            // Run
            Application.Run(EditorCore.MainWindow);
        }
Exemple #5
0
        static void Main()
        {
            // Handle float edition in PropertyGrid
            //http://visualhint.com/blog/70/how-to-format-a-number-with-a-specific-cultureinfonumberformatinfo-in-the-propert
            System.Threading.Thread.CurrentThread.CurrentCulture   = new System.Globalization.CultureInfo("en-US");
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Core
            EditorCore.FillDefaultImageList();
            EditorCore.InitDefaultWindow();
            EditorCore.InitDefaultLists();

            EditorCore.VersionProject = "1.0.0";

            //..............................................................
            // Here you can declare custom types, bindings and menus

            // Animations
            //EditorCore.Animations.Add("Common", new List<string>() { "WaveHands", "CrossArms" });
            //EditorCore.Animations.Add("Angry", new List<string>() { "Speak_01", "Speak_02" });

            // Additional lists items
            EditorCore.CustomLists.Add("TargetActions", new Dictionary <string, string>());
            EditorCore.CustomLists["TargetActions"].Add("AttackEnemy", "Attack Player");
            EditorCore.CustomLists["TargetActions"].Add("ForceFlee", "Flee");
            EditorCore.CustomLists["TargetActions"].Add("ClearTarget", "End Combat");
            EditorCore.CustomLists["TargetActions"].Add("WasRevealed", "Revealed");
            EditorCore.CustomLists["TargetActions"].Add("DisableAI", "Disable");
            EditorCore.CustomLists["TargetActions"].Add("EnableAI", "Enable");
            EditorCore.CustomLists["TargetActions"].Add("OnResurrect", "Resurrected");

            // Bind Nodes Attributes
            EditorCore.BindAttribute(typeof(NodeActionNPCAction), "NPCAction", "NPC Action");
            EditorCore.BindAttribute(typeof(NodeActionChangeState), "ChangeState", "Change State");
            EditorCore.BindAttribute(typeof(NodeActionSay), "Say", "Say");
            EditorCore.BindAttribute(typeof(NodeActionSendMessageToTarget), "SendMessageTarget", "Send Message to Target");
            EditorCore.BindAttribute(typeof(NodeActionSetObjVarNumber), "SetObjVarNumber", "Set Object Var (Number)");
            EditorCore.BindAttribute(typeof(NodeActionSetObjVarString), "SetObjVarString", "Set Object Var (Text)");
            EditorCore.BindAttribute(typeof(NodeActionStartTimer), "StartTimer", "Start Timer");

            EditorCore.BindAttribute(typeof(NodeConditionHasUseCase), "HasUseCase", "Has Use Case");
            EditorCore.BindAttribute(typeof(NodeConditionObjVarNumber), "ObjVarNumber", "Compare Object Var (Number)");
            EditorCore.BindAttribute(typeof(NodeConditionStringCompare), "CompareString", "Compare Two Strings");
            EditorCore.BindAttribute(typeof(NodeConditionTimerTicking), "TimerTicking", "Is Timer Ticking");

            // Delegate post-load project
            EditorCore.OnProjectLoad = delegate
            {
                //...
                // Here you can start additional processes like filling the loaded project/dialogues with some imported data
                //...
            };

            // Delegate to check custom errors
            EditorCore.OnCheckDialogueErrors = delegate(Dialogue dialogue)
            {
                //...
                // Here you can plug custom checks, using this kind of messages :
                //EditorCore.LogError(String.Format("{0} {1} - Sentence has no Speaker", dialogue.GetName(), node.ID), dialogue, node);
                //...
            };

            //..............................................................

            // MainWindow
            EditorCore.MainWindow.Init();

            // Add the event handler for handling UI thread exceptions to the event.
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(WIN32.ShowCrashMessage);

            // Run
            Application.Run(EditorCore.MainWindow);
        }
Exemple #6
0
        static void Main()
        {
            // Handle float edition in PropertyGrid
            //http://visualhint.com/blog/70/how-to-format-a-number-with-a-specific-cultureinfonumberformatinfo-in-the-propert
            System.Threading.Thread.CurrentThread.CurrentCulture   = new System.Globalization.CultureInfo("en-US");
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Core
            EditorCore.FillDefaultImageList();
            EditorCore.InitDefaultWindow();
            EditorCore.InitDefaultLists();

            EditorCore.VersionProject = "1.0.0";

            //..............................................................
            // Here you can declare custom types, bindings and menus

            // Animations
            EditorCore.Animations.Add("Common", new List <string>()
            {
                "WaveHands", "CrossArms"
            });
            EditorCore.Animations.Add("Angry", new List <string>()
            {
                "Speak_01", "Speak_02"
            });

            // Additional lists items
            EditorCore.CustomLists["Builds"].Add("Dwarf", "Dwarf");

            // Cameras
            var cameras = new Dictionary <string, string>();

            cameras.Add("", "");
            cameras.Add("CloseUp", "Close Up");
            cameras.Add("MediumShot", "Medium Shot");
            cameras.Add("FullShot", "Full Shot");
            EditorCore.CustomLists["Cameras"] = cameras;

            // Bind Nodes Attributes
            EditorCore.BindAttribute(typeof(NodeConditionHasHonor), "ConditionHasHonor", "Has Honor");
            EditorCore.BindAttribute(typeof(NodeActionAddHonor), "ActionAddHonor", "Add Honor");

            // Bind Nodes Properties Panels
            EditorCore.BindCustomProperties(typeof(DialogueNodeSentence), "DirectingProperties", typeof(DirectingProperties), typeof(FormPropertiesDirecting));

            // Delegate post-load project
            EditorCore.OnProjectLoad = delegate
            {
                //...
                // Here you can start additional processes like filling the loaded project/dialogues with some imported data
                //...
            };

            // Delegate post-load dialogue, should be used when data needs to migrate between versions
            EditorCore.OnDialoguePostLoad = delegate(Dialogue dialogue)
            {
                //...
                // Here you can handle data migration and properties update, using serialized data from ExtensionData dictionnaries
                //...

                //...
                // Here you can flush all ExtensionData to remove them from serialization once migration is complete
                //foreach (DialogueNode node in dialogue.ListNodes)
                //{
                //    node.ExtensionData?.Clear();
                //}

                //dialogue.ExtensionData?.Clear();
                //...
            };

            // Delegate to check custom errors
            EditorCore.OnCheckDialogueErrors = delegate(Dialogue dialogue)
            {
                //...
                // Here you can plug custom checks, using this kind of messages :
                //EditorCore.LogError(String.Format("{0} {1} - Sentence has no Speaker", dialogue.GetName(), node.ID), dialogue, node);
                //...
            };

            //..............................................................

            // MainWindow
            EditorCore.MainWindow.Init();

            // Add the event handler for handling UI thread exceptions to the event.
            Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(WIN32.ShowCrashMessage);

            // Run
            Application.Run(EditorCore.MainWindow);
        }