From a34ba8f41d5f52e65e88531ef44ec58cda93b2db Mon Sep 17 00:00:00 2001 From: Mohammad Shoaib Date: Fri, 4 Feb 2022 17:23:26 +0530 Subject: [PATCH] bug fixes --- stardew-access/CustomCommands.cs | 10 ++++------ stardew-access/Patches/BuildingNAnimalMenuPatches.cs | 4 +++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stardew-access/CustomCommands.cs b/stardew-access/CustomCommands.cs index 8e05ddd..70bef73 100644 --- a/stardew-access/CustomCommands.cs +++ b/stardew-access/CustomCommands.cs @@ -297,7 +297,7 @@ namespace stardew_access string? indexInString = args.ElementAtOrDefault(0); if (indexInString == null) { - MainClass.Monitor.Log("Enter the index too! Example syntax: mark 0, here 0 is the index and it can be from 0 to 9 only", LogLevel.Info); + MainClass.Monitor.Log("Enter the index too!", LogLevel.Info); return; } @@ -328,12 +328,11 @@ namespace stardew_access if (toPrint == "") MainClass.Monitor.Log("No positions marked!", LogLevel.Info); else - MainClass.Monitor.Log($"Marked positions:\n{toPrint}\nOpen command menu and use pageup and pagedown to check the list", LogLevel.Info); + MainClass.Monitor.Log($"Marked positions:{toPrint}\nOpen command menu and use pageup and pagedown to check the list", LogLevel.Info); }); helper.ConsoleCommands.Add("buildlist", "List all buildings for selection for upgrading/demolishing/painting", (string commmand, string[] args) => { - MainClass.Monitor.Log($"{Game1.activeClickableMenu is PurchaseAnimalsMenu}\t{BuildingNAnimalMenuPatches.isOnFarm}", LogLevel.Debug); if ((Game1.activeClickableMenu is not CarpenterMenu && Game1.activeClickableMenu is not PurchaseAnimalsMenu) || !BuildingNAnimalMenuPatches.isOnFarm) { MainClass.Monitor.Log($"Cannot list buildings.", LogLevel.Info); @@ -367,7 +366,6 @@ namespace stardew_access helper.ConsoleCommands.Add("buildsel", "Select the building index which you want to upgrade/demolish/paint", (string commmand, string[] args) => { - if ((Game1.activeClickableMenu is not CarpenterMenu && Game1.activeClickableMenu is not PurchaseAnimalsMenu) || !BuildingNAnimalMenuPatches.isOnFarm) { MainClass.Monitor.Log($"Cannot select building.", LogLevel.Info); @@ -419,7 +417,7 @@ namespace stardew_access } } } - else if (BuildingNAnimalMenuPatches.isConstructing) + else if (BuildingNAnimalMenuPatches.isConstructing && !BuildingNAnimalMenuPatches.isUpgrading) { if (BuildingNAnimalMenuPatches.marked[index] == Vector2.Zero) { @@ -441,7 +439,7 @@ namespace stardew_access if (Game1.activeClickableMenu is PurchaseAnimalsMenu) { BuildingNAnimalMenuPatches.PurchaseAnimal(BuildingNAnimalMenuPatches.availableBuildings[index]); } else { - if (BuildingNAnimalMenuPatches.isConstructing) { response = BuildingNAnimalMenuPatches.Contstruct(BuildingNAnimalMenuPatches.marked[index]); } + if (BuildingNAnimalMenuPatches.isConstructing && !BuildingNAnimalMenuPatches.isUpgrading) { response = BuildingNAnimalMenuPatches.Contstruct(BuildingNAnimalMenuPatches.marked[index]); } else if (BuildingNAnimalMenuPatches.isMoving) { response = BuildingNAnimalMenuPatches.Move(BuildingNAnimalMenuPatches.availableBuildings[index], BuildingNAnimalMenuPatches.marked[positionIndex]); } else if (BuildingNAnimalMenuPatches.isDemolishing) { response = BuildingNAnimalMenuPatches.Demolish(BuildingNAnimalMenuPatches.availableBuildings[index]); } else if (BuildingNAnimalMenuPatches.isUpgrading) { response = BuildingNAnimalMenuPatches.Upgrade(BuildingNAnimalMenuPatches.availableBuildings[index]); } diff --git a/stardew-access/Patches/BuildingNAnimalMenuPatches.cs b/stardew-access/Patches/BuildingNAnimalMenuPatches.cs index 0545344..513e453 100644 --- a/stardew-access/Patches/BuildingNAnimalMenuPatches.cs +++ b/stardew-access/Patches/BuildingNAnimalMenuPatches.cs @@ -133,6 +133,8 @@ namespace stardew_access.Patches string description = currentBluprint.description; string price = $"{___price}g"; string blueprintInfo; + int width = currentBluprint.tilesWidth; + int height = currentBluprint.tilesHeight; #region Get ingredients for (int i = 0; i < ___ingredients.Count; i++) @@ -159,7 +161,7 @@ namespace stardew_access.Patches } #endregion - blueprintInfo = $"{name}, Price: {price}, Ingredients: {ingredients}, Description: {description}"; + blueprintInfo = $"{name}, Price: {price}, Ingredients: {ingredients}, Dimensions: {width} width and {height} height, Description: {description}"; if (isBPressed && !isSayingBlueprintInfo) {