public VillagerDisplay(SimpleVillager villager) { InitializeComponent(); if (villagerImage == null) { villagerImage = Image.FromFile("Resources/Images/Villagers.jpg"); } RestoreFromVillager(villager); }
public void RestoreFromVillager(SimpleVillager villager) { villagerPreview.Image = villagerImage; villagerPreview.Offset = (villager.VillagerId < 0xE000 || villager.VillagerId > 0xE0EB) ? new Point(64 * 6, 64 * 23) : new Point(64 * ((villager.VillagerId & 0xFF) % 10), 64 * ((villager.VillagerId & 0xFF) / 10)); nameLabel.Text = villager.Name; wikiButton.Enabled = villager.Name != "Unknown" && !villager.Name.Contains("DLC Villager"); Villager = villager; }
public static VillagerDisplay CreateFromVillagerObject(SimpleVillager villager) { return(new VillagerDisplay(villager)); }