Exemplo n.º 1
0
        public override bool placementAction(GameLocation location, int x, int y, Farmer who = null)
        {
            CustomWallsAndFloorsMod.skip = true;

            initTilesheet(ref who.currentLocation.map);

            if (who == null)
            {
                who = Game1.player;
            }
            if (who.currentLocation is DecoratableLocation dec)
            {
                if (isFloor)
                {
                    floorChange = (r, w) => Floor_OnChange(r, w, dec);
                    base.placementAction(location, x, y, who);
                    dec.floor.OnChange += floorChange;
                }
                else
                {
                    wallChange = (r, w) => WallPaper_OnChange(r, w, dec);
                    base.placementAction(location, x, y, who);
                    dec.wallPaper.OnChange += wallChange;
                }
            }

            PyTK.PyUtils.setDelayedAction(500, () => CustomWallsAndFloorsMod.skip = false);
            return(base.placementAction(location, x, y, who));
        }
Exemplo n.º 2
0
        public void setChangeEventsAfterLoad(DecoratableLocation dec, int whichRoom)
        {
            CustomWallsAndFloorsMod.skip = true;

            if (isFloor)
            {
                floorChange = (r, w) => Floor_OnChange(r, w, dec);
                dec.setFloor((int)((NetFieldBase <int, NetInt>) this.parentSheetIndex), whichRoom, true);
                dec.floor.OnChange += floorChange;
            }
            else
            {
                wallChange = (r, w) => WallPaper_OnChange(r, w, dec);
                dec.setWallpaper((int)((NetFieldBase <int, NetInt>) this.parentSheetIndex), whichRoom, true);
                dec.wallPaper.OnChange += wallChange;
            }

            PyTK.PyUtils.setDelayedAction(500, () => CustomWallsAndFloorsMod.skip = false);

            if (isFloor)
            {
                dec.setFloor((int)((NetFieldBase <int, NetInt>) this.parentSheetIndex), whichRoom, true);
            }
            else
            {
                dec.setWallpaper((int)((NetFieldBase <int, NetInt>) this.parentSheetIndex), whichRoom, true);
            }
        }