示例#1
0
 public PWDBWindow(TaskEditor MainWindow)
 {
     InitializeComponent();
     this.MainWindow = MainWindow;
     this.SetLocalization();
     this.comboBox_PWDBLang.SelectedIndex = MainWindow.lPWDBLang;
 }
示例#2
0
 public SelectTitleIdWindow(TaskEditor MainWindow, int param)
 {
     InitializeComponent();
     this.MainWindow = MainWindow;
     Param           = param;
     this.SetLocalization();
 }
示例#3
0
        //If the node implements ITaskAssignable this is shown for the user to assign a task
        static void TaskAssignableGUI(Node node)
        {
            if (node is ITaskAssignable)
            {
                var         assignable = (node as ITaskAssignable);
                System.Type taskType   = null;
                var         interfaces = node.GetType().GetInterfaces();
                for (var i = 0; i < interfaces.Length; i++)
                {
                    var iType = interfaces[i];
                    if (iType.IsGenericType && iType.GetGenericTypeDefinition() == typeof(ITaskAssignable <>))
                    {
                        taskType = iType.GetGenericArguments()[0];
                        break;
                    }
                }

                if (taskType != null)
                {
                    TaskEditor.TaskFieldMulti(assignable.task, node.graph, taskType, (t) =>
                    {
                        node._icon      = null;
                        assignable.task = t;
                    });
                }
            }
        }
示例#4
0
 public PlayerWantedForceWindow(TaskEditor MainWindow, int i)
 {
     InitializeComponent();
     this.MainWindow = MainWindow;
     this.SetLocalization();
     textBox_Force.Text = i.ToString();
     Force_ClickChanged();
 }
示例#5
0
 public PlayerWantedOccupationsWindow(TaskEditor MainWindow, int i)
 {
     InitializeComponent();
     this.MainWindow = MainWindow;
     this.SetLocalization();
     textBox_Occupations.Text = i.ToString();
     Occupations_ClickChanged();
 }
示例#6
0
 public SelectWorldIdWindow(TaskEditor MainWindow, int param, int selecteditemindex)
 {
     InitializeComponent();
     this.MainWindow   = MainWindow;
     Param             = param;
     SelectedItemIndex = selecteditemindex;
     this.SetLocalization();
 }
示例#7
0
        ///Show the sub-tasks list
        public void ShowListGUI()
        {
            if (ownerSystem == null)
            {
                GUILayout.Label("Owner System is null!");
                return;
            }

            TaskEditor.ShowCreateTaskSelectionButton <ActionTask>(ownerSystem, AddAction);

            ValidateList();

            if (actions.Count == 0)
            {
                EditorGUILayout.HelpBox("No Actions", MessageType.None);
                return;
            }

            if (actions.Count == 1)
            {
                return;
            }

            //show the actions
            EditorUtils.ReorderableList(actions, (i, picked) =>
            {
                var action = actions[i];
                GUI.color  = Color.white.WithAlpha(action == currentViewAction? 0.75f : 0.25f);
                EditorGUILayout.BeginHorizontal("box");

                GUI.color       = Color.white.WithAlpha(action.isActive? 0.8f : 0.25f);
                GUI.enabled     = !Application.isPlaying;
                action.isActive = EditorGUILayout.Toggle(action.isActive, GUILayout.Width(18));
                GUI.enabled     = true;

                GUILayout.Label((action.isPaused? "<b>||</b> " : action.isRunning? "► " : "") + action.summaryInfo, GUILayout.MinWidth(0), GUILayout.ExpandWidth(true));

                if (!Application.isPlaying && GUILayout.Button("X", GUILayout.Width(20)))
                {
                    Undo.RecordObject(ownerSystem.contextObject, "List Remove Task");
                    actions.RemoveAt(i);
                }

                EditorGUILayout.EndHorizontal();

                var lastRect = GUILayoutUtility.GetLastRect();
                EditorGUIUtility.AddCursorRect(lastRect, MouseCursor.Link);
                if (Event.current.type == EventType.MouseDown && lastRect.Contains(Event.current.mousePosition))
                {
                    currentViewAction = action == currentViewAction? null : action;
                    Event.current.Use();
                }

                GUI.color = Color.white;
            });

            executionMode = (ActionsExecutionMode)EditorGUILayout.EnumPopup(executionMode);
        }
        ///Show the sub-tasks list
        public void ShowListGUI()
        {
            TaskEditor.ShowCreateTaskSelectionButton <ConditionTask>(ownerSystem, AddCondition);

            ValidateList();

            if (conditions.Count == 0)
            {
                EditorGUILayout.HelpBox("No Conditions", MessageType.None);
                return;
            }

            if (conditions.Count == 1)
            {
                return;
            }

            EditorUtils.ReorderableList(conditions, (i, picked) =>
            {
                var condition = conditions[i];
                GUI.color     = Color.white.WithAlpha(condition == currentViewCondition ? 0.75f : 0.25f);
                GUILayout.BeginHorizontal("box");

                GUI.color               = Color.white.WithAlpha(condition.isUserEnabled ? 0.8f : 0.25f);
                GUI.enabled             = !Application.isPlaying;
                condition.isUserEnabled = EditorGUILayout.Toggle(condition.isUserEnabled, GUILayout.Width(18));
                GUI.enabled             = true;

                GUILayout.Label(condition.summaryInfo, GUILayout.MinWidth(0), GUILayout.ExpandWidth(true));

                if (!Application.isPlaying && GUILayout.Button("X", GUILayout.MaxWidth(20)))
                {
                    UndoUtility.RecordObject(ownerSystem.contextObject, "List Remove Task");
                    conditions.RemoveAt(i);
                    if (conditions.Count == 1)
                    {
                        conditions[0].isUserEnabled = true;
                    }
                }

                GUILayout.EndHorizontal();

                var lastRect = GUILayoutUtility.GetLastRect();
                EditorGUIUtility.AddCursorRect(lastRect, MouseCursor.Link);
                if (Event.current.type == EventType.MouseDown && lastRect.Contains(Event.current.mousePosition))
                {
                    currentViewCondition = condition == currentViewCondition ? null : condition;
                    Event.current.Use();
                }

                GUI.color = Color.white;
            });

            checkMode = (ConditionsCheckMode)EditorGUILayout.EnumPopup(checkMode);
        }
