/// <summary>
 /// Used to check if the Dresser has been interacted with.
 /// </summary>
 /// <param name="button">The button that was pressed</param>
 public void DresserInteractCheck(SButton button)
 {
     if (CanPlayerOpenMenu(button))
     {
         Menu.TakeSnapshot();
         ChangePlayerDirection();
     }
 }
        /// <summary>Used to check if the Dresser has been interacted with</summary>
        /// <param name="button">The button that was pressed</param>
        public void DresserInteractCheck(SButton button)
        {
            //Check if they are in the Farmhouse, they're free, they clicked the right button and the menu is null
            if (Game1.player.currentLocation == FarmHouse && Context.IsPlayerFree && Game1.player.GetGrabTile() == new Vector2(DresserPosition.X, DresserPosition.Y + 1) && IsActionButton(button) && Game1.activeClickableMenu == null)
            {
                //Take a snapshot of the player
                Menu.TakeSnapshot();

                //Change the player direction and stop whatever they were doing, set the menu
                Game1.player.faceDirection(2);
                Game1.player.FarmerSprite.StopAnimation();
                Game1.player.completelyStopAnimatingOrDoingAction();
                Game1.activeClickableMenu = Menu;
            }
        }
Beispiel #3
0
        /// <summary>
        /// Check If the Glam Menu Can Be Opened.
        /// </summary>
        /// <param name="sender">Sender Object</param>
        /// <param name="e">Button Pressed Event</param>
        public void CheckJsonInput(object sender, ButtonPressedEventArgs e)
        {
            if (Context.IsWorldReady && Game1.currentLocation != null && Game1.activeClickableMenu == null && IsActionButton(e.Button))
            {
                GameLocation location = Game1.currentLocation;

                Vector2 currentTile = Entry.Helper.Input.GetCursorPosition().GrabTile;
                location.Objects.TryGetValue(currentTile, out StardewValley.Object craftable);
                if (craftable != null && craftable.bigCraftable.Value)
                {
                    if (craftable.ParentSheetIndex.Equals(DresserAssetId))
                    {
                        Menu.TakeSnapshot();
                        Entry.ChangePlayerDirection();
                        Entry.OpenGlamMenu();
                    }
                }
            }
        }