From 594212a466b687259a03c1b46a617572f5e07dd3 Mon Sep 17 00:00:00 2001 From: Jacob Keller Date: Mon, 27 Jul 2026 16:42:15 -0700 Subject: [PATCH] Expose ShiftRows in the API Add access to read the current ShiftRows value as part of the API of the CustomBackpackFramework API. This enables other mods to behave correctly dependent on the current shift behavior, for example to better interoperate between CBF and Toolbar-Switch. Fixes #6 Signed-off-by: Jacob Keller --- CustomBackpackApi.cs | 5 +++++ Methods.cs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/CustomBackpackApi.cs b/CustomBackpackApi.cs index 5823bb2..b8024e0 100644 --- a/CustomBackpackApi.cs +++ b/CustomBackpackApi.cs @@ -7,6 +7,7 @@ public interface ICustomBackpackApi public bool SetPlayerSlots(int slots, bool force); public bool ChangeScroll(InventoryMenu menu, int delta); public int GetScroll(); + public int GetShiftRows(); } public class CustomBackpackApi : ICustomBackpackApi { @@ -22,5 +23,9 @@ public int GetScroll() { return ModEntry.GetScroll(); } + public int GetShiftRows() + { + return ModEntry.GetShiftRows(); + } } } \ No newline at end of file diff --git a/Methods.cs b/Methods.cs index 1267e2c..3298708 100644 --- a/Methods.cs +++ b/Methods.cs @@ -184,6 +184,11 @@ public static int GetScroll() return scrolled.Value; } + public static int GetShiftRows() + { + return Config?.ShiftRows ?? new ModConfig().ShiftRows; + } + public static void DrawUIElements(SpriteBatch b, InventoryMenu __instance) { int mouseX = Game1.getMouseX();