public Map PrepareMap(string uid) { LoadScreen.Display(); if (!AvailableMaps.ContainsKey(uid)) { throw new InvalidDataException("Invalid map uid: {0}".F(uid)); } var map = new Map(AvailableMaps[uid].Path); // Reinit all our assets LoadInitialAssets(); foreach (var pkg in Manifest.Packages) { FileSystem.Mount(pkg); } // Mount map package so custom assets can be used. TODO: check priority. FileSystem.Mount(FileSystem.OpenPackage(map.Path, int.MaxValue)); Rules.LoadRules(Manifest, map); SpriteLoader = new SpriteLoader(Rules.TileSets[map.Tileset].Extensions, SheetBuilder); SequenceProvider.Initialize(Manifest.Sequences, map.Sequences); return(map); }
public Map PrepareMap(string uid) { LoadScreen.Display(); if (!AvailableMaps.ContainsKey(uid)) { throw new InvalidDataException("Invalid map uid: {0}".F(uid)); } var map = new Map(AvailableMaps[uid].Path); LoadTranslations(map); // Reinit all our assets InitializeLoaders(); FileSystem.LoadFromManifest(Manifest); // Mount map package so custom assets can be used. TODO: check priority. FileSystem.Mount(FileSystem.OpenPackage(map.Path, null, int.MaxValue)); Rules.LoadRules(Manifest, map); SpriteLoader = new SpriteLoader(Rules.TileSets[map.Tileset].Extensions, SheetBuilder); // TODO: Don't load the sequences for assets that are not used in this tileset. Maybe use the existing EditorTilesetFilters. SequenceProvider.Initialize(Manifest.Sequences, map.Sequences); VoxelProvider.Initialize(Manifest.VoxelSequences, map.VoxelSequences); return(map); }
public Map FindMapByUid(string uid) { return(AvailableMaps.ContainsKey(uid) ? AvailableMaps[uid] : null); }