示例#9
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (slvTasks.SelectedItems.Count < 1)
            {
                return;
            }
            Task       t      = (Task)slvTasks.SelectedItems[0].Tag;
            TaskEditor editor = new TaskEditor(t);

            editor.ShowDialog();
        }
示例#10
0
        public SelectSkillIdWindow(TaskEditor MainWindow, int param)
        {
            this.MainWindow = MainWindow;
            Param           = param;
            InitializeComponent();

            this.SetLocalization();
            try
            {
                this.richTextBox_SkillDesc.Font = new Font(TaskEditor.f.Families[0], 8, FontStyle.Bold);
            }
            catch
            { }
        }
    public void Test()
    {
        TaskSceneEditor sceneEditor = new TaskSceneEditor(null);

        TaskEditor editor_Queue = sceneEditor.GetTaskEditor(sceneEditor.strMainTaskID);

        editor_Queue.InitByTaskType(typeof(TaskQueue).ToString());

        TaskEditor editor_Log_A = sceneEditor.AddTask(typeof(TaskLog));
        TaskEditor editor_Log_B = sceneEditor.AddTask(typeof(TaskLog));

        editor_Queue.SetTaskData("TaskList", new List <string>()
        {
            editor_Log_A.curTaskData.strID,
            editor_Log_B.curTaskData.strID,
        });

        editor_Log_A.SetTaskData("Log", new List <string>()
        {
            "任务A完成"
        });
        editor_Log_B.SetTaskData("Log", new List <string>()
        {
            "BBBBBB"
        });

        editor_Queue.SetTaskData("TaskDes", new List <string>()
        {
            "队列"
        });
        editor_Log_A.SetTaskData("TaskDes", new List <string>()
        {
            "A"
        });
        editor_Log_B.SetTaskData("TaskDes", new List <string>()
        {
            "B"
        });

        Debug.Log(JsonUtility.ToJson(sceneEditor.curTaskSceneData));

        TaskExecutorBase executor = new TaskExecutorBase();

        executor.taskEvent.EventOnStartTask += (task) =>
        {
            TaskBase taskBase = task as TaskBase;
            Debug.Log("OnStartTask : " + taskBase.strDes);
        };
        executor.Executor(sceneEditor.curTaskSceneData, () => Debug.Log("全部完成"));
    }
示例#12
0
        public SelectItemIdWindow(TaskEditor MainWindow, int param)
        {
            InitializeComponent();
            this.MainWindow = MainWindow;
            Param           = param;
            this.SetLocalization();
            try
            {
                this.richTextBox_Desc.Font = new Font(TaskEditor.f.Families[0], 8, FontStyle.Bold);
            }
            catch
            { }

            this.richTextBox_Desc.Location = new System.Drawing.Point(this.richTextBox_Desc.Location.X, this.dataGridView_Props.Location.Y + this.dataGridView_Props.Height + 7);
            this.richTextBox_Desc.Height   = this.Height - this.dataGridView_Props.Location.Y - this.dataGridView_Props.Height - 7 - 47;
        }
