예제 #1
0
 public void plantModdedCrop(ModularSeeds seeds)
 {
     if (this.modularCrop != null)
     {
         return;
     }
     this.modularCrop = new ModularCrop(this.TextureSheet.getHelper(), seeds.ParentSheetIndex, (int)Game1.currentCursorTile.X, (int)Game1.currentCursorTile.Y, seeds.cropDataFilePath, seeds.cropTextureFilePath, seeds.cropObjectTextureFilePath, seeds.cropObjectDataFilePath);
     Game1.player.reduceActiveItemByOne();
     Game1.playSound("dirtyHit");
 }
예제 #2
0
 public override Item getOne()
 {
     ModularSeeds ExtraSeeds = new ModularSeeds(this.parentSheetIndex, this.texturePath, this.dataFilePath,this.cropTextureFilePath,this.cropDataFilePath,this.cropObjectTextureFilePath,this.cropObjectDataFilePath);
     /*
     drawPosition = this.drawPosition;
     defaultBoundingBox = this.defaultBoundingBox;
     boundingBox = this.boundingBox;
     currentRotation = this.currentRotation - 1;
     rotations = this.rotations;
     rotate();
     */
     return ExtraSeeds;
 }
예제 #3
0
        public static Item ParseIntoInventory(string s)
        {
            // PlanterBox p = new PlanterBox();
            // return p;



            dynamic obj = JObject.Parse(s);

           ModularSeeds d = new ModularSeeds();

            d.dataFilePath = obj.dataFilePath;
            d.cropDataFilePath = obj.cropDataFilePath;
            d.cropObjectDataFilePath = obj.cropObjectDataFilePath;

            

            d.texturePath = obj.texturePath;
            d.cropTextureFilePath = obj.cropTextureFilePath;
            d.cropObjectTextureFilePath = obj.cropObjectTextureFilePath;

            d.price = obj.price;
            d.Decoration_type = obj.Decoration_type;
            d.rotations = obj.rotations;
            d.currentRotation = obj.currentRotation;
            string s1 = Convert.ToString(obj.sourceRect);
            d.sourceRect = Utilities.parseRectFromJson(s1);
            string s2 = Convert.ToString(obj.defaultSourceRect);
            d.defaultSourceRect = Utilities.parseRectFromJson(s2);
            string s3 = Convert.ToString(obj.defaultBoundingBox);
            d.defaultBoundingBox = Utilities.parseRectFromJson(s3);
            d.description = obj.description;
            d.flipped = obj.flipped;
            d.flaggedForPickUp = obj.flaggedForPickUp;
            d.tileLocation = obj.tileLocation;
            d.parentSheetIndex = obj.parentSheetIndex;
            d.owner = obj.owner;
            d.name = obj.name;
            d.type = obj.type;
            d.canBeSetDown = obj.canBeSetDown;
            d.canBeGrabbed = obj.canBeGrabbed;
            d.isHoedirt = obj.isHoedirt;
            d.isSpawnedObject = obj.isSpawnedObject;
            d.questItem = obj.questItem;
            d.isOn = obj.isOn;
            d.fragility = obj.fragility;
            d.edibility = obj.edibility;
            d.stack = obj.stack;
            d.quality = obj.quality;
            d.bigCraftable = obj.bigCraftable;
            d.setOutdoors = obj.setOutdoors;
            d.setIndoors = obj.setIndoors;
            d.readyForHarvest = obj.readyForHarvest;
            d.showNextIndex = obj.showNextIndex;
            d.hasBeenPickedUpByFarmer = obj.hasBeenPickedUpByFarmer;
            d.isRecipe = obj.isRecipe;
            d.isLamp = obj.isLamp;
            d.heldObject = obj.heldObject;
            d.minutesUntilReady = obj.minutesUntilReady;
            string s4 = Convert.ToString(obj.boundingBox);
            d.boundingBox = Utilities.parseRectFromJson(s4);
            d.scale = obj.scale;
            d.lightSource = obj.lightSource;
            d.shakeTimer = obj.shakeTimer;
            d.internalSound = obj.internalSound;
            d.specialVariable = obj.specialVariable;
            d.category = obj.category;
            d.specialItem = obj.specialItem;
            d.hasBeenInInventory = obj.hasBeenInInventory;


            string t = obj.texturePath;
            d.TextureSheet = ModCore.ModHelper.Content.Load<Texture2D>(Path.Combine(Utilities.EntensionsFolderName, t));
            d.texturePath = t;
            d.itemReadyForHarvest = obj.itemReadyForHarvest;
            d.lightsOn = obj.lightsOn;
            d.lightColor = obj.lightColor;
            d.thisType = obj.thisType;
            d.removable = obj.removable;
            d.locationsName = obj.locationsName;

            d.drawColor = obj.drawColor;
            d.serializationName = obj.serializationName;

            /*
            //ANIMATIONS
            var q = obj.animationManager;
            dynamic obj1 = q;
            string name = Convert.ToString(obj1.currentAnimationName);
            int frame = Convert.ToInt32(obj1.currentAnimationListIndex);
            PlanterBox dummy = new PlanterBox(d.parentSheetIndex, d.tileLocation, d.texturePath, d.dataPath, d.removable, d.IsSolid);
            d.animationManager = dummy.animationManager;
            bool f = d.animationManager.setAnimation(name, frame);
            bool f2;
            if (f == false)
            {
                f2 = d.animationManager.setAnimation(name, 0);
                if (f2 == false) d.animationManager.currentAnimation = d.animationManager.defaultDrawFrame;
            }
            // Log.AsyncC(d.cropInformationString);
            */
            
            //ModularCrop f=  j.ToObject<ModularCrop>();
            //ModularCrop f = obj.modularCrop;

            // Log.AsyncG("THIS IS CROP: " + c.indexOfHarvest);
            //Log.AsyncG(cropString);


            // d.crop = obj.crop;
            // d.modularCrop = obj.modularCrop;


            try
            {
                return d;
            }
            catch (Exception e)
            {
                // Log.AsyncM(e);
                return null;
            }

            //return base.ParseIntoInventory();
        }