public void ImportMap(Map map) { OnImportBegin(); Decompiler decompiler = new Decompiler(map); Directory.SetCurrentDirectory(SourceDirectory); foreach (Index.TagInformation Entry in map.Index.TagEntries) { string filename = Path.ChangeExtension(map.Tagnames[Entry.Index & 0x0000FFFF], Index.GetCleanType(Entry.Type.ToString()).Trim()) + Tag.Path.Extension; if (Entry.Type == "sbsp" || Entry.Type == "ltmp") decompiler.Decompile(Entry, filename, map.PrimaryMagic); else if (Entry.Type == "unic") decompiler.DecompileUnic(Entry, filename, map.SecondaryMagic, map.Unicode[UnicodeTable.Language.English]); else decompiler.Decompile(Entry, filename, map.SecondaryMagic); if (Entry.Type == "scnr") Scenario = filename; } Save(); OnImportCompleted(); }