示例#1
0
        internal static void React(StardewValley.Farmer who, string[] arguments, Vector2 tile)
        {
            int interval = Convert.ToInt32(arguments[0]);

            int[] indexes = arguments[1].Split(',').Select(e => Convert.ToInt32(e)).ToArray();
            var   layer   = who.currentLocation.Map.GetLayer("Buildings");
            var   source  = layer.Tiles[(int)tile.X, (int)tile.Y];

            xTile.ObjectModel.PropertyValue property = EntoFramework.GetLocationHelper().GetTileProperty(who.currentLocation, "Buildings", (int)tile.X, (int)tile.Y, "Action");
            int delay = interval * indexes.Length;

            EntoFramework.GetLocationHelper().SetAnimatedTile(who.currentLocation, "Buildings", (int)tile.X, (int)tile.Y, indexes, interval, source.TileSheet.Id);
            System.Threading.Timer timer = null;
            timer = new System.Threading.Timer((obj) =>
            {
                EntoFramework.GetLocationHelper().SetStaticTile(who.currentLocation, "Buildings", (int)tile.X, (int)tile.Y, source.TileIndex, source.TileSheet.Id);
                EntoFramework.GetLocationHelper().SetTileProperty(who.currentLocation, "Buildings", (int)tile.X, (int)tile.Y, "Action", property);
                timer.Dispose();
            },
                                               null, delay, System.Threading.Timeout.Infinite);
        }
示例#2
0
 public static void SetTile(this GameLocation self, int x, int y, int index, string layer, string sheet)
 {
     EntoFramework.GetLocationHelper().SetStaticTile(self, layer, x, y, index, sheet);
 }