示例#13
0
        ///Show currently selected task inspector
        public void ShowNestedConditionsGUI()
        {
            if (conditions.Count == 1)
            {
                currentViewCondition = conditions[0];
            }

            if (currentViewCondition != null)
            {
                EditorUtils.Separator();
                TaskEditor.TaskFieldSingle(currentViewCondition, (c) =>
                {
                    if (c == null)
                    {
                        var i = conditions.IndexOf(currentViewCondition);
                        conditions.RemoveAt(i);
                    }
                    currentViewCondition = (ConditionTask)c;
                });
            }
        }
示例#14
0
        ///Show currently selected task inspector
        public void ShowNestedActionsGUI()
        {
            if (actions.Count == 1)
            {
                currentViewAction = actions[0];
            }

            if (currentViewAction != null)
            {
                EditorUtils.Separator();
                TaskEditor.TaskFieldSingle(currentViewAction, (a) =>
                {
                    if (a == null)
                    {
                        var i = actions.IndexOf(currentViewAction);
                        actions.RemoveAt(i);
                    }
                    currentViewAction = (ActionTask)a;
                });
            }
        }
示例#15
0
    public void TaskEditorTest()
    {
        TaskSceneEditor taskSceneEditor = new TaskSceneEditor(new TestTaskSceneEditorView());

        TaskEditor editor_0 = taskSceneEditor.AddTask(typeof(TaskQueue));
        TaskEditor editor_1 = taskSceneEditor.AddTask(typeof(TaskChain));
        TaskEditor editor_2 = taskSceneEditor.AddTask(typeof(TaskChain));
        TaskEditor editor_3 = taskSceneEditor.AddTask(typeof(TaskSameTime));

        editor_0.SetTaskData("TaskList", new List <string>()
        {
            editor_1.curTaskData.strID,
            editor_2.curTaskData.strID,
        });

        editor_2.SetTaskData("NextTask", new List <string>()
        {
            editor_3.curTaskData.strID,
        });

        Debug.Log(JsonUtility.ToJson(taskSceneEditor.curTaskSceneData));
    }
示例#16
0
        private void editToolStripButtonClick(object sender, EventArgs e)
        {
            int index = mainTModel.Selections.SelectedItems.Length == 0 ? -1 : mainTModel.Selections.SelectedItems[0].Index;

            if (index != -1)
            {
                List <int> indexes = this.TaskIndexes();

                for (int i = 0; i < Core.Core.Instanse.Tasks.Executors.Count; i++)
                {
                    if (Core.Core.Instanse.Data[indexes[index]].Executor.Name == Core.Core.Instanse.Tasks.Executors[i].Name)
                    {
                        TaskEditor window = new TaskEditor();
                        window.EditType      = TaskEditType.Edit;
                        window.ParserControl = Core.Core.Instanse.Tasks.Controls[i].NewInstance() as IWebParserControl;
                        window.Task          = Core.Core.Instanse.Data[indexes[index]];

                        window.Show();
                        return;
                    }
                }
            }
        }
示例#17
0
    private static void ShowWindow()
    {
        Debug.Log("Show");

        if (!System.IO.Directory.Exists(applicationEditorPath))
        {
            applicationEditorPath = Application.dataPath + "/Resources/TaskEditor";
            System.IO.Directory.CreateDirectory(applicationEditorPath);
            System.IO.Directory.CreateDirectory(applicationEditorPath + "/TaskData");

            CreateUtils();
        }
        else
        {
            LoadUtils();
        }

        SetUtils();

        instance         = GetWindow <TaskEditor>();
        instance.minSize = new Vector2(300, 30);
        instance.maxSize = new Vector2(300, 30);
        instance.Show();
    }
