/// <summary> /// Loads an xTile map into memory. /// </summary> public void LoadMap(string mapDirectory) { Display = new XnaDisplayDevice(Game.Content, Game.GraphicsDevice); Viewport = new xTile.Dimensions.Rectangle(new Size(Game.GraphicsDevice.PresentationParameters.BackBufferWidth, Game.GraphicsDevice.PresentationParameters.BackBufferHeight)); XMap = Game.Content.Load <xTile.Map>(mapDirectory); XMap.LoadTileSheets(Display); }
internal static void UpdateTilesheets() { List <string> locations = new List <string>(); foreach (Tilesheet t in Compound.SeasonalTilesheets) { Processors.ApplyTilesheet(t); if (!locations.Contains(t.MapName)) { locations.Add(t.MapName); } } foreach (string map in locations) { xTile.Map location = Game1.getLocationFromName(map).map; location.DisposeTileSheets(Game1.mapDisplayDevice); location.LoadTileSheets(Game1.mapDisplayDevice); } }
internal static void UpdateTilesheets() { Logger.Log("Month changed, updating custom seasonal tilesheets...", LogLevel.Trace); List <string> locations = new List <string>(); foreach (var pair in ModEntry.PatchData.SeasonalTilesheets) { foreach (var tilesheet in pair.Value) { Processors.ApplyTilesheet(ModEntry.SHelper.Content, pair.Key, tilesheet); if (!locations.Contains(tilesheet.MapName)) { locations.Add(tilesheet.MapName); } } } foreach (string map in locations) { xTile.Map location = Game1.getLocationFromName(map).map; location.DisposeTileSheets(Game1.mapDisplayDevice); location.LoadTileSheets(Game1.mapDisplayDevice); } }