public static void ReceiveLeftClick_Postfix(InventoryPage __instance, int x, int y) { try { ConvenientInventory.PostReceiveLeftClickInMenu(__instance, x, y); } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(ReceiveLeftClick_Postfix)}:\n{e}", LogLevel.Error); } }
public static void Draw_Postfix(ShopMenu __instance, SpriteBatch b) { try { ConvenientInventory.PostMenuDraw(__instance, b); } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(Draw_Postfix)}:\n{e}", LogLevel.Error); } }
public static void PerformHoverAction_Postfix(int x, int y) { try { ConvenientInventory.PerformHoverActionInInventoryPage(x, y); } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(PerformHoverAction_Postfix)}:\n{e}", LogLevel.Error); } }
public static void Draw_Postfix(ClickableTextureComponent __instance, SpriteBatch b) { try { ConvenientInventory.PostClickableTextureComponentDraw(__instance, b); } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(Draw_Postfix)}:\n{e}", LogLevel.Error); } }
public static void Postfix(InventoryPage __instance, int x, int y, int width, int height) { try { ConvenientInventory.InventoryPageConstructor(__instance, x, y, width, height); } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(Postfix)}:\n{e}", LogLevel.Error); } }
public static bool ReceiveLeftClick_Prefix(InventoryPage __instance, int x, int y) { try { return(ConvenientInventory.PreReceiveLeftClickInMenu(__instance, x, y)); } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(ReceiveLeftClick_Prefix)}:\n{e}", LogLevel.Error); } return(true); }
public static void Update_Postfix(IClickableMenu __instance, GameTime time) { try { if (__instance is InventoryPage inventoryPage) { ConvenientInventory.Update(time); } } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(Update_Postfix)}:\n{e}", LogLevel.Error); } }
public static void PopulateClickableComponentsList_Postfix(IClickableMenu __instance) { try { if (__instance is InventoryPage inventoryPage) { ConvenientInventory.PopulateClickableComponentsListInInventoryPage(inventoryPage); } } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(PopulateClickableComponentsList_Postfix)}:\n{e}", LogLevel.Error); } }
public static void FillOutStacks_Postfix(ItemGrabMenu __instance, Item[] __state) { if (!ModEntry.Config.IsEnableFavoriteItems) { return; } try { ConvenientInventory.ReinsertExtractedFavoriteItemsIntoList(__state, __instance.inventory.actualInventory, false); } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(FillOutStacks_Postfix)}:\n{e}", LogLevel.Error); } }
public static bool ReduceActiveItemByOne_Prefix(Farmer __instance) { if (!ModEntry.Config.IsEnableFavoriteItems) { return(true); } try { ConvenientInventory.PreFarmerReduceActiveItemByOne(__instance); } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(ReduceActiveItemByOne_Prefix)}:\n{e}", LogLevel.Error); } return(true); }
public static bool FillOutStacks_Prefix(ItemGrabMenu __instance, out Item[] __state) { __state = null; if (!ModEntry.Config.IsEnableFavoriteItems) { return(true); } try { __state = ConvenientInventory.ExtractFavoriteItemsFromList(__instance.inventory.actualInventory); } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(FillOutStacks_Prefix)}:\n{e}", LogLevel.Error); } return(true); }
public static void OrganizeItemsInList_Postfix(ItemGrabMenu __instance, Item[] __state, IList <Item> items) { if (!ModEntry.Config.IsEnableFavoriteItems) { return; } try { // Only call when this is the player's inventory if (items == Game1.player.Items) { ConvenientInventory.ReinsertExtractedFavoriteItemsIntoList(__state, items); } } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(OrganizeItemsInList_Postfix)}:\n{e}", LogLevel.Error); } }
public static void ShiftToolbar_Postfix(Farmer __instance, bool right) { if (!ModEntry.Config.IsEnableFavoriteItems) { return; } try { // Game logic if (__instance.Items == null || __instance.Items.Count < 12 || __instance.UsingTool || Game1.dialogueUp || (!Game1.pickingTool && !Game1.player.CanMove) || __instance.areAllItemsNull() || Game1.eventUp || Game1.farmEvent != null) { return; } ConvenientInventory.ShiftToolbar(right); } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(ShiftToolbar_Postfix)}:\n{e}", LogLevel.Error); } }
public static bool OrganizeItemsInList_Prefix(ItemGrabMenu __instance, out Item[] __state, IList <Item> items) { __state = null; if (!ModEntry.Config.IsEnableFavoriteItems) { return(true); } try { // Only call when this is the player's inventory if (items == Game1.player.Items) { __state = ConvenientInventory.ExtractFavoriteItemsFromList(items); } } catch (Exception e) { ModEntry.Instance.Monitor.Log($"Failed in {nameof(OrganizeItemsInList_Prefix)}:\n{e}", LogLevel.Error); } return(true); }