示例#18
0
        private async void SplashScreen_Shown()
        {
#if !COMMUNITYEDITION
            await LicenceManager.Instance.CheckLicenceAsync();

            while (LicenceManager.Instance.status == LICSTATUS.INITIATING)
            {
                Thread.Sleep(100);
            }
#else
            PWDataEditorPaied.Classes.Licence Licence = new PWDataEditorPaied.Classes.Licence
            {
                LicenceName  = "CM",
                HardwereHash = "AAAA",
                HardwereName = "BBBB",
                Products     = new int[] {
                    0, //Profile Editor
                    0, //Admin Editor
                    1, //Element Editor
                    1, //Task Editor
                    1, //Shop Editor
                    1, //NPC Editor
                    0, //Policy Editor
                    1, //Pck Editor
                    0, //Domain Editor
                    0, //Region Editor
                    0, //Precinct Editor
                    0, //DynTask Editor
                    0, //DynObject Editor
                    0, //Fashion Rip
                    1, //SkinChanger
                    0, //WorldTargetsev
                    0, //ExtraDropSev
                    0  //AdminTool
                },
                MaxTimes  = 999,
                OpenTimes = 0,
                Msg       = "Your licence will never expire, but you can get a lot more futures if for just 10 Euro/Month contact me (Skype or Gmail): [email protected]",
                Type      = 2
            };
            LicenceManager.Instance.status      = LICSTATUS.READY;
            LicenceManager.Instance.LicenceName = "CM";
            LicenceManager.Products             = Licence.Products;
            LicenceManager.message = Licence.Msg;
            LicenceManager.Instance.SaveLicence(Licence);
#endif
            switch (LicenceManager.Instance.status)
            {
            case LICSTATUS.READY:
                Thread th = new Thread(() => { DatabaseManager.Instance.LoadDefault(); })
                {
                    IsBackground = true
                };
                th.Start();

                break;

            case LICSTATUS.UNACTIVATED:
                File.WriteAllText(LicenceManager.Instance.Xp, LicenceManager.Instance.Cn);
                Environment.Exit(0);
                Application.Exit();
                break;
            }

            if (LicenceManager.type == LICENCETYPE.TIMED && UpdateManager.instance.isNewUpdate())
            {
                this.Hide();
                DownloadForm download = new DownloadForm(UpdateManager.server_verion);
                download.ShowDialog(this);
            }
            if (LicenceManager.Instance.status == LICSTATUS.READY)
            {
                LICENCETYPE lictype = LicenceManager.type;
                Preferences pref    = PreferencesManager.Instance.Get();
                lictype = LicenceManager.type;
                pref    = PreferencesManager.Instance.Get();
                Program.SHOWMINIMIZEBUTTON = pref.DisplayMinimize;
                Program.HIDEINTASKBAR      = pref.HideFormCompleatlyOnClose;
                mainForm = new MainProgram();
                bool load_elementsEditor = true;
                bool load_gameShopEditor = false;
                bool load_taskEditor     = false;
                bool load_npcEditor      = false;
                bool load_aiPolicyEditor = false;
                bool load_domainEditor   = false;
                bool load_packView       = false;
                bool isShowMainForm      = true;

                bool load_Precinct_Editor     = false;
                bool load_Region_Editor       = false;
                bool load_WorldTargets_Editor = false;
                bool load_extraDrop_Editor    = false;
                bool load_DynObjects_Editor   = false;

                string start = "";
                string path  = "";
                SplashScreen.args = System.Environment.GetCommandLineArgs();
                if (SplashScreen.args != null && SplashScreen.args.Length > 0)
                {
                    int id = -2;


                    for (int r = 0; r < SplashScreen.args.Length; r++)
                    {
                        string[] split = SplashScreen.args[r].Split(' ');
                        for (int i = 0; i < split.Length; i++)
                        {
                            if (split[i] == "-start")
                            {
                                start = split[i + 1];
                            }
                            if (split[i] == "-path")
                            {
                                path = split[i + 1];
                            }
                        }
                    }

                    if (start.Length > 0)
                    {
                        bool isInt = int.TryParse(start, out id);
                        if (isInt)
                        {
                            try
                            {
                                load_elementsEditor = load_gameShopEditor = load_taskEditor = load_npcEditor = load_aiPolicyEditor = load_domainEditor = load_packView = false;
                                bool          canShow = true;
                                EditorsColors editor  = EditorsColors.Elements_Editor;
                                if (1985 != id)
                                {
                                    editor = (EditorsColors)id;
                                    switch (editor)
                                    {
                                    case EditorsColors.Elements_Editor:
                                        load_elementsEditor = true;
                                        break;

                                    case EditorsColors.Domain_Editor:
                                        load_domainEditor = true;
                                        break;

                                    case EditorsColors.NPC_Editor:
                                        load_npcEditor = true;
                                        break;

                                    case EditorsColors.Pck_Editor:
                                        load_packView = true;
                                        break;

                                    case EditorsColors.Policy_Editor:
                                        load_aiPolicyEditor = true;
                                        break;

                                    case EditorsColors.Shop_Editor:
                                        load_gameShopEditor = true;
                                        break;

                                    case EditorsColors.Tasks_Editor:
                                        load_taskEditor = true;
                                        break;

                                    case EditorsColors.Precinct_Editor:
                                        load_Precinct_Editor = true;
                                        break;

                                    case EditorsColors.Region_Editor:
                                        load_Region_Editor = true;
                                        break;

                                    case EditorsColors.WorldTargets_Editor:
                                        load_WorldTargets_Editor = true;
                                        break;

                                    case EditorsColors.DynObjects_Editor:
                                        load_DynObjects_Editor = true;
                                        break;

                                    default:
                                        canShow = false;
                                        break;
                                    }
                                }
                                else
                                {
                                    if (path != null && path.Length > 0)
                                    {
                                        if (id == 1985)
                                        {
                                            string file = Path.GetFileName(path);
                                            if (file.ToLower().Contains("element"))
                                            {
                                                canShow = load_elementsEditor = true;
                                                editor  = EditorsColors.Elements_Editor;
                                            }
                                            else if (file.ToLower().Contains("task"))
                                            {
                                                canShow = load_taskEditor = true;
                                                editor  = EditorsColors.Tasks_Editor;
                                            }
                                            else if (file.ToLower().Contains("npcge"))
                                            {
                                                canShow = load_npcEditor = true;
                                                editor  = EditorsColors.NPC_Editor;
                                            }
                                            else if (file.ToLower().Contains("shop"))
                                            {
                                                canShow = load_gameShopEditor = true;
                                                editor  = EditorsColors.Shop_Editor;
                                            }
                                            else if (file.ToLower().Contains("policy"))
                                            {
                                                canShow = load_aiPolicyEditor = true;
                                                editor  = EditorsColors.Policy_Editor;
                                            }
                                            else if (file.ToLower().Contains("domain"))
                                            {
                                                canShow = load_domainEditor = true;
                                                editor  = EditorsColors.Domain_Editor;
                                            }
                                            else if (file.ToLower().Contains("dynamicobjects"))
                                            {
                                                canShow = load_DynObjects_Editor = true;
                                                editor  = EditorsColors.DynObjects_Editor;
                                            }
                                            else if (file.ToLower().Contains("region"))
                                            {
                                                canShow = load_Region_Editor = true;
                                                editor  = EditorsColors.Region_Editor;
                                            }
                                            else if (file.ToLower().Contains("precinct"))
                                            {
                                                canShow = load_Precinct_Editor = true;
                                                editor  = EditorsColors.Precinct_Editor;
                                            }
                                            else if (file.ToLower().Contains("world_targets"))
                                            {
                                                canShow = load_WorldTargets_Editor = true;
                                                editor  = EditorsColors.WorldTargets_Editor;
                                            }
                                            else if (file.ToLower().Contains("extra_drops"))
                                            {
                                                canShow = load_extraDrop_Editor = true;
                                                editor  = EditorsColors.ExtraDropSev;
                                            }
                                        }
                                    }
                                }
                                if (canShow)
                                {
                                    isShowMainForm         = false;
                                    mainForm.BecomeVisible = isShowMainForm;
                                    mainForm.callonShow    = editor;
                                }
                                else
                                {
                                    isShowMainForm = load_WorldTargets_Editor = load_Precinct_Editor = load_Region_Editor = load_DynObjects_Editor = load_elementsEditor = load_gameShopEditor = load_taskEditor = load_npcEditor = load_aiPolicyEditor = load_domainEditor = load_packView = true;
                                }
                            }
                            catch {
                                isShowMainForm = load_WorldTargets_Editor = load_Precinct_Editor = load_Region_Editor = load_DynObjects_Editor = load_elementsEditor = load_gameShopEditor = load_taskEditor = load_npcEditor = load_aiPolicyEditor = load_domainEditor = load_packView = true;
                            }
                        }
                    }
                }
                if (!isShowMainForm)
                {
                    Program.StandAlone = true;
                }
                else
                {
                    Program.StandAlone = false;
                }

                if (load_extraDrop_Editor)
                {
                    SplashScreen.ExtraDropEditor = new ExtraDropSave();
                    if (path != null && path.Length > 0 && File.Exists(path) && Path.GetExtension(path).ToLower().Equals(".sev"))
                    {
                        SplashScreen.ExtraDropEditor.isAutoOpen   = true;
                        SplashScreen.ExtraDropEditor.autoOpenPath = path;
                    }
                    await Task.Factory.StartNew(() =>
                    {
                        this.Invoke(new MethodInvoker(delegate
                        {
                            SplashScreen.ExtraDropEditor.Show();
                            SplashScreen.ExtraDropEditor.WindowState    = FormWindowState.Minimized;
                            SplashScreen.ExtraDropEditor.ShowInTaskbar  = SplashScreen.ExtraDropEditor.ShowIcon = true;
                            SplashScreen.ExtraDropEditor.Opacity        = 100;
                            SplashScreen.ExtraDropEditor.progress_bar2 += mainForm.progress_bar;
                            SplashScreen.ExtraDropEditor.SetStyle(pref.color[(int)EditorsColors.ExtraDropSev], pref.teme[(int)EditorsColors.ExtraDropSev], 255);
                            GC.KeepAlive(SplashScreen.ExtraDropEditor);
                        }));
                    });
                }

                if (load_DynObjects_Editor)
                {
                    SplashScreen.dynObjectsEditor = new DynObjectsEditor();
                    if (path != null && path.Length > 0 && File.Exists(path) && Path.GetExtension(path).ToLower().Equals(".data"))
                    {
                        SplashScreen.dynObjectsEditor.isAutoOpen   = true;
                        SplashScreen.dynObjectsEditor.autoOpenPath = path;
                    }
                    await Task.Factory.StartNew(() =>
                    {
                        this.Invoke(new MethodInvoker(delegate
                        {
                            SplashScreen.dynObjectsEditor.Show();
                            SplashScreen.dynObjectsEditor.WindowState    = FormWindowState.Minimized;
                            SplashScreen.dynObjectsEditor.ShowInTaskbar  = SplashScreen.dynObjectsEditor.ShowIcon = true;
                            SplashScreen.dynObjectsEditor.Opacity        = 100;
                            SplashScreen.dynObjectsEditor.progress_bar2 += mainForm.progress_bar;
                            SplashScreen.dynObjectsEditor.SetStyle(pref.color[(int)EditorsColors.DynObjects_Editor], pref.teme[(int)EditorsColors.DynObjects_Editor], 255);
                            GC.KeepAlive(SplashScreen.dynObjectsEditor);
                        }));
                    });
                }

                if (load_WorldTargets_Editor)
                {
                    SplashScreen.worldTargetsEditor = new WorldTargetsEditor();
                    if (path != null && path.Length > 0 && File.Exists(path) && Path.GetExtension(path).ToLower().Equals(".txt"))
                    {
                        SplashScreen.worldTargetsEditor.isAutoOpen   = true;
                        SplashScreen.worldTargetsEditor.autoOpenPath = path;
                    }
                    await Task.Factory.StartNew(() =>
                    {
                        this.Invoke(new MethodInvoker(delegate
                        {
                            SplashScreen.worldTargetsEditor.Show();
                            SplashScreen.worldTargetsEditor.WindowState    = FormWindowState.Minimized;
                            SplashScreen.worldTargetsEditor.ShowInTaskbar  = SplashScreen.worldTargetsEditor.ShowIcon = true;
                            SplashScreen.worldTargetsEditor.Opacity        = 100;
                            SplashScreen.worldTargetsEditor.progress_bar2 += mainForm.progress_bar;
                            SplashScreen.worldTargetsEditor.SetStyle(pref.color[(int)EditorsColors.WorldTargets_Editor], pref.teme[(int)EditorsColors.WorldTargets_Editor], 255);
                            GC.KeepAlive(SplashScreen.worldTargetsEditor);
                        }));
                    });
                }

                if (load_Region_Editor)
                {
                    SplashScreen.regionEditor = new RegionEditor();
                    if (path != null && path.Length > 0 && File.Exists(path))
                    {
                        SplashScreen.regionEditor.isAutoOpen   = true;
                        SplashScreen.regionEditor.autoOpenPath = path;
                    }
                    await Task.Factory.StartNew(() =>
                    {
                        this.Invoke(new MethodInvoker(delegate
                        {
                            SplashScreen.regionEditor.Show();
                            SplashScreen.regionEditor.WindowState    = FormWindowState.Minimized;
                            SplashScreen.regionEditor.ShowInTaskbar  = SplashScreen.regionEditor.ShowIcon = true;
                            SplashScreen.regionEditor.Opacity        = 100;
                            SplashScreen.regionEditor.progress_bar2 += mainForm.progress_bar;
                            SplashScreen.regionEditor.SetStyle(pref.color[(int)EditorsColors.Region_Editor], pref.teme[(int)EditorsColors.Region_Editor], 255);
                            GC.KeepAlive(SplashScreen.regionEditor);
                        }));
                    });
                }


                if (load_Precinct_Editor)
                {
                    SplashScreen.precinctEditor = new PrecinctEditor();
                    if (path != null && path.Length > 0 && File.Exists(path))
                    {
                        SplashScreen.precinctEditor.isAutoOpen   = true;
                        SplashScreen.precinctEditor.autoOpenPath = path;
                    }
                    await Task.Factory.StartNew(() =>
                    {
                        this.Invoke(new MethodInvoker(delegate
                        {
                            SplashScreen.precinctEditor.Show();
                            SplashScreen.precinctEditor.WindowState    = FormWindowState.Minimized;
                            SplashScreen.precinctEditor.ShowInTaskbar  = SplashScreen.precinctEditor.ShowIcon = true;
                            SplashScreen.precinctEditor.Opacity        = 100;
                            SplashScreen.precinctEditor.progress_bar2 += mainForm.progress_bar;
                            SplashScreen.precinctEditor.SetStyle(pref.color[(int)EditorsColors.Precinct_Editor], pref.teme[(int)EditorsColors.Precinct_Editor], 255);
                            GC.KeepAlive(SplashScreen.precinctEditor);
                        }));
                    });
                }


                if (load_elementsEditor)
                {
                    SplashScreen.elementsEditor = new ElementsEditor();
                    if (path != null && path.Length > 0 && File.Exists(path) && Path.GetExtension(path).ToLower().Equals(".data"))
                    {
                        SplashScreen.elementsEditor.isAutoOpen   = true;
                        SplashScreen.elementsEditor.autoOpenPath = path;
                    }
                    await Task.Factory.StartNew(() =>
                    {
                        this.Invoke(new MethodInvoker(delegate
                        {
                            SplashScreen.elementsEditor.Show();
                            SplashScreen.elementsEditor.WindowState    = FormWindowState.Minimized;
                            SplashScreen.elementsEditor.ShowInTaskbar  = SplashScreen.elementsEditor.ShowIcon = true;
                            SplashScreen.elementsEditor.Opacity        = 100;
                            SplashScreen.elementsEditor.progress_bar2 += mainForm.progress_bar;
                            SplashScreen.elementsEditor.SetStyle(pref.color[(int)EditorsColors.Elements_Editor], pref.teme[(int)EditorsColors.Elements_Editor], 255);
                            GC.KeepAlive(SplashScreen.elementsEditor);
                        }));
                    });
                }
                if (load_gameShopEditor)
                {
                    SplashScreen.gameShopEditor = new GameShopEditor();
                    if (path != null && path.Length > 0 && File.Exists(path) && Path.GetExtension(path).ToLower().Equals(".data"))
                    {
                        SplashScreen.gameShopEditor.isAutoOpen   = true;
                        SplashScreen.gameShopEditor.autoOpenPath = path;
                    }
                    await Task.Factory.StartNew(() =>
                    {
                        this.Invoke(new MethodInvoker(delegate
                        {
                            SplashScreen.gameShopEditor.Show();
                            SplashScreen.gameShopEditor.WindowState    = FormWindowState.Minimized;
                            SplashScreen.gameShopEditor.ShowInTaskbar  = SplashScreen.gameShopEditor.ShowIcon = true;
                            SplashScreen.gameShopEditor.Opacity        = 100;
                            SplashScreen.gameShopEditor.progress_bar2 += mainForm.progress_bar;
                            SplashScreen.gameShopEditor.SetStyle(pref.color[(int)EditorsColors.Shop_Editor], pref.teme[(int)EditorsColors.Shop_Editor], 255);
                            GC.KeepAlive(SplashScreen.gameShopEditor);
                        }));
                    });
                }
                if (load_taskEditor)
                {
                    SplashScreen.taskEditor = new TaskEditor();
                    if (path != null && path.Length > 0 && File.Exists(path) && Path.GetExtension(path).ToLower().Equals(".data"))
                    {
                        SplashScreen.taskEditor.isAutoOpen   = true;
                        SplashScreen.taskEditor.autoOpenPath = path;
                    }
                    await Task.Factory.StartNew(() =>
                    {
                        this.Invoke(new MethodInvoker(delegate
                        {
                            SplashScreen.taskEditor.Show();
                            SplashScreen.taskEditor.WindowState    = FormWindowState.Minimized;
                            SplashScreen.taskEditor.ShowInTaskbar  = SplashScreen.taskEditor.ShowIcon = true;
                            SplashScreen.taskEditor.Opacity        = 100;
                            SplashScreen.taskEditor.progress_bar2 += mainForm.progress_bar;
                            SplashScreen.taskEditor.SetStyle(pref.color[(int)EditorsColors.Tasks_Editor], pref.teme[(int)EditorsColors.Tasks_Editor], 255);
                            GC.KeepAlive(SplashScreen.taskEditor);
                        }));
                    });
                }
                if (load_npcEditor)
                {
                    SplashScreen.npcEditor = new NpcEditor();
                    if (path != null && path.Length > 0 && File.Exists(path) && Path.GetExtension(path).ToLower().Equals(".data"))
                    {
                        SplashScreen.npcEditor.isAutoOpen   = true;
                        SplashScreen.npcEditor.autoOpenPath = path;
                    }
                    await Task.Factory.StartNew(() =>
                    {
                        this.Invoke(new MethodInvoker(delegate
                        {
                            SplashScreen.npcEditor.Show();
                            SplashScreen.npcEditor.WindowState    = FormWindowState.Minimized;
                            SplashScreen.npcEditor.ShowInTaskbar  = SplashScreen.npcEditor.ShowIcon = true;
                            SplashScreen.npcEditor.Opacity        = 100;
                            SplashScreen.npcEditor.progress_bar2 += mainForm.progress_bar;
                            SplashScreen.npcEditor.SetStyle(pref.color[(int)EditorsColors.NPC_Editor], pref.teme[(int)EditorsColors.NPC_Editor], 255);
                            GC.KeepAlive(SplashScreen.npcEditor);
                        }));
                    });
                }
                if (load_aiPolicyEditor)
                {
                    SplashScreen.aiPolicyEditor = new AiPolicyEditor();
                    if (path != null && path.Length > 0 && File.Exists(path) && Path.GetExtension(path).ToLower().Equals(".data"))
                    {
                        SplashScreen.aiPolicyEditor.isAutoOpen   = true;
                        SplashScreen.aiPolicyEditor.autoOpenPath = path;
                    }
                    await Task.Factory.StartNew(() =>
                    {
                        this.Invoke(new MethodInvoker(delegate
                        {
                            SplashScreen.aiPolicyEditor.Show();
                            SplashScreen.aiPolicyEditor.WindowState    = FormWindowState.Minimized;
                            SplashScreen.aiPolicyEditor.ShowInTaskbar  = SplashScreen.aiPolicyEditor.ShowIcon = true;
                            SplashScreen.aiPolicyEditor.Opacity        = 100;
                            SplashScreen.aiPolicyEditor.progress_bar2 += mainForm.progress_bar;
                            SplashScreen.aiPolicyEditor.SetStyle(pref.color[(int)EditorsColors.Policy_Editor], pref.teme[(int)EditorsColors.Policy_Editor], 255);
                            GC.KeepAlive(SplashScreen.aiPolicyEditor);
                        }));
                    });
                }
                if (load_domainEditor)
                {
                    SplashScreen.domainEditor = new DomainEditor();
                    if (path != null && path.Length > 0 && File.Exists(path) && Path.GetExtension(path).ToLower().Equals(".data"))
                    {
                        SplashScreen.domainEditor.isAutoOpen   = true;
                        SplashScreen.domainEditor.autoOpenPath = path;
                    }
                    await Task.Factory.StartNew(() =>
                    {
                        this.Invoke(new MethodInvoker(delegate
                        {
                            SplashScreen.domainEditor.Show();
                            SplashScreen.domainEditor.WindowState    = FormWindowState.Minimized;
                            SplashScreen.domainEditor.ShowInTaskbar  = SplashScreen.domainEditor.ShowIcon = true;
                            SplashScreen.domainEditor.Opacity        = 100;
                            SplashScreen.domainEditor.progress_bar2 += mainForm.progress_bar;
                            SplashScreen.domainEditor.SetStyle(pref.color[(int)EditorsColors.Domain_Editor], pref.teme[(int)EditorsColors.Domain_Editor], 255);
                            GC.KeepAlive(SplashScreen.domainEditor);
                        }));
                    });
                }
                if (load_packView)
                {
                    SplashScreen.packView = new PackView();
                    if (path != null && path.Length > 0 && File.Exists(path) && Path.GetExtension(path).ToLower().Equals(".pck"))
                    {
                        SplashScreen.packView.autoLoad     = true;
                        SplashScreen.packView.autoOpenPath = path;
                    }
                    await Task.Factory.StartNew(() =>
                    {
                        this.Invoke(new MethodInvoker(delegate
                        {
                            SplashScreen.packView.Show();
                            SplashScreen.packView.WindowState    = FormWindowState.Minimized;
                            SplashScreen.packView.ShowInTaskbar  = SplashScreen.packView.ShowIcon = true;
                            SplashScreen.packView.Opacity        = 100;
                            SplashScreen.packView.progress_bar2 += mainForm.progress_bar;
                            SplashScreen.packView.SetStyle(pref.color[(int)EditorsColors.Pck_Editor], pref.teme[(int)EditorsColors.Pck_Editor], 255);
                            GC.KeepAlive(SplashScreen.packView);
                        }));
                    });
                }
                while (!DatabaseManager.Loaded)
                {
                }
                mainForm.CustomThing += Form1_FormClosing;
                new JAnimate().FadeOutForm(this, 20, showMainMenu);
            }
            else
            {
                this.Hide();
            }
        }
示例#19
0
 public void Init(TaskEditor editor)
 {
     Debug.Log("Init");
 }
示例#20
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            TaskEditor editor = new TaskEditor();

            editor.ShowDialog();
        }
示例#21
0
 public SelectRelayStationIdWindow(TaskEditor MainWindow)
 {
     InitializeComponent();
     this.MainWindow = MainWindow;
     this.SetLocalization();
 }
示例#22
0
 public void Init(TaskEditor editor)
 {
     this.TaskEditor = editor;
 }