Generation

generate functionSat, 28 Jan 2023

generate a function for throwing items out of the selected player's inventory slot when the "Q" button is pressed

public static void AddRemoveItemOnQ(this Inventory inv, int slotNum) { Action onQ = null; Action remove = null; onQ = () => { if (!Game1.player.CurrentTool.isHeavyHitter()) { if (Game1.player.Items[slotNum] != null) { Game1.player.Items[slotNum].actionWhenBeingHeld(Game1.player); Game1.player.Items[slotNum] = null; Game1.playSound("coin"); } Game1.onScreenKeyboard.Subscriber = null; Game1.afterDialogues = null; Game1.keyboardDispatcher.Subscriber = null; Game1.player.canMove = true; Game1.player.completelyStopAnimatingOrDoAction(); Game1.player.faceDirection(0); Game1.player.FarmerSprite.StopAnimation(); return; } if (Game1.

Questions about programming?Chat with your personal AI assistant