diff --git a/ModEntry.cs b/ModEntry.cs index 65fc8ad..497a551 100644 --- a/ModEntry.cs +++ b/ModEntry.cs @@ -30,14 +30,18 @@ public override void Entry(IModHelper helper) dumpAllButton = new(helper.ModContent.Load("assets/dumpButton.png"), new(0, 0, 16, 16)) { BoxDraw = false, - Tooltip = "Dump All" + Tooltip = "Dump All", + HoveredSound = string.Empty, + ClickedSound = "Ship" }; root.AddChild(dumpAllButton); stealAllButton = new(helper.ModContent.Load("assets/stealButton.png"), new(0, 0, 16, 16)) { BoxDraw = false, - Tooltip = "Take All" + Tooltip = "Take All", + HoveredSound = string.Empty, + ClickedSound = "Ship" }; root.AddChild(stealAllButton); } @@ -68,21 +72,23 @@ private void OnMenuChanged(object? sender, MenuChangedEventArgs e) activeItemGrabMenu = itemGrabmenu; stealAllButton.Callback = (e) => { + int log_grabMenuItemCount = itemGrabmenu.ItemsToGrabMenu.actualInventory.Count; var grabableInv = itemGrabmenu.ItemsToGrabMenu.actualInventory; for (int i = 0; i < grabableInv.Count; i++) { grabableInv[i] = Game1.player.addItemToInventory(grabableInv[i]); } - Monitor.Log($"{Game1.player.Name} used TakeAll on {itemGrabmenu.context.GetType().Name}. {itemGrabmenu.ItemsToGrabMenu.actualInventory.Count} -> {Game1.player.Items}"); + Monitor.Log($"{Game1.player.Name} used TakeAll on {itemGrabmenu.context.GetType().Name}. {log_grabMenuItemCount} -> {Game1.player.Items.CountItemStacks()}"); }; dumpAllButton.Callback = (e) => { + int log_playerItemCount = Game1.player.Items.CountItemStacks(); var playerInv = itemGrabmenu.inventory.actualInventory; for (int i = 0; i < playerInv.Count; i++) { - playerInv[i] = itemGrabmenu.ItemsToGrabMenu.tryToAddItem(playerInv[i]); + playerInv[i] = itemGrabmenu.ItemsToGrabMenu.tryToAddItem(playerInv[i], string.Empty); //Weird af fix //Probably due to Stardew skipping slots if actualInventory is smaller than @@ -90,11 +96,11 @@ private void OnMenuChanged(object? sender, MenuChangedEventArgs e) if (playerInv[i] != null && playerInv[i].Stack != 0 && itemGrabmenu.ItemsToGrabMenu.actualInventory.Count < itemGrabmenu.ItemsToGrabMenu.capacity) { itemGrabmenu.ItemsToGrabMenu.actualInventory.Add(null); - playerInv[i] = itemGrabmenu.ItemsToGrabMenu.tryToAddItem(playerInv[i]); + playerInv[i] = itemGrabmenu.ItemsToGrabMenu.tryToAddItem(playerInv[i], string.Empty); } } - Monitor.Log($"{Game1.player.Name} used DumpAll on {itemGrabmenu.context.GetType().Name}. {Game1.player.Items} -> {itemGrabmenu.ItemsToGrabMenu.actualInventory.Count}"); + Monitor.Log($"{Game1.player.Name} used DumpAll on {itemGrabmenu.context.GetType().Name}. {Game1.player.Items.CountItemStacks()} -> {itemGrabmenu.ItemsToGrabMenu.actualInventory.Count}"); }; RepositionButtons(); diff --git a/manifest.json b/manifest.json index c394322..7ed26a5 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "Name": "Valley Chests", "Author": "Dannode36", - "Version": "0.1.0", + "Version": "1.0.0", "Description": "", "UniqueID": "Dannode36.ValleyChests", "EntryDll": "ValleyChests.dll",