Пример #1
0
        private void GameEvents_UpdateTick(object s, EventArgs e)
        {
            EnforceSerializer();
            if (!Context.IsWorldReady)
            {
                return;
            }
            if ((Game1.player.CurrentItem == null && this.prevItem != null) || (Game1.player.CurrentItem != null && !Game1.player.CurrentItem.Equals(this.prevItem)))
            {
                MoreEvents.FireActiveItemChanged(new EventArgsActiveItemChanged(this.prevItem, Game1.player.CurrentItem));
                this.prevItem = Game1.player.CurrentItem;
            }
            PlayerModifierHelper._UpdateModifiers();
            Vector2 playerPos = new Vector2(Game1.player.getStandingX() / Game1.tileSize, Game1.player.getStandingY() / Game1.tileSize);

            if (LastTouchAction != playerPos)
            {
                string text = Game1.currentLocation.doesTileHaveProperty((int)playerPos.X, (int)playerPos.Y, "TouchAction", "Back");
                LastTouchAction = playerPos;
                if (text != null)
                {
                    string[] split = (text).Split(' ');
                    string[] args  = new string[split.Length - 1];
                    Array.Copy(split, 1, args, 0, args.Length);
                    this.ActionInfo = new EventArgsActionTriggered(Game1.player, split[0], args, playerPos);
                    MoreEvents.FireTouchActionTriggered(this.ActionInfo);
                }
            }
        }