コード例 #1
0
ファイル: ModEntry.cs プロジェクト: Nanogamer7/StardewMods-1
        internal static void UpdateTilesheets()
        {
            ModEntry.Logger.Log("Month changed, updating custom seasonal tilesheets...", LogLevel.Trace);
            List <string> locations = new List <string>();

            foreach (KeyValuePair <IContentPack, Tilesheet[]> pair in ModEntry.PatchData.SeasonalTilesheets)
            {
                foreach (Tilesheet tilesheet in pair.Value)
                {
                    GameLocation location = Game1.getLocationFromName(tilesheet.MapName);
                    Processors.ApplyTilesheet(ModEntry.SHelper.Content, pair.Key, tilesheet, location.map);
                    if (!locations.Contains(tilesheet.MapName))
                    {
                        locations.Add(tilesheet.MapName);
                    }
                }
            }

            foreach (string map in locations)
            {
                Map location = Game1.getLocationFromName(map).map;
                location.DisposeTileSheets(Game1.mapDisplayDevice);
                location.LoadTileSheets(Game1.mapDisplayDevice);
            }
        }
コード例 #2
0
        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);
            }
        }