Ejemplo n.º 1
0
        private void ItemsAndProbability_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
        {
            if (Read != null && RegionDataGrid.CurrentCell != null && !locked)
            {
                int itemId = RegionDataGrid.CurrentCell.RowIndex;
                switch (e.ColumnIndex)
                {
                case 0:
                    e.Value = Read.drops[itemId].DropItems[e.RowIndex].ID;
                    break;

                case 1:
                    int            Id             = (int)Read.drops[itemId].DropItems[e.RowIndex].ID;
                    ElementsEditor elementsEditor = ElementsEditor.Instance;
                    if (elementsEditor != null && ElementsEditor.eLC != null)
                    {
                        if (Id > 0 && ElementsEditor.eLC.ocupiedIds.ContainsKey(Id))
                        {
                            e.Value = ElementsEditor.eLC.ocupiedIds[Id].name;
                        }
                        else
                        {
                            if (Id == 0)
                            {
                                e.Value = "Empty Slot";
                            }
                            else
                            {
                                e.Value = "Unknown Item";
                            }
                        }
                    }
                    else
                    {
                        if (Id == 0)
                        {
                            e.Value = "Empty Slot";
                        }
                        else
                        {
                            e.Value = "Please Load elements.data";
                        }
                    }
                    break;

                case 2:
                    e.Value = Read.drops[itemId].DropItems[e.RowIndex].probability.ToString("0.0###############");
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        private void AffectedMonster_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
        {
            try
            {
                if (Read != null && RegionDataGrid.CurrentCell != null && !locked)
                {
                    int itemId = RegionDataGrid.CurrentCell.RowIndex;
                    switch (e.ColumnIndex)
                    {
                    case 0:
                        e.Value = Read.drops[itemId].monstersId[e.RowIndex];
                        break;

                    case 1:
                        ElementsEditor elementsEditor = ElementsEditor.Instance;
                        if (elementsEditor != null && ElementsEditor.eLC != null)
                        {
                            int Id = Read.drops[itemId].monstersId[e.RowIndex];
                            if (ElementsEditor.eLC.MONSTERS.ContainsKey(Id))
                            {
                                e.Value = ElementsEditor.eLC.MONSTERS[Id].name;
                            }
                            else
                            {
                                e.Value = "Unknown Monster";
                            }
                        }
                        else
                        {
                            e.Value = "Please Load elements.data";
                        }
                        break;
                    }
                }
            }
            catch { }
        }
Ejemplo n.º 3
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();
            }
        }
Ejemplo n.º 4
0
 private void jComboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (Exporting)
     {
         return;
     }
     reading = true;
     //Mobs
     //Resources
     //NPCS
     display = new List <Mobs>();
     listBox_items.SuspendLayout();
     listBox_items.Rows.Clear();
     if (database != null && database.Count > 0 && jComboBox1.SelectedIndex != -1)
     {
         if (database.ContainsKey(jComboBox1.Items[jComboBox1.SelectedIndex].ToString()))
         {
             foreach (Mobs mob in database[jComboBox1.Items[jComboBox1.SelectedIndex].ToString()])
             {
                 ElementsEditor elementsEditor = ElementsEditor.Instance;
                 if (elementsEditor != null && ElementsEditor.eLC != null)
                 {
                     if (ElementsEditor.eLC.MONSTERS.ContainsKey(mob.id) && jComboBox2.SelectedIndex == 0)
                     {
                         mob.Name = ElementsEditor.eLC.MONSTERS[mob.id].name;
                         mob.Type = "MOB";
                         display.Add(mob);
                         type = 1;
                     }
                     else if (ElementsEditor.eLC.NPCS.ContainsKey(mob.id) && jComboBox2.SelectedIndex == 2)
                     {
                         mob.Name = ElementsEditor.eLC.NPCS[mob.id].name;
                         mob.Type = "NPC";
                         display.Add(mob);
                         type = 0;
                     }
                     else if (ElementsEditor.eLC.RESOURCES.ContainsKey(mob.id) && jComboBox2.SelectedIndex == 1)
                     {
                         mob.Name = ElementsEditor.eLC.RESOURCES[mob.id].name;
                         mob.Type = "MINE";
                         display.Add(mob);
                         type = 2;
                     }
                     else
                     {
                         if (jCheckBox1.Checked)
                         {
                             listBox_items.Rows.Add(new object[] { mob.id, "Load Elements", "UNK", mob.x, mob.y, mob.z });
                         }
                     }
                 }
                 else
                 {
                     if (jCheckBox1.Checked)
                     {
                         listBox_items.Rows.Add(new object[] { mob.id, "Load Elements", "UNK", mob.x, mob.y, mob.z });
                     }
                 }
             }
             foreach (Mobs mob in display)
             {
                 listBox_items.Rows.Add(new object[] { mob.id, mob.Name, mob.Type, mob.x, mob.y, mob.z });
             }
         }
     }
     listBox_items.ResumeLayout();
     listBox_items.PerformLayout();
     reading = false;
 }