Skip to content

Commit

Permalink
- fix copying depots to steam install when different disk drives are …
Browse files Browse the repository at this point in the history
…being used

- fix password containing special characters
  • Loading branch information
xiaoxiao921 committed Aug 29, 2024
1 parent 7fbd7ab commit f0b11a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 36 deletions.
29 changes: 2 additions & 27 deletions RoR2VersionSelector/RoR2VersionSelector.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 6 additions & 9 deletions RoR2VersionSelector/RoR2VersionSelector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public RoR2VersionSelector()
InitializeComponent();
}

private static string GetDepotsFolder() =>
Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "depots"));

private bool IsValidDownloadedDepot(string folderName)
{
if (!Directory.Exists(folderName))
Expand Down Expand Up @@ -75,7 +78,7 @@ private List<string> GetRiskofRain2Folders(string rootPath)
Environment.NewLine +
"A File dialog box will then open, allowing you to select the folder to which the ror2 version just downloaded is to be copied." +
Environment.NewLine +
"Otherwise, you can find the downloaded depots here: " + Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "depots");
"Otherwise, you can find the downloaded depots here: " + GetDepotsFolder();

private void RoR2VersionSelector_Load(object sender, EventArgs e)
{
Expand Down Expand Up @@ -124,7 +127,6 @@ private void UpdateDepotDownloaderArgs()
$"-depot 632361 " +
$"{ManifestArg} " +
$"-username {TextBoxUsername.Text} " +
$"-password {TextBoxPassword.Text} " +
$"{FileListArg} " +
$"-dir {OutputFolderPathArg}\"";

Expand All @@ -150,7 +152,7 @@ private void SetManifestIdAndArgAndOuputFolderPathArg()

ManifestArg = ManifestId != -1 ? $" -manifest {ManifestId} " : " ";

OutputFolderPathArg = Path.Combine("./depots", AllRoR2VersionsStringSorted[ComboBoxVersionSelector.SelectedIndex]);
OutputFolderPathArg = Path.Combine(GetDepotsFolder(), AllRoR2VersionsStringSorted[ComboBoxVersionSelector.SelectedIndex]);
}

private static void CopyFilesRecursively(string sourcePath, string targetPath)
Expand All @@ -168,7 +170,7 @@ private static void CopyFilesRecursively(string sourcePath, string targetPath)

private void ButtonCopyDownloadedVersionToSteamInstall_Click(object sender, EventArgs e)
{
var sourceFolders = GetRiskofRain2Folders("./depots");
var sourceFolders = GetRiskofRain2Folders(GetDepotsFolder());
if (sourceFolders.Count <= 0)
{
MessageBox.Show("No depots available to copy.", "Invalid", MessageBoxButtons.OK, MessageBoxIcon.Information);
Expand Down Expand Up @@ -279,10 +281,5 @@ private void TextBoxUsername_TextChanged(object sender, EventArgs e)
{
UpdateDepotDownloaderArgs();
}

private void TextBoxPassword_TextChanged(object sender, EventArgs e)
{
UpdateDepotDownloaderArgs();
}
}
}

0 comments on commit f0b11a3

Please sign in to comment.