Ejemplo n.º 1
0
            public static void LoadData(ref frmLoading iFrm)
            {
                DatabaseAPI.LoadDatabaseVersion();
                IsAppInitialized = true;
                iFrm?.SetMessage("Loading Data...");
                iFrm?.SetMessage("Loading Attribute Modifiers...");
                DatabaseAPI.Database.AttribMods = new Modifiers();
                if (!DatabaseAPI.Database.AttribMods.Load())
                {
                }

                iFrm?.SetMessage("Loading Powerset Database...");
                if (!DatabaseAPI.LoadLevelsDatabase())
                {
                    Interaction.MsgBox(
                        "Failed to load Leveling data file! The program is unable to proceed.\r\n" +
                        "We suggest you redownload the application from https://github.com/Crytilis/mids-reborn-hero-designer/releases",
                        MsgBoxStyle.Critical, "Error");
                    ProjectData.EndApp();
                }

                if (!DatabaseAPI.LoadMainDatabase())
                {
                    Interaction.MsgBox("There was an error reading the database. Aborting.", MsgBoxStyle.Critical, "Dang");
                    ProjectData.EndApp();
                }

                if (!DatabaseAPI.LoadMaths())
                {
                    ProjectData.EndApp();
                }
                iFrm?.SetMessage("Loading Enhancement Database...");
                if (!DatabaseAPI.LoadEnhancementClasses())
                {
                    ProjectData.EndApp();
                }
                I9Gfx.LoadClasses();
                DatabaseAPI.LoadEnhancementDb();
                I9Gfx.LoadEnhancements();
                I9Gfx.LoadSets();
                DatabaseAPI.LoadOrigins();
                I9Gfx.LoadBorders();
                DatabaseAPI.LoadSetTypeStrings();
                iFrm?.SetMessage("Loading Recipe Database...");
                DatabaseAPI.LoadSalvage();
                DatabaseAPI.LoadRecipes();
                iFrm?.SetMessage("Loading Graphics...");
                I9Gfx.LoadSetTypes();
                I9Gfx.LoadEnhTypes();
                I9Gfx.LoadOriginImages();
                I9Gfx.LoadArchetypeImages();
                I9Gfx.LoadPowersetImages();
                MidsContext.Config.Export.LoadCodes(Files.SelectDataFileLoad(Files.MxdbFileBbCodeUpdate));
                if (iFrm != null)
                {
                    iFrm.Opacity = 1.0;
                    DatabaseAPI.MatchAllIDs(iFrm);
                    iFrm?.SetMessage("Matching Set Bonus IDs...");
                    DatabaseAPI.AssignSetBonusIndexes();
                    iFrm?.SetMessage("Matching Recipe IDs...");
                }

                DatabaseAPI.AssignRecipeIDs();
                GC.Collect();
            }
Ejemplo n.º 2
0
 public static void LoadData(ref frmLoading iFrm)
 {
     DatabaseAPI.LoadDatabaseVersion();
     MainModule.MidsController._appInitialized = true;
     if (iFrm != null)
     {
         iFrm.SetMessage("Loading Data...");
     }
     if (iFrm != null)
     {
         iFrm.SetMessage("Loading Attribute Modifiers...");
     }
     DatabaseAPI.Database.AttribMods = new Modifiers();
     DatabaseAPI.Database.AttribMods.Load();
     if (iFrm != null)
     {
         iFrm.SetMessage("Loading Powerset Database...");
     }
     if (!DatabaseAPI.LoadLevelsDatabase())
     {
         Interaction.MsgBox("Failed to load Levelling data file! The program is unable to proceed.\r\nSuggest you redownload the application from http://www.cohplanner.com/", MsgBoxStyle.Critical, "Error");
         ProjectData.EndApp();
     }
     if (!DatabaseAPI.LoadMainDatabase())
     {
         if (Interaction.MsgBox("There was an error reading the database. Attempt to download replacement?", MsgBoxStyle.YesNo | MsgBoxStyle.Information, "Dang") == MsgBoxResult.Yes)
         {
             DateTime date = new DateTime(1, 1, 1);
             DatabaseAPI.Database.Date = date;
             clsXMLUpdate clsXmlUpdate = new clsXMLUpdate("http://repo.cohtitan.com/mids_updates/");
             IMessager    iLoadFrm     = null;
             clsXmlUpdate.UpdateCheck(false, ref iLoadFrm);
         }
         else
         {
             ProjectData.EndApp();
         }
     }
     if (!DatabaseAPI.LoadMaths())
     {
         ProjectData.EndApp();
     }
     if (iFrm != null)
     {
         iFrm.SetMessage("Loading Enhancement Database...");
     }
     if (!DatabaseAPI.LoadEnhancementClasses())
     {
         ProjectData.EndApp();
     }
     I9Gfx.LoadClasses();
     DatabaseAPI.LoadEnhancementDb();
     I9Gfx.LoadEnhancements();
     I9Gfx.LoadSets();
     DatabaseAPI.LoadOrigins();
     I9Gfx.LoadBorders();
     DatabaseAPI.LoadSetTypeStrings();
     if (iFrm != null)
     {
         iFrm.SetMessage("Loading Recipe Database...");
     }
     DatabaseAPI.LoadSalvage();
     DatabaseAPI.LoadRecipes();
     if (iFrm != null)
     {
         iFrm.SetMessage("Loading Graphics...");
     }
     I9Gfx.LoadSetTypes();
     I9Gfx.LoadEnhTypes();
     I9Gfx.LoadOriginImages();
     I9Gfx.LoadArchetypeImages();
     I9Gfx.LoadPowersetImages();
     MidsContext.Config.Export.LoadCodes(Files.SelectDataFileLoad("BBCode.mhd"));
     iFrm.Opacity = 1.0;
     DatabaseAPI.MatchAllIDs(iFrm);
     if (iFrm != null)
     {
         iFrm.SetMessage("Matching Set Bonus IDs...");
     }
     DatabaseAPI.AssignSetBonusIndexes();
     if (iFrm != null)
     {
         iFrm.SetMessage("Matching Recipe IDs...");
     }
     DatabaseAPI.AssignRecipeIDs();
     GC.Collect();
 }