コード例 #1
0
ファイル: Interface.cs プロジェクト: zneel/TheNoobBot
        private void populate_Click(object sender, EventArgs e)
        {
            if (wowDirCB.Text == string.Empty)
            {
                return;
            }
            continentNameCB.Enabled = false;
            wowDirCB.Enabled        = false;
            meshTB.ReadOnly         = true;
            button1.Enabled         = false;
            populate.Enabled        = false;
            if (!_initialized)
            {
                MpqManager.Initialize(wowDirCB.Text);
                _initialized = true;
            }

            // SpellList dumper (keep commented to avoid fileException when opening severals builder at once, but it's very fast)

            //MpqManager.DumpSpellList(); // dumps all spells into directory/spell.txt

            // End of SpellListDumper

            // Doing them one by one to be able to add some separators
            List <WoWMap.MapDbcRecord> l0 = PhaseHelper.GetAllMapOfInstanceType(InstanceType.World, MapType.ADTType);
            List <string> strl            = new List <string>();

            strl.Add("BUILD ALL");
            strl.Add("------- Big tiled world maps -------");
            foreach (WoWMap.MapDbcRecord m in l0)
            {
                strl.Add(m.MapMPQName());
            }
            strl.Add("------- BG -------");
            l0 = PhaseHelper.GetAllMapOfInstanceType(InstanceType.Battleground, MapType.ADTType);
            foreach (WoWMap.MapDbcRecord m in l0)
            {
                strl.Add(m.MapMPQName());
            }
            strl.Add("------- Big tiled Instances-------");
            l0 = PhaseHelper.GetAllMapOfInstanceType(InstanceType.Instance, MapType.ADTType);
            foreach (WoWMap.MapDbcRecord m in l0)
            {
                strl.Add(m.MapMPQName());
            }
            strl.Add("------- Small Instances-------");
            l0 = PhaseHelper.GetAllMapOfInstanceType(InstanceType.Instance, MapType.WDTOnlyType);
            foreach (WoWMap.MapDbcRecord m in l0)
            {
                strl.Add(m.MapMPQName());
            }
            strl.Add("------- Big tiled Raids -------");
            l0 = PhaseHelper.GetAllMapOfInstanceType(InstanceType.RaidInstance, MapType.ADTType);
            foreach (WoWMap.MapDbcRecord m in l0)
            {
                strl.Add(m.MapMPQName());
            }
            strl.Add("------- Small raids -------");
            l0 = PhaseHelper.GetAllMapOfInstanceType(InstanceType.RaidInstance, MapType.WDTOnlyType);
            foreach (WoWMap.MapDbcRecord m in l0)
            {
                strl.Add(m.MapMPQName());
            }
            strl.Add("------- Scenarios -------");
            l0 = PhaseHelper.GetAllMapOfInstanceType(InstanceType.Scenario, MapType.ADTType);
            foreach (WoWMap.MapDbcRecord m in l0)
            {
                strl.Add(m.MapMPQName());
            }
            strl.Add("------- Alliance Gunship Deephome -------");
            strl.Add("AllianceGunship");

            /*strl.Add("------- Small Scenarios -------");
             * l0 = PhaseHelper.GetAllMapOfInstanceType(InstanceType.Scenario, MapType.WDTOnlyType);
             * foreach (MapEntry m in l0)
             *  strl.Add(m.InternalName);*/
            strl.Add("------- Garrison maps -------");
            l0 = PhaseHelper.GetGarrisonMaps();
            foreach (WoWMap.MapDbcRecord m in l0)
            {
                strl.Add(m.MapMPQName());
            }
            //foreach (string s in strl)
            //    Console.WriteLine(s);
            this.continentNameCB.AutoCompleteCustomSource.Clear();
            this.continentNameCB.AutoCompleteCustomSource.AddRange(strl.ToArray());
            this.continentNameCB.Items.Clear();
            this.continentNameCB.Items.AddRange(strl.ToArray());
            continentNameCB.Enabled       = true;
            wowDirCB.Enabled              = true;
            meshTB.ReadOnly               = false;
            button1.Enabled               = true;
            continentNameCB.SelectedIndex = 2;
        }