Пример #1
0
        private void OpenFiles()
        {
            var dlg = new frmOpenFile();

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                LoadFiles(dlg);
            }
        }
Пример #2
0
        private void OpenFiles(string path)
        {
            var dlg = new frmOpenFile();

            try
            {
                dlg.MobInfo        = new ShnFile(Path.Combine(path, "MobInfo.shn"));
                dlg.ItemInfoServer = new ShnFile(Path.Combine(path, "ItemInfoServer.shn"));
                dlg.ItemDropGroup  = new ShineFile(Path.Combine(path, "World/ItemDropGroup.txt"));
                dlg.ItemDropTable  = new ShineFile(Path.Combine(path, "World/ItemDropTable.txt"));
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message, "Failed to open file");
            }

            LoadFiles(dlg);
        }
Пример #3
0
        public async void LoadFiles(frmOpenFile dlg)
        {
            Mobs   = new BindingList <Mob>();
            Groups = new BindingList <ItemGroup>();
            Items  = new BindingList <string>();

            ItemInfoServer = dlg.ItemInfoServer;
            MobInfo        = dlg.MobInfo;
            ItemDropGroup  = dlg.ItemDropGroup;
            ItemDropTable  = dlg.ItemDropTable;

            ItemDropGroup.ReadFile();
            ItemDropTable.ReadFile();

            lblStatus.Text = @"Reading MobInfo..";
            await MobInfo.Open();

            lblStatus.Text = @"Reading ItemInfoServer..";
            await ItemInfoServer.Open();

            lblStatus.Text = @"Putting items in their groups..";
            await LoadGroups();

            lbItemGroups.DataSource    = Groups;
            lbItemGroups.DisplayMember = "Index";

            lblStatus.Text = @"Reading Mobs..";
            await LoadMobs();

            lbMobs.DataSource    = Mobs;
            lbMobs.DisplayMember = "InxName";

            await LoadItems();

            lbAllItems.DataSource = Items;

            lblStatus.Text = @"Ready";

            ToggleControls(true);
            _isLoaded = true;
        }