diff --git a/BiggerBackpack/BiggerBackpack.sln b/BiggerBackpack/BiggerBackpack.sln new file mode 100644 index 0000000..c3e1935 --- /dev/null +++ b/BiggerBackpack/BiggerBackpack.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BiggerBackpack", "BiggerBackpack.csproj", "{EF98F916-0992-7BCD-20DE-73C8AABC795E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EF98F916-0992-7BCD-20DE-73C8AABC795E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EF98F916-0992-7BCD-20DE-73C8AABC795E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EF98F916-0992-7BCD-20DE-73C8AABC795E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EF98F916-0992-7BCD-20DE-73C8AABC795E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {C69AA91B-64F0-4848-88A0-FB6BBFA147A3} + EndGlobalSection +EndGlobal diff --git a/BiggerBackpack/ModEntry.cs b/BiggerBackpack/ModEntry.cs index e929170..342ddad 100644 --- a/BiggerBackpack/ModEntry.cs +++ b/BiggerBackpack/ModEntry.cs @@ -14,8 +14,8 @@ namespace BiggerBackpack { public class ModConfig { - /** How much you have to pay to buy this backpack in the shop. (default = 50000).*/ - public int BackpackCost = 50000; + /** How much you have to pay to buy this backpack in the shop. (default = 100000).*/ + public int BackpackCost = 100000; } public class ModEntry : HackWithConfig @@ -63,8 +63,9 @@ private void command( string cmd, string[] args ) case "24": newMax = 24; break; case "36": newMax = 36; break; case "48": newMax = 48; break; + case "60": newMax = 60; break; default: - Monitor.Log("The new size must be 12, 24, 36 or 48.", LogLevel.Error); + Monitor.Log("The new size must be 12, 24, 36, 48 or 60.", LogLevel.Error); return; } @@ -120,7 +121,7 @@ void SeedShop_draw() { Instructions.Call_get(typeof(Game1), nameof(Game1.player)), Instructions.Ldfld(typeof(Farmer), nameof(Farmer.maxItems)), check[2], // Nothing jumps here so reusing this should be OK. - Instructions.Ldc_I4_S(48), + Instructions.Ldc_I4_S(60), check[4], // We'll create a new jump in check later. // drawBiggerBackpack(b); Instructions.Ldarg_1(), @@ -156,7 +157,7 @@ void SpecialItem_getTemporarySpriteForHoldingUp() { Instructions.Call_get(typeof(Game1), nameof(Game1.player)), Instructions.Ldfld(typeof(Farmer), nameof(Farmer.maxItems)), code[3], // Nothing jumps here so reusing this should be OK. - Instructions.Ldc_I4_S(48), + Instructions.Ldc_I4_S(60), Instructions.Bne_Un(AttachLabel(code[0])), // return getBackpackSprite(position); Instructions.Ldarg_1(), @@ -195,7 +196,7 @@ void GameLocation_performAction() { Instructions.Call_get(typeof(Game1), nameof(Game1.player)), Instructions.Ldfld(typeof(Farmer), nameof(Farmer.maxItems)), code[2], - Instructions.Ldc_I4_S(48), + Instructions.Ldc_I4_S(60), code[4], Instructions.Call(typeof(ModEntry), nameof(clickBackpack)), Instructions.Br((Label)code[len-1].operand) @@ -231,7 +232,7 @@ void GameLocation_answerDialogueAction() { Instructions.Call_get(typeof(Game1), nameof(Game1.player)), Instructions.Ldfld(typeof(Farmer), nameof(Farmer.maxItems)), code[2], - Instructions.Ldc_I4_S(48), + Instructions.Ldc_I4_S(60), Instructions.Bge(AttachLabel(get_player)), // && Game1.player.Money >= Mod.getBackpackCost()) { Instructions.Call_get(typeof(Game1), nameof(Game1.player)), @@ -245,7 +246,7 @@ void GameLocation_answerDialogueAction() { get_player, Instructions.Ldfld(typeof(Farmer), nameof(Farmer.maxItems)), code[2], - Instructions.Ldc_I4_S(48), + Instructions.Ldc_I4_S(60), code[4] ); } @@ -255,12 +256,12 @@ void GameLocation_answerDialogueAction() { #region Resize GUI public static void shiftIconsDown(List equipmentIcons){ foreach (var icon in equipmentIcons) { - icon.bounds.Y += Game1.tileSize; + icon.bounds.Y += Game1.tileSize * 2; } } void resize_inventory() { - // Change inventory size from default (36) to 48 + // Change inventory size from default (36) to 60 var inv = FindCode( OpCodes.Ldc_I4_M1, // Size (-1 = default) OpCodes.Ldc_I4_3, // Rows @@ -268,15 +269,15 @@ void resize_inventory() { OpCodes.Ldc_I4_0, OpCodes.Ldc_I4_1 ); - inv[0] = Instructions.Ldc_I4(48); - inv[1] = Instructions.Ldc_I4_4(); + inv[0] = Instructions.Ldc_I4(60); + inv[1] = Instructions.Ldc_I4_5(); } void InventoryPage_ctor() { BeginCode().Prepend( // height += Game1.tileSize; Instructions.Ldarg_S(4), - Instructions.Ldc_I4_S(Game1.tileSize), + Instructions.Ldc_I4(Game1.tileSize * 2), Instructions.Add(), Instructions.Starg_S(4) ); @@ -321,7 +322,7 @@ void InventoryPage_draw() { Instructions.Add(), Instructions.Ldsfld(typeof(IClickableMenu), nameof(IClickableMenu.spaceToClearTopBorder)), Instructions.Add(), - Instructions.Ldc_I4_S(Game1.tileSize), + Instructions.Ldc_I4(Game1.tileSize * 2), Instructions.Add(), Instructions.Stloc_S(yoffset) ); @@ -357,7 +358,7 @@ void CraftingPage_ctor() { BeginCode().Prepend( // height += Game1.tileSize; Instructions.Ldarg_S(4), - Instructions.Ldc_I4_S(Game1.tileSize), + Instructions.Ldc_I4(Game1.tileSize * 2), Instructions.Add(), Instructions.Starg_S(4) ); @@ -458,7 +459,7 @@ void ShippingMenu_ctor() { OpCodes.Mul, OpCodes.Add ); - code[0].operand = 600 + Game1.tileSize; + code[0].operand = 600 + Game1.tileSize * 2; } } @@ -537,4 +538,4 @@ protected override void InitializeApi(IGenericModConfigMenuApi api) { } #endregion } -} +} \ No newline at end of file diff --git a/BiggerBackpack/backpack.png b/BiggerBackpack/backpack.png index bbe4846..e5e9a05 100644 Binary files a/BiggerBackpack/backpack.png and b/BiggerBackpack/backpack.png differ diff --git a/BiggerBackpack/i18n/default.json b/BiggerBackpack/i18n/default.json index 32764dd..77b9b3c 100644 --- a/BiggerBackpack/i18n/default.json +++ b/BiggerBackpack/i18n/default.json @@ -1,8 +1,8 @@ { - // Translation provided by: - SetBackpackSizeCommand: "Set the size of the player's backpack. This must be a multiple of 12", - Purchase: "Purchase ({{cost}}g)", - BackpackUpgrade: "Backpack Upgrade -- 48 slots", - PremiumPack: "Premium Pack", - BackpackCostName: "Backpack cost", BackpackCostTooltip: "How much you have to pay to buy this backpack in the shop.", + "SetBackpackSizeCommand": "Set the size of the player's backpack. This must be a multiple of 12", + "Purchase": "Purchase ({{cost}}g)", + "BackpackUpgrade": "Backpack Upgrade -- 60 slots", + "PremiumPack": "Premium Pack", + "BackpackCostName": "Backpack cost", + "BackpackCostTooltip": "How much you have to pay to buy this backpack in the shop." }