private void FillEditSectionComboBox(ThingMap map) { comboBoxEditSection.Items.Clear(); FableMod.LEV.LEVFile file = map.LEV; for (int i = 0; i < file.SectionCount; ++i) { comboBoxEditSection.Items.Add(file.get_Sections(i).Name); } }
public override void Run(Progress progress) { FableMod.WLD.Map[] maps = new FableMod.WLD.Map[ myRegion.ContainsMaps.Count + myRegion.SeesMaps.Count]; int count = 0; for (int i = 0; i < myRegion.ContainsMaps.Count; ++i) { maps[count++] = myRegion.ContainsMaps[i]; } if (myAddSees) { for (int i = 0; i < myRegion.SeesMaps.Count; ++i) { maps[count++] = myRegion.SeesMaps[i]; } } progress.Begin(count * 4); FableMod.STB.STBFile stb = null; if (Settings.GetBool("Editor", "UseSTB")) { BBBFileController stbc = FileDatabase.Instance.GetSTB(); stb = (FableMod.STB.STBFile)stbc.BBB; } for (int i = 0; i < count; ++i) { FableMod.WLD.Map map = maps[i]; string levFile = myBaseDirectory + map.LevelName; string tngFile = levFile.Substring(0, levFile.Length - 4) + ".tng"; FableMod.TNG.TNGFile tng = new FableMod.TNG.TNGFile( FileDatabase.Instance.TNGDefinitions); FableMod.LEV.LEVFile lev = new FableMod.LEV.LEVFile(); progress.Info = "Loading " + map.LevelScriptName + " objects..."; progress.Begin(1); tng.Load(tngFile); progress.End(); progress.Info = "Loading " + map.LevelScriptName + " level..."; progress.Begin(1); lev.Open(levFile, null); progress.End(); string stbLevFile = levFile; if (stbLevFile.StartsWith(Settings.FableDirectory)) { stbLevFile = stbLevFile.Substring( Settings.FableDirectory.Length); } FableMod.Gfx.Integration.ThingMap gfxMap = new FableMod.Gfx.Integration.ThingMap(); progress.Begin(1); gfxMap.Create( myController, map.LevelScriptName, map.X, map.Y, lev, stb != null ? stb.GetLevel(stbLevFile) : null, tng); progress.End(); myMaps.Add(gfxMap); gfxMap = null; map = null; lev = null; tng = null; } maps = null; progress.End(); base.Run(progress); }
public MapSaveProcessor(FableMod.TNG.TNGFile tng, FableMod.LEV.LEVFile lev) { myTNG = tng; myLEV = lev; }