Skip to content

Commit 891091b

Browse files
committed
Improve client patching
1 parent 227a212 commit 891091b

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

OTAPI.Common/ClientHelpers.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
1717
along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919
using System;
20-
using System.IO;
20+
using System.IO;
2121
using System.Linq;
2222

2323
namespace OTAPI.Common;
@@ -71,6 +71,20 @@ public static ClientInstallPath<ITarget> DetermineClientInstallPath<ITarget>(ITa
7171
else Console.Error.WriteLine("Invalid option, expected a number.");
7272
}
7373

74+
// prompt for path
75+
Console.Write("Please enter the path to your Terraria installation: ");
76+
var inputPath = Console.ReadLine();
77+
if (inputPath != null)
78+
{
79+
foreach (var discover in discoverers)
80+
{
81+
if (discover.IsValidInstallPath(inputPath))
82+
{
83+
return new ClientInstallPath<ITarget> { Path = inputPath, Target = (ITarget)discover };
84+
}
85+
}
86+
}
87+
7488
throw new DirectoryNotFoundException();
7589
}
7690

OTAPI.Patcher/OTAPI.Patcher.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
2020
<PackageReference Include="System.Private.Uri" Version="4.3.2" />
2121
<PackageReference Include="System.Security.Permissions" Version="9.0.2" />
22+
<PackageReference Include="System.Drawing.Common" Version="9.0.2" />
2223
</ItemGroup>
2324
<ItemGroup>
2425
<ProjectReference Include="..\FNA\FNA.Core.csproj" />

0 commit comments

Comments
 (0)