From dee661af789ebc1eaa48fc3a4e940d51361c8c0f Mon Sep 17 00:00:00 2001 From: Bitl Date: Tue, 26 Jul 2022 14:34:04 -0700 Subject: [PATCH] QOL upgrades --- Novetus/NovetusCore/Classes/Downloader.cs | 4 +++- .../Forms/SDK/AssetDownloader.Designer.cs | 14 +++++++------- .../NovetusLauncher/Forms/SDK/AssetDownloader.cs | 12 +++++++++++- .../Forms/SDK/AssetFixer.Designer.cs | 14 +++++++------- Novetus/NovetusLauncher/Forms/SDK/AssetFixer.cs | 6 ------ 5 files changed, 28 insertions(+), 22 deletions(-) diff --git a/Novetus/NovetusCore/Classes/Downloader.cs b/Novetus/NovetusCore/Classes/Downloader.cs index 7bc8519..58fd713 100644 --- a/Novetus/NovetusCore/Classes/Downloader.cs +++ b/Novetus/NovetusCore/Classes/Downloader.cs @@ -15,6 +15,7 @@ class Downloader public readonly string fileFilter; public readonly string filePath; public static bool showErrorInfo; + public int downloadSize; private string downloadOutcome; private static string downloadOutcomeException; @@ -115,7 +116,8 @@ class Downloader //Thread.Sleep(2000); if (File.Exists(name) && read > 0) { - downloadOutcome = "File " + Path.GetFileName(name) + " downloaded! " + GlobalFuncs.SizeSuffix(Convert.ToInt64(read), 2) + " written (" + read + " bytes)! " + additionalText; + downloadSize = read; + downloadOutcome = "File " + Path.GetFileName(name) + " downloaded! " + GlobalFuncs.SizeSuffix(Convert.ToInt64(downloadSize), 2) + " written (" + downloadSize + " bytes)! " + additionalText; } else { diff --git a/Novetus/NovetusLauncher/Forms/SDK/AssetDownloader.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/AssetDownloader.Designer.cs index fa94993..d95f1dc 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/AssetDownloader.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/AssetDownloader.Designer.cs @@ -165,12 +165,12 @@ // // CustomDLURLLabel // - this.CustomDLURLLabel.AutoSize = true; - this.CustomDLURLLabel.Location = new System.Drawing.Point(5, 78); + this.CustomDLURLLabel.Location = new System.Drawing.Point(5, 72); this.CustomDLURLLabel.Name = "CustomDLURLLabel"; - this.CustomDLURLLabel.Size = new System.Drawing.Size(67, 13); + this.CustomDLURLLabel.Size = new System.Drawing.Size(67, 27); this.CustomDLURLLabel.TabIndex = 26; - this.CustomDLURLLabel.Text = "Custom URL"; + this.CustomDLURLLabel.Text = "Custom URL\r\n(Optional):"; + this.CustomDLURLLabel.TextAlign = System.Drawing.ContentAlignment.TopCenter; // // URLOverrideBox // @@ -186,14 +186,14 @@ this.URLListLabel.AutoSize = true; this.URLListLabel.Location = new System.Drawing.Point(18, 51); this.URLListLabel.Name = "URLListLabel"; - this.URLListLabel.Size = new System.Drawing.Size(48, 13); + this.URLListLabel.Size = new System.Drawing.Size(32, 13); this.URLListLabel.TabIndex = 24; - this.URLListLabel.Text = "URL List"; + this.URLListLabel.Text = "URL:"; // // URLSelection // this.URLSelection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.URLSelection.DropDownWidth = 242; + this.URLSelection.DropDownWidth = 300; this.URLSelection.FormattingEnabled = true; this.URLSelection.Location = new System.Drawing.Point(72, 48); this.URLSelection.Name = "URLSelection"; diff --git a/Novetus/NovetusLauncher/Forms/SDK/AssetDownloader.cs b/Novetus/NovetusLauncher/Forms/SDK/AssetDownloader.cs index 25dc293..aba4dc1 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/AssetDownloader.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/AssetDownloader.cs @@ -20,6 +20,7 @@ public partial class AssetDownloader : Form private bool isWebSite = false; private bool batchMode = false; private bool hasOverrideWarningOpenedOnce = false; + private static int batchDownloadSize = 0; #endregion #region Constructor @@ -56,6 +57,8 @@ public partial class AssetDownloader : Form //downloader AssetDownloader_LoadHelpMessage.Checked = GlobalVars.UserConfiguration.DisabledAssetSDKHelp; + Height = 193; + CenterToScreen(); } void AssetSDK_Close(object sender, CancelEventArgs e) @@ -186,6 +189,11 @@ public partial class AssetDownloader : Form GlobalFuncs.LogExceptions(ex); noErrors = false; } + + if (noErrors) + { + batchDownloadSize += download.downloadSize; + } } else { @@ -261,7 +269,7 @@ public partial class AssetDownloader : Form string extraText = (lines.Count() != lineCount) ? "\n" + (lines.Count() - lineCount) + " errors were detected during the download. Make sure your IDs and links are valid." : ""; - MessageBox.Show("Batch download complete! " + lineCount + " items downloaded!" + extraText, "Novetus Asset SDK - Download Complete", MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show("Batch download complete! " + lineCount + " items downloaded! " + GlobalFuncs.SizeSuffix(Convert.ToInt64(batchDownloadSize), 2) + "written (" + batchDownloadSize + " bytes)!" + extraText, "Novetus Asset SDK - Download Complete", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) @@ -283,6 +291,7 @@ public partial class AssetDownloader : Form if (batchMode) { + Height = 454; AssetDownloaderBatch_BatchIDBox.Enabled = true; AssetDownloaderBatch_Note.Visible = true; AssetDownloader_AssetIDBox.Enabled = false; @@ -291,6 +300,7 @@ public partial class AssetDownloader : Form } else { + Height = 193; AssetDownloaderBatch_BatchIDBox.Enabled = false; AssetDownloaderBatch_Note.Visible = false; AssetDownloader_AssetIDBox.Enabled = true; diff --git a/Novetus/NovetusLauncher/Forms/SDK/AssetFixer.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/AssetFixer.Designer.cs index 18766f6..b7595d7 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/AssetFixer.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/AssetFixer.Designer.cs @@ -47,12 +47,12 @@ // // CustomDLURLLabel // - this.CustomDLURLLabel.AutoSize = true; - this.CustomDLURLLabel.Location = new System.Drawing.Point(14, 41); + this.CustomDLURLLabel.Location = new System.Drawing.Point(12, 35); this.CustomDLURLLabel.Name = "CustomDLURLLabel"; - this.CustomDLURLLabel.Size = new System.Drawing.Size(67, 13); + this.CustomDLURLLabel.Size = new System.Drawing.Size(67, 27); this.CustomDLURLLabel.TabIndex = 26; - this.CustomDLURLLabel.Text = "Custom URL"; + this.CustomDLURLLabel.Text = "Custom URL\r\n(Optional)\r\n:"; + this.CustomDLURLLabel.TextAlign = System.Drawing.ContentAlignment.TopCenter; // // URLOverrideBox // @@ -66,11 +66,11 @@ // URLListLabel // this.URLListLabel.AutoSize = true; - this.URLListLabel.Location = new System.Drawing.Point(12, 14); + this.URLListLabel.Location = new System.Drawing.Point(27, 14); this.URLListLabel.Name = "URLListLabel"; - this.URLListLabel.Size = new System.Drawing.Size(48, 13); + this.URLListLabel.Size = new System.Drawing.Size(32, 13); this.URLListLabel.TabIndex = 24; - this.URLListLabel.Text = "URL List"; + this.URLListLabel.Text = "URL:"; // // URLSelection // diff --git a/Novetus/NovetusLauncher/Forms/SDK/AssetFixer.cs b/Novetus/NovetusLauncher/Forms/SDK/AssetFixer.cs index ccddd48..a0988c0 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/AssetFixer.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/AssetFixer.cs @@ -376,13 +376,7 @@ public partial class AssetFixer : Form if (robloxFileDialog.ShowDialog() == DialogResult.OK) { path = robloxFileDialog.FileName; -#if DEBUG - LocalizeAsset(currentType, null, path, name, - AssetLocalization_AssetLinks.Checked ? AssetLocalization_AssetLinks.Checked : false, - AssetLocalization_AssetLinks.Checked ? url : ""); -#else AssetLocalization_BackgroundWorker.RunWorkerAsync(); -#endif } }