public frmItemPicker(build build, frmHeroPicker caller) { InitializeComponent(); Build = this; this.LoadBuild(build); this.Caller = caller; }
public void LoadBuild(build Build) { this.title = Build.Title; this.hero = Build.Hero; this.author = Build.Author; //Imageindex int n = 0; try { foreach (Item it in ItemFetcher.AllItems) { it.ImageListIndex = n; n++; } } catch (Exception ex) { MessageBox.Show("Error while loading files. Please verify cache and try again.", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } Image pic = Image.FromFile(hero.ImagePath); this.HeroNameLabel.Text = hero.Name + " - " + title; pictureBox1.Image = pic; foreach (group g in Build.Items) { //Add item Groups BuildTab b = new BuildTab(g); b.ItemList.LargeImageList = this.GListBox1.ImageList; b.ItemList.SmallImageList = this.GListBox1.ImageList; tabControl1.Controls.Add(b); } }
private void createBuildToolStripMenuItem_Click(object sender, EventArgs e) { //Create The Build List<group> groups = new List<group>(); foreach (TabPage i in this.tabControl1.TabPages) { BuildTab j = (BuildTab)i; groups.Add(j.Group); } dire.editor.build UserBuild = new build(hero, author, title, groups); if (frmSettings.Settings.SaveInDota) { UserBuild.WriteBuild(frmSettings.Settings.DotaPath + "\\dota\\itembuilds\\default_" + hero.DotaName + ".txt", !frmSettings.Settings.DotaPathOverride); } else { UserBuild.WriteBuild("default_" + hero.DotaName + ".txt"); } }