Adding buildlist command to list all the buildings on the farm for the preferred action
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
using stardew_access.Patches;
|
||||
using StardewModdingAPI;
|
||||
using StardewValley;
|
||||
using StardewValley.Buildings;
|
||||
using StardewValley.Menus;
|
||||
|
||||
namespace stardew_access
|
||||
{
|
||||
@@ -328,6 +330,32 @@ namespace stardew_access
|
||||
else
|
||||
MainClass.monitor.Log($"Marked positions:\t{toPrint}", LogLevel.Info);
|
||||
});
|
||||
|
||||
helper.ConsoleCommands.Add("buildlist", "List all buildings for selection for upgrading/demolishing/painting", (string commmand, string[] args) =>
|
||||
{
|
||||
if (Game1.activeClickableMenu is not CarpenterMenu || !BuildingNAnimalMenuPatches.isOnFarm)
|
||||
{
|
||||
MainClass.monitor.Log($"Cannot list buildings.", LogLevel.Info);
|
||||
return;
|
||||
}
|
||||
|
||||
string toPrint = "";
|
||||
Farm farm = (Farm)Game1.getLocationFromName("Farm");
|
||||
Netcode.NetCollection<Building> buildings = farm.buildings;
|
||||
for (int i = 0; i < buildings.Count; i++)
|
||||
{
|
||||
toPrint = $"{toPrint},\t{buildings[i].nameOfIndoorsWithoutUnique}: At {buildings[i].tileX}x and {buildings[i].tileY}y";
|
||||
}
|
||||
|
||||
if (toPrint == "")
|
||||
{
|
||||
MainClass.monitor.Log("No appropriate buildings to list", LogLevel.Info);
|
||||
}
|
||||
else
|
||||
{
|
||||
MainClass.monitor.Log($"Available buildings: {toPrint}", LogLevel.Info);
|
||||
}
|
||||
});
|
||||
#endregion
|
||||
|
||||
helper.ConsoleCommands.Add("refsr", "Refresh screen reader", (string commmand, string[] args) =>
|
||||
|
||||
Reference in New Issue
Block a user