diff --git a/GeneralMods/AdditionalCropsFramework/Framework/Utilities.cs b/GeneralMods/AdditionalCropsFramework/Framework/Utilities.cs index 5e61480a..3a2371bc 100644 --- a/GeneralMods/AdditionalCropsFramework/Framework/Utilities.cs +++ b/GeneralMods/AdditionalCropsFramework/Framework/Utilities.cs @@ -917,12 +917,10 @@ namespace AdditionalCropsFramework { Vector2 vector2 = new Vector2((float)xTile, (float)yTile); - if (Game1.player.CurrentItem == null) - { - // Game1.player.animateOnce(279 + Game1.player.facingDirection); + Game1.player.animateOnce(279 + Game1.player.facingDirection); // StardustCore.Utilities.animateOnce(Game1.player, 279 + Game1.player.facingDirection, 10f, 6, null, false, false, false); - } - Game1.player.canMove = false; + + Game1.player.canMove = true; Game1.playSound("harvest"); DelayedAction.playSoundAfterDelay("coin", 260); if (c.regrowAfterHarvest == -1) @@ -960,7 +958,7 @@ namespace AdditionalCropsFramework if (Game1.player.addItemToInventoryBool((Item)@object, false)) { Vector2 vector2 = new Vector2((float)xTile, (float)yTile); - Game1.player.animateOnce(279 + Game1.player.facingDirection); + // Game1.player.animateOnce(279 + Game1.player.facingDirection); // Game1.player.canMove = false; Game1.playSound("harvest"); DelayedAction.playSoundAfterDelay("coin", 260); @@ -1050,7 +1048,7 @@ namespace AdditionalCropsFramework Vector2 vector2 = new Vector2((float)xTile, (float)yTile); if (junimoHarvester == null) { - Game1.player.animateOnce(279 + Game1.player.facingDirection); + // Game1.player.animateOnce(279 + Game1.player.facingDirection); // Game1.player.canMove = false; } else @@ -1119,12 +1117,10 @@ namespace AdditionalCropsFramework if (Game1.player.addItemToInventoryBool(I, false)) { Vector2 vector2 = new Vector2((float)xTile, (float)yTile); - if (Game1.player.CurrentItem == null) - { - // Game1.player.animateOnce(279 + Game1.player.facingDirection); + Game1.player.animateOnce(279 + Game1.player.facingDirection); // StardustCore.Utilities.animateOnce(Game1.player, 279 + Game1.player.facingDirection, 10f, 6, null, false, false, false); - } - Game1.player.canMove = false; + + Game1.player.canMove = true; Game1.playSound("harvest"); DelayedAction.playSoundAfterDelay("coin", 260); if (c.regrowAfterHarvest == -1) @@ -1165,7 +1161,7 @@ namespace AdditionalCropsFramework if (Game1.player.addItemToInventoryBool((Item)@object, false)) { Vector2 vector2 = new Vector2((float)xTile, (float)yTile); - Game1.player.animateOnce(279 + Game1.player.facingDirection); + // Game1.player.animateOnce(279 + Game1.player.facingDirection); //Game1.player.canMove = false; Game1.playSound("harvest"); DelayedAction.playSoundAfterDelay("coin", 260); @@ -1264,7 +1260,7 @@ namespace AdditionalCropsFramework Vector2 vector2 = new Vector2((float)xTile, (float)yTile); if (junimoHarvester == null) { - Game1.player.animateOnce(279 + Game1.player.facingDirection); + // Game1.player.animateOnce(279 + Game1.player.facingDirection); //Game1.player.canMove = false; } else diff --git a/GeneralMods/AdditionalCropsFramework/ModularCrop.cs b/GeneralMods/AdditionalCropsFramework/ModularCrop.cs index d91a8ea6..a7ebe51a 100644 --- a/GeneralMods/AdditionalCropsFramework/ModularCrop.cs +++ b/GeneralMods/AdditionalCropsFramework/ModularCrop.cs @@ -206,7 +206,7 @@ namespace StardewValley if (Game1.player.addItemToInventoryBool((Item)@object, false)) { Vector2 vector2 = new Vector2((float)xTile, (float)yTile); - Game1.player.animateOnce(279 + Game1.player.facingDirection); + // Game1.player.animateOnce(279 + Game1.player.facingDirection); Game1.player.canMove = false; Game1.playSound("harvest"); DelayedAction.playSoundAfterDelay("coin", 260); @@ -288,7 +288,7 @@ namespace StardewValley Vector2 vector2 = new Vector2((float)xTile, (float)yTile); if (junimoHarvester == null) { - Game1.player.animateOnce(279 + Game1.player.facingDirection); + // Game1.player.animateOnce(279 + Game1.player.facingDirection); Game1.player.canMove = false; } else diff --git a/GeneralMods/AdditionalCropsFramework/PlanterBox.cs b/GeneralMods/AdditionalCropsFramework/PlanterBox.cs index 6f231d90..78325397 100644 --- a/GeneralMods/AdditionalCropsFramework/PlanterBox.cs +++ b/GeneralMods/AdditionalCropsFramework/PlanterBox.cs @@ -296,6 +296,22 @@ namespace AdditionalCropsFramework { Game1.mouseCursor = 2; } + if (this.crop != null) + { + if (Utilities.isCropFullGrown(this.crop)) + { + StardustCore.Utilities.drawGreenPlus(); + } + } + if (this.modularCrop != null) + { + + if (this.modularCrop.isFullyGrown()) + { + Log.AsyncC("hi!"); + StardustCore.Utilities.drawGreenPlus(); + } + } } @@ -342,7 +358,7 @@ namespace AdditionalCropsFramework //this.modularCrop = null; if (f == true && this.modularCrop.regrowAfterHarvest == -1) this.modularCrop = null; // Log.AsyncO("HARVEST"); - return false; + return true; } else { @@ -350,10 +366,6 @@ namespace AdditionalCropsFramework } } } - - - - Game1.playSound("coin"); return true; } else @@ -915,6 +927,9 @@ namespace AdditionalCropsFramework ModCore.ModMonitor.Log(err.ToString()); } } + + // spriteBatch.Draw(Game1.mouseCursors, Game1.GlobalToLocal(Game1.viewport, new Vector2((float)((double)tileLocation.X * (double)Game1.tileSize + (((double)tileLocation.X * 11.0 + (double)tileLocation.Y * 7.0) % 10.0 - 5.0)) + (float)(Game1.tileSize / 2), (float)((double)tileLocation.Y * (double)Game1.tileSize + (((double)tileLocation.Y * 11.0 + (double)tileLocation.X * 7.0) % 10.0 - 5.0)) + (float)(Game1.tileSize / 2))), new Rectangle?(new Rectangle((int)((double)tileLocation.X * 51.0 + (double)tileLocation.Y * 77.0) % 3 * 16, 128 + this.whichForageCrop * 16, 16, 16)), Color.White, 0.0f, new Vector2(8f, 8f), (float)Game1.pixelZoom, SpriteEffects.None, (float)(((double)tileLocation.Y * (double)Game1.tileSize + (double)(Game1.tileSize / 2) + (((double)tileLocation.Y * 11.0 + (double)tileLocation.X * 7.0) % 10.0 - 5.0)) / 10000.0)); + if (this.heldObject != null) { if (this.heldObject is PlanterBox) diff --git a/GeneralMods/StardustCore/Utilities.cs b/GeneralMods/StardustCore/Utilities.cs index b3b5a3b4..f12b2962 100644 --- a/GeneralMods/StardustCore/Utilities.cs +++ b/GeneralMods/StardustCore/Utilities.cs @@ -728,107 +728,17 @@ namespace StardustCore else return false; } - public static void animateOnce(StardewValley.Farmer player,int whichAnimation, float animationInterval, int numberOfFrames, AnimatedSprite.endOfAnimationBehavior endOfBehaviorFunction, bool flip, bool secondaryArm, bool backwards) + public static void drawGreenPlus() { - - if (player.FarmerSprite.PauseForSingleAnimation || player.FarmerSprite.freezeUntilDialogueIsOver) - return; - if (!player.IsMainPlayer) + try { - if (whichAnimation <= 240) - { - if (whichAnimation != 232) - { - if (whichAnimation == 240) - { - player.faceDirection(1); - goto label_16; - } - } - else - { - player.faceDirection(2); - goto label_16; - } - } - else if (whichAnimation != 248) - { - if (whichAnimation == 256) - { - player.faceDirection(3); - goto label_16; - } - } - else - { - player.faceDirection(0); - goto label_16; - } - int direction = whichAnimation / 8 % 4; - switch (direction) - { - case 0: - direction = 2; - break; - case 2: - direction = 0; - break; - } - player.faceDirection(direction); + Game1.spriteBatch.Draw(Game1.mouseCursors, new Vector2(Game1.getMouseX() + 34, Game1.getMouseY() + 34), new Microsoft.Xna.Framework.Rectangle(0, 410, 17, 17), Color.White, 0, new Vector2(0, 0), 2f, Microsoft.Xna.Framework.Graphics.SpriteEffects.None, 0); } - label_16: - player.FarmerSprite.setCurrentSingleAnimation(whichAnimation); - player.FarmerSprite.CurrentFrame = player.FarmerSprite.CurrentSingleAnimation; - player.FarmerSprite.PauseForSingleAnimation = true; - player.FarmerSprite.oldFrame = player.FarmerSprite.CurrentFrame; - // player.FarmerSprite.oldInterval = player.FarmerSprite.interval; - player.FarmerSprite.currentSingleAnimationInterval = animationInterval; - // player.FarmerSprite.endOfAnimationFunction = endOfBehaviorFunction; - player.FarmerSprite.timer = 0.0f; - player.FarmerSprite.animatingBackwards = false; - if (backwards) + catch(Exception e) { - player.FarmerSprite.animatingBackwards = true; - player.FarmerSprite.setCurrentFrameBackwards( player.FarmerSprite.CurrentSingleAnimation, 0, (int)animationInterval, numberOfFrames, secondaryArm, flip); - } - else - player.FarmerSprite.setCurrentFrame( player.FarmerSprite.CurrentSingleAnimation, 0, (int)animationInterval, numberOfFrames, secondaryArm, flip); - if ( player.FarmerSprite.CurrentAnimation[0].frameBehavior != null && ! player.FarmerSprite.CurrentAnimation[0].behaviorAtEndOfFrame) - player.FarmerSprite.CurrentAnimation[0].frameBehavior( player); - if ((double) player.Stamina <= 0.0 && player.usingTool) - { - for (int index = 0; index < player.FarmerSprite.CurrentAnimation.Count; ++index) - player.FarmerSprite.CurrentAnimation[index] = new FarmerSprite.AnimationFrame( player.FarmerSprite.CurrentAnimation[index].frame, player.FarmerSprite.CurrentAnimation[index].milliseconds * 2, player.FarmerSprite.CurrentAnimation[index].secondaryArm, player.FarmerSprite.CurrentAnimation[index].flip, player.FarmerSprite.CurrentAnimation[index].frameBehavior, player.FarmerSprite.CurrentAnimation[index].behaviorAtEndOfFrame); - } - // player.FarmerSprite.CurrentAnimationFrame = player.FarmerSprite.CurrentAnimation.Count; - player.FarmerSprite.indexInCurrentAnimation = 0; - player.FarmerSprite.interval = (float) player.FarmerSprite.CurrentAnimationFrame.milliseconds; - if (Game1.IsClient && player.uniqueMultiplayerID == Game1.player.uniqueMultiplayerID) - { - player.CurrentToolIndex = -1; - if ( player.UsingTool) - { - player.CurrentToolIndex = player.CurrentTool.CurrentParentTileIndex; - if ( player.CurrentTool is FishingRod) - player.CurrentToolIndex = player.facingDirection == 3 || player.facingDirection == 1 ? 55 : 48; - } - MultiplayerUtility.sendAnimationMessageToServer(whichAnimation, numberOfFrames, animationInterval, false, player.CurrentToolIndex); - } - else if (Game1.IsServer) - { - if ( player.IsMainPlayer && player.UsingTool) - { - player.CurrentToolIndex = player.CurrentTool.CurrentParentTileIndex; - if ( player.CurrentTool is FishingRod) - player.CurrentToolIndex = player.facingDirection == 3 || player.facingDirection == 1 ? 55 : 48; - } - MultiplayerUtility.broadcastFarmerAnimation( player.uniqueMultiplayerID, whichAnimation, numberOfFrames, animationInterval, false, player.currentLocation.name, player.CurrentToolIndex); - } - if (!Game1.IsMultiplayer || player.FarmerSprite.getWeaponTypeFromAnimation() != 3) - return; - MeleeWeapon.doSwipe( player.FarmerSprite.getWeaponTypeFromAnimation(), player.position, player.facingDirection, animationInterval, player); - } + } + } }