Пример #1
0
        public override bool NewRightClick(int tX, int tY)
        {
            Player           player    = Main.LocalPlayer;
            CampingModPlayer modPlayer = player.GetModPlayer <CampingModPlayer>();

            int logic = GetTileLogic(tX, tY);


            // https://github.com/tModLoader/tModLoader/blob/master/ExampleMod/Tiles/ExampleChest.cs

            switch (logic)
            {
            case ItemID.PiggyBank:
                TileUtils.TogglePiggyBank(tX, tY, player);
                break;

            case ItemID.Safe:
                TileUtils.ToggleSafe(tX, tY, player);
                break;

            case ItemID.GPS:
                TileUtils.DisplayTimeInChat();
                break;

            default:
                TileUtils.GetTentSpawnPosition(tX, tY, out int spawnX, out int spawnY, _FRAMEWIDTH, _FRAMEHEIGHT, 6, -2);
                TileUtils.ToggleTemporarySpawnPoint(modPlayer, spawnX, spawnY);
                break;
            }
            return(true);
        }
Пример #2
0
        public override bool NewRightClick(int tX, int tY)
        {
            Player           player    = Main.LocalPlayer;
            CampingModPlayer modPlayer = player.GetModPlayer <CampingModPlayer>();

            TileUtils.GetTentSpawnPosition(tX, tY, out int spawnX, out int spawnY, _FRAMEWIDTH, _FRAMEHEIGHT, 2);
            TileUtils.ToggleTemporarySpawnPoint(modPlayer, spawnX, spawnY);
            return(true);
        }