private void UpdateBtn_Click(object sender, EventArgs e) { System.Windows.Forms.Cursor.Current = Cursors.WaitCursor; foreach (Hero hero in Session.Project.Heroes) { if (hero.Key == null || hero.Key == "") { continue; } AppImport.ImportIPlay4e(hero); } Session.Modified = true; this.update_view(); System.Windows.Forms.Cursor.Current = Cursors.Default; }
private void edit_iplay4e() { List <Hero> heros = (Session.Project.Heroes.Contains(this.SelectedHero) ? Session.Project.Heroes : Session.Project.InactiveHeroes); int num = heros.IndexOf(this.SelectedHero); HeroIPlay4eForm heroIPlay4eForm = new HeroIPlay4eForm(this.SelectedHero.Key, true); if (heroIPlay4eForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Hero hero = new Hero() { Key = heroIPlay4eForm.Key }; System.Windows.Forms.Cursor.Current = Cursors.WaitCursor; bool flag = AppImport.ImportIPlay4e(hero); System.Windows.Forms.Cursor.Current = Cursors.Default; if (flag) { heros[num] = hero; Session.Modified = true; this.update_view(); } } }
private void Import_iPlay4e_Click(object sender, EventArgs e) { try { HeroIPlay4eForm heroIPlay4eForm = new HeroIPlay4eForm("", true); if (heroIPlay4eForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Hero hero = new Hero() { Key = heroIPlay4eForm.Key }; System.Windows.Forms.Cursor.Current = Cursors.WaitCursor; bool flag = AppImport.ImportIPlay4e(hero); System.Windows.Forms.Cursor.Current = Cursors.Default; if (!flag) { string str = string.Concat("The character could not be found.", Environment.NewLine); str = string.Concat(str, Environment.NewLine); str = string.Concat(str, "Make sure:"); str = string.Concat(str, Environment.NewLine); str = string.Concat(str, "* The key is correct"); str = string.Concat(str, Environment.NewLine); str = string.Concat(str, "* The character is public"); MessageBox.Show(str, "Masterplan", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } else { this.add_hero(hero); this.update_view(); } } } catch (Exception exception) { LogSystem.Trace(exception); } }