示例#1
0
        public void Init()
        {
            this.listSwitch = ListSwitch.None;
            this.Heroes     = new RecordCollection();

            DHLOOKUP.RefreshTaverns();
        }
示例#2
0
        internal bool LoadMpq(string filename)
        {
            ResetMpqDatabase(); // reset everything that was loaded with previous map

            Current.map = DHRC.OpenArchive(filename, 11);

            // heroes

            splashScreen.ShowText("loading units...");
            DHMpqDatabase.LoadUnits(); splashScreen.ProgressAdd(8);

            // items

            splashScreen.ShowText("loading items...");
            DHMpqDatabase.LoadItems(); splashScreen.ProgressAdd(8);

            // abilites

            splashScreen.ShowText("loading abilities...");
            DHMpqDatabase.LoadAbilities(splashScreen);

            // upgrades

            splashScreen.ShowText("loading upgrades...");
            DHMpqDatabase.LoadUpgrades(splashScreen);

            DHLOOKUP.RefreshHotEntries();

            // jass

            try
            {
                splashScreen.ShowText("compiling jass...");
                DHJass.ReadCustom(DHRC.GetFile(Script.Custom).GetStream(), false); splashScreen.ProgressAdd(14);

                cbForm.PrepareControls();

                splashScreen.ShowText("executing jass...");
                DHJass.Config();
                DHJass.Go(); splashScreen.ProgressAdd(15);
            }
            catch (Exception e)
            {
                MessageBox.Show("Failed to load the jass script. This heavely reduces the functionality of DotaHIT, but you will still be able to use simple features like DataDump."
                                + Environment.NewLine + "Error Message: " + e.Message);
                return(false);
            }

            return(true);
        }