private void cbCreatures_SelectedIndexChanged(object sender, EventArgs e) { if (Heroes3Master.Master != null && CreatureManager.Loaded) { var creature = CreatureManager.Get(cbCastles.SelectedIndex, cbCreatures.SelectedIndex); LoadCreatureInfo(creature); string allCreatures = Properties.Resources.creatures; string defName = allCreatures.Split(new[] { "\r\n" }, StringSplitOptions.None)[creature.CreatureIndex].Split(';')[2] + ".def"; var lodFile = Heroes3Master.Master.Resolve(defName); if (creatureAnimation != null) { pbCreature.Image = null; creatureAnimation.Dispose(); } var def = lodFile[defName].GetDefFile(); if (def != null) { creatureAnimation = new CreatureAnimationLoop(creature.CreatureIndex, def); creatureAnimation.TimerTick += creatureAnimation_TimerTick; creatureAnimation.Enabled = true; } } }
public void RefreshData() { routingCache = new Dictionary <string, LodFile>(); BackupManager = new BackupManager(); Resource.Unload(); CreatureAnimationLoop.Unload(); BitmapCache.UnloadCachedDrawItems(); HeroesManager.LoadInfo(this); HeroClass.LoadInfo(this); CreatureManager.LoadInfo(this); Spell.LoadInfo(this); SecondarySkill.LoadInfo(this); StringsData.LoadInfo(this); Speciality.LoadInfo(this); Town.LoadInfo(this); HeroExeData.LoadInfo(this); BackupManager.LoadData(this); }