bug fix in snapping mouse to primary and secondary inventory slots
parent
6141447c13
commit
9096ce59b9
|
@ -43,20 +43,20 @@ namespace stardew_access.Patches
|
|||
|
||||
private static void handleKeyBinds(CraftingPage __instance, int ___currentCraftingPage)
|
||||
{
|
||||
if (MainClass.Config.SnapToFirstInventorySlotKey.JustPressed() && __instance.inventory.inventory.Count > 0)
|
||||
{
|
||||
// snap to first inventory slot
|
||||
__instance.setCurrentlySnappedComponentTo(__instance.inventory.inventory[0].myID);
|
||||
__instance.inventory.inventory[0].snapMouseCursorToCenter();
|
||||
currentSelectedCraftingRecipe = -1;
|
||||
}
|
||||
else if (MainClass.Config.SnapToFirstSecondaryInventorySlotKey.JustPressed() && __instance.pagesOfCraftingRecipes[___currentCraftingPage].Count > 0)
|
||||
if (MainClass.Config.SnapToFirstSecondaryInventorySlotKey.JustPressed() && __instance.pagesOfCraftingRecipes[___currentCraftingPage].Count > 0)
|
||||
{
|
||||
// snap to first crafting recipe
|
||||
__instance.setCurrentlySnappedComponentTo(__instance.pagesOfCraftingRecipes[___currentCraftingPage].ElementAt(0).Key.myID);
|
||||
__instance.pagesOfCraftingRecipes[___currentCraftingPage].ElementAt(0).Key.snapMouseCursorToCenter();
|
||||
currentSelectedCraftingRecipe = 0;
|
||||
}
|
||||
else if (MainClass.Config.SnapToFirstInventorySlotKey.JustPressed() && __instance.inventory.inventory.Count > 0)
|
||||
{
|
||||
// snap to first inventory slot
|
||||
__instance.setCurrentlySnappedComponentTo(__instance.inventory.inventory[0].myID);
|
||||
__instance.inventory.inventory[0].snapMouseCursorToCenter();
|
||||
currentSelectedCraftingRecipe = -1;
|
||||
}
|
||||
else if (MainClass.Config.CraftingMenuCycleThroughRecipiesKey.JustPressed() && !isSelectingRecipe)
|
||||
{
|
||||
isSelectingRecipe = true;
|
||||
|
|
|
@ -14,16 +14,16 @@ namespace stardew_access.Patches
|
|||
{
|
||||
int x = Game1.getMouseX(true), y = Game1.getMouseY(true); // Mouse x and y position
|
||||
|
||||
if (MainClass.Config.SnapToFirstInventorySlotKey.JustPressed() && __instance.inventory.inventory.Count > 0)
|
||||
{
|
||||
__instance.setCurrentlySnappedComponentTo(__instance.inventory.inventory[0].myID);
|
||||
__instance.inventory.inventory[0].snapMouseCursorToCenter();
|
||||
}
|
||||
else if (MainClass.Config.SnapToFirstSecondaryInventorySlotKey.JustPressed() && __instance.ItemsToGrabMenu.inventory.Count > 0 && !__instance.shippingBin)
|
||||
if (MainClass.Config.SnapToFirstSecondaryInventorySlotKey.JustPressed() && __instance.ItemsToGrabMenu.inventory.Count > 0 && !__instance.shippingBin)
|
||||
{
|
||||
__instance.setCurrentlySnappedComponentTo(__instance.ItemsToGrabMenu.inventory[0].myID);
|
||||
__instance.ItemsToGrabMenu.inventory[0].snapMouseCursorToCenter();
|
||||
}
|
||||
else if (MainClass.Config.SnapToFirstInventorySlotKey.JustPressed() && __instance.inventory.inventory.Count > 0)
|
||||
{
|
||||
__instance.setCurrentlySnappedComponentTo(__instance.inventory.inventory[0].myID);
|
||||
__instance.inventory.inventory[0].snapMouseCursorToCenter();
|
||||
}
|
||||
|
||||
#region Narrate buttons in the menu
|
||||
if (__instance.okButton != null && __instance.okButton.containsPoint(x, y))
|
||||
|
|
|
@ -14,16 +14,16 @@ namespace stardew_access.Patches
|
|||
{
|
||||
int x = Game1.getMouseX(true), y = Game1.getMouseY(true); // Mouse x and y position
|
||||
|
||||
if (MainClass.Config.SnapToFirstInventorySlotKey.JustPressed() && __instance.inventory.inventory.Count > 0)
|
||||
{
|
||||
__instance.inventory.inventory[0].snapMouseCursorToCenter();
|
||||
__instance.setCurrentlySnappedComponentTo(__instance.inventory.inventory[0].myID);
|
||||
}
|
||||
else if (MainClass.Config.SnapToFirstSecondaryInventorySlotKey.JustPressed() && __instance.forSaleButtons.Count > 0)
|
||||
if (MainClass.Config.SnapToFirstSecondaryInventorySlotKey.JustPressed() && __instance.forSaleButtons.Count > 0)
|
||||
{
|
||||
__instance.forSaleButtons[0].snapMouseCursorToCenter();
|
||||
__instance.setCurrentlySnappedComponentTo(__instance.forSaleButtons[0].myID);
|
||||
}
|
||||
else if (MainClass.Config.SnapToFirstInventorySlotKey.JustPressed() && __instance.inventory.inventory.Count > 0)
|
||||
{
|
||||
__instance.inventory.inventory[0].snapMouseCursorToCenter();
|
||||
__instance.setCurrentlySnappedComponentTo(__instance.inventory.inventory[0].myID);
|
||||
}
|
||||
|
||||
#region Narrate buttons in the menu
|
||||
if (__instance.inventory.dropItemInvisibleButton != null && __instance.inventory.dropItemInvisibleButton.containsPoint(x, y))
|
||||
|
|
Loading…
Reference in New Issue