public MobUC(Searchmobs mobStayi) { vnutrennyMobEtoiFormy = mobStayi; InitializeComponent(); Text = mobStayi.name; pictureBox2.Image = mobStayi.picture.Image; pictureBox2.Click += new EventHandler(Mobs.OpenMob); pictureBox2.BackColor = Color.Transparent; pictureBox2.Tag = mobStayi.name; label1.Text = mobStayi.name; }
public MobForm(string MobType) { InitializeComponent(); Text = MobType; label2.Text = MobType; string category = "Враждебные мобы"; for (int i = 0; i < Mobs.mob_list.Count; i++) { if (MobType == Mobs.mob_list[i].name) { Mob_Like = Mobs.mob_list[i]; Mob_dislike = Mobs.mob_list[i]; category = Mobs.mob_list[i].category; } } try { label3.Text = File.ReadAllText("../../" + category + "/" + MobType + ".txt"); label1.Text = File.ReadAllText("../../" + category + "/" + MobType + "2.txt"); } catch (Exception) { } try { pictureBox1.Load("../../" + category + "/" + MobType + ".gif"); } catch (Exception) { pictureBox1.Load("../../" + category + "/" + MobType + ".png"); } if (Mobs.Mob_like.Contains(Mob_Like)) { label4.Text = "1"; } else { label4.Text = "0"; } }