diff --git a/Novetus/NovetusCMD/NovetusCMD.cs b/Novetus/NovetusCMD/NovetusCMD.cs index 79cb1ac..37b5d0b 100644 --- a/Novetus/NovetusCMD/NovetusCMD.cs +++ b/Novetus/NovetusCMD/NovetusCMD.cs @@ -240,6 +240,9 @@ namespace NovetusCMD { LocalVars.StartInNo3D = true; GlobalFuncs.ConsolePrint("NovetusCMD will now launch the server in No3D mode.", 4); + GlobalFuncs.ConsolePrint("Launching the server without graphics enables better performance. " + + "However, launching the server with no graphics may cause some elements in later clients may be disabled, such as Dialog boxes." + + "This feature may also make your server unstable.", 5); } if (CommandLine["outputinfo"] != null) diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs index 487e2ea..42a0c37 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs @@ -812,11 +812,11 @@ public class GlobalFuncs { DefaultClientInfo.ScriptMD5 = ClientScriptMD5.ToUpper(CultureInfo.InvariantCulture); } - else + /*else { IOException clientNotFoundEX = new IOException("Could not find script file for MD5 generation. You must have a CSMPFunctions.lua script in your client's content/scripts folder."); throw clientNotFoundEX; - } + }*/ string desc = "This client information file for '" + GlobalVars.UserConfiguration.SelectedClient + "' was pre-generated by Novetus for your convienence. You will need to load this clientinfo.nov file into the Client SDK for additional options.\n\n" diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs index 1c16e21..6a556b2 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs @@ -465,23 +465,41 @@ namespace NovetusLauncher } } - if (FormStyle == Settings.Style.Stylish && gameType == ScriptType.Server) + if (gameType == ScriptType.Server) { - DialogResult result = MessageBox.Show("You have the option to launch your server with or without graphics for better performance.\n" + - "Please note that enabling this option may cause some elements in later clients may be disabled, such as Dialog boxes. This feature may also make your server unstable.\n\n" + - "Press Yes to launch a server with graphics, or No to launch a Server in No3D Mode.", "Novetus - Launch Server", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); - bool no3dLegacy = false; - - switch (result) + if (FormStyle == Settings.Style.Stylish) { - case DialogResult.Cancel: - return; - case DialogResult.No: - no3dLegacy = true; - no3d = no3dLegacy; - break; - default: - break; + DialogResult result = MessageBox.Show("You have the option to launch your server with or without graphics. Launching the server without graphics enables better performance.\n" + + "However, launching the server with no graphics may cause some elements in later clients may be disabled, such as Dialog boxes. This feature may also make your server unstable.\n\n" + + "Press Yes to launch a server with graphics, or No to launch a Server in No3D Mode.", "Novetus - Launch Server", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); + bool no3dLegacy = false; + + switch (result) + { + case DialogResult.Cancel: + return; + case DialogResult.No: + no3dLegacy = true; + no3d = no3dLegacy; + break; + default: + break; + } + } + else if (FormStyle != Settings.Style.Stylish && no3d) + { + DialogResult result = MessageBox.Show("Launching the server without graphics enables better performance.\n" + + "However, launching the server with no graphics may cause some elements in later clients may be disabled, such as Dialog boxes. " + + "This feature may also make your server unstable.", + "Novetus - No3D Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); + + switch (result) + { + case DialogResult.Cancel: + return; + default: + break; + } } } diff --git a/Novetus/NovetusLauncher/Forms/SDK/AssetSDK.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/AssetSDK.Designer.cs index 40fd98e..20f982d 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/AssetSDK.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/AssetSDK.Designer.cs @@ -28,9 +28,6 @@ { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AssetSDK)); this.AssetDownloader = new System.Windows.Forms.GroupBox(); - this.CustomDLURLLabel = new System.Windows.Forms.Label(); - this.URLOverrideBox = new System.Windows.Forms.TextBox(); - this.URLListLabel = new System.Windows.Forms.Label(); this.AssetDownloaderBatch_Note = new System.Windows.Forms.Label(); this.AssetDownloaderBatch_Status = new System.Windows.Forms.Label(); this.AssetDownloader_BatchMode = new System.Windows.Forms.CheckBox(); @@ -38,12 +35,15 @@ this.AssetDownloader_AssetNameBox = new System.Windows.Forms.TextBox(); this.AssetDownloader_AssetNameText = new System.Windows.Forms.Label(); this.AssetDownloader_LoadHelpMessage = new System.Windows.Forms.CheckBox(); - this.AssetDownloader_URLSelection = new System.Windows.Forms.ComboBox(); this.AssetDownloader_AssetVersionText = new System.Windows.Forms.Label(); this.AssetDownloader_AssetIDText = new System.Windows.Forms.Label(); this.AssetDownloader_AssetVersionSelector = new System.Windows.Forms.NumericUpDown(); this.AssetDownloader_AssetIDBox = new System.Windows.Forms.TextBox(); this.AssetDownloader_AssetDownloaderButton = new System.Windows.Forms.Button(); + this.CustomDLURLLabel = new System.Windows.Forms.Label(); + this.URLOverrideBox = new System.Windows.Forms.TextBox(); + this.URLListLabel = new System.Windows.Forms.Label(); + this.URLSelection = new System.Windows.Forms.ComboBox(); this.AssetLocalization = new System.Windows.Forms.GroupBox(); this.AssetLocalization_LocalizePermanentlyBox = new System.Windows.Forms.CheckBox(); this.AssetLocalization_SaveBackups = new System.Windows.Forms.CheckBox(); @@ -57,12 +57,13 @@ this.AssetLocalization_AssetTypeBox = new System.Windows.Forms.ComboBox(); this.AssetLocalization_LocalizeButton = new System.Windows.Forms.Button(); this.MeshConverter = new System.Windows.Forms.GroupBox(); + this.MeshConverter_MeshVersionSelector = new System.Windows.Forms.ComboBox(); this.MeshConverter_StatusText = new System.Windows.Forms.Label(); this.MeshConverter_MeshVersionText = new System.Windows.Forms.Label(); this.MeshConverter_CreditText = new System.Windows.Forms.Label(); this.MeshConverter_ConvertButton = new System.Windows.Forms.Button(); this.AssetLocalization_BackgroundWorker = new System.ComponentModel.BackgroundWorker(); - this.MeshConverter_MeshVersionSelector = new System.Windows.Forms.ComboBox(); + this.AssetLocalization_AssetLinks = new System.Windows.Forms.CheckBox(); this.AssetDownloader.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.AssetDownloader_AssetVersionSelector)).BeginInit(); this.AssetLocalization.SuspendLayout(); @@ -71,9 +72,6 @@ // // AssetDownloader // - this.AssetDownloader.Controls.Add(this.CustomDLURLLabel); - this.AssetDownloader.Controls.Add(this.URLOverrideBox); - this.AssetDownloader.Controls.Add(this.URLListLabel); this.AssetDownloader.Controls.Add(this.AssetDownloaderBatch_Note); this.AssetDownloader.Controls.Add(this.AssetDownloaderBatch_Status); this.AssetDownloader.Controls.Add(this.AssetDownloader_BatchMode); @@ -81,53 +79,25 @@ this.AssetDownloader.Controls.Add(this.AssetDownloader_AssetNameBox); this.AssetDownloader.Controls.Add(this.AssetDownloader_AssetNameText); this.AssetDownloader.Controls.Add(this.AssetDownloader_LoadHelpMessage); - this.AssetDownloader.Controls.Add(this.AssetDownloader_URLSelection); this.AssetDownloader.Controls.Add(this.AssetDownloader_AssetVersionText); this.AssetDownloader.Controls.Add(this.AssetDownloader_AssetIDText); this.AssetDownloader.Controls.Add(this.AssetDownloader_AssetVersionSelector); this.AssetDownloader.Controls.Add(this.AssetDownloader_AssetIDBox); this.AssetDownloader.Controls.Add(this.AssetDownloader_AssetDownloaderButton); - this.AssetDownloader.Location = new System.Drawing.Point(12, 12); + this.AssetDownloader.Location = new System.Drawing.Point(12, 38); this.AssetDownloader.Name = "AssetDownloader"; - this.AssetDownloader.Size = new System.Drawing.Size(260, 296); + this.AssetDownloader.Size = new System.Drawing.Size(260, 332); this.AssetDownloader.TabIndex = 0; this.AssetDownloader.TabStop = false; this.AssetDownloader.Text = "Asset Downloader"; // - // CustomDLURLLabel - // - this.CustomDLURLLabel.AutoSize = true; - this.CustomDLURLLabel.Location = new System.Drawing.Point(130, 60); - this.CustomDLURLLabel.Name = "CustomDLURLLabel"; - this.CustomDLURLLabel.Size = new System.Drawing.Size(118, 13); - this.CustomDLURLLabel.TabIndex = 26; - this.CustomDLURLLabel.Text = "Custom Download URL"; - // - // URLOverrideBox - // - this.URLOverrideBox.Location = new System.Drawing.Point(128, 76); - this.URLOverrideBox.Name = "URLOverrideBox"; - this.URLOverrideBox.Size = new System.Drawing.Size(121, 20); - this.URLOverrideBox.TabIndex = 25; - this.URLOverrideBox.Click += new System.EventHandler(this.URLOverrideBox_Click); - this.URLOverrideBox.TextChanged += new System.EventHandler(this.URLOverrideBox_TextChanged); - // - // URLListLabel - // - this.URLListLabel.AutoSize = true; - this.URLListLabel.Location = new System.Drawing.Point(37, 60); - this.URLListLabel.Name = "URLListLabel"; - this.URLListLabel.Size = new System.Drawing.Size(48, 13); - this.URLListLabel.TabIndex = 24; - this.URLListLabel.Text = "URL List"; - // // AssetDownloaderBatch_Note // this.AssetDownloaderBatch_Note.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.AssetDownloaderBatch_Note.ForeColor = System.Drawing.Color.Red; - this.AssetDownloaderBatch_Note.Location = new System.Drawing.Point(38, 150); + this.AssetDownloaderBatch_Note.Location = new System.Drawing.Point(12, 113); this.AssetDownloaderBatch_Note.Name = "AssetDownloaderBatch_Note"; - this.AssetDownloaderBatch_Note.Size = new System.Drawing.Size(174, 42); + this.AssetDownloaderBatch_Note.Size = new System.Drawing.Size(236, 42); this.AssetDownloaderBatch_Note.TabIndex = 23; this.AssetDownloaderBatch_Note.Text = "You must enter in each item as ||. \r\nExample: RedTopHat|297230" + "2|1"; @@ -140,7 +110,7 @@ this.AssetDownloaderBatch_Status.Cursor = System.Windows.Forms.Cursors.Default; this.AssetDownloaderBatch_Status.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.AssetDownloaderBatch_Status.ForeColor = System.Drawing.Color.Red; - this.AssetDownloaderBatch_Status.Location = new System.Drawing.Point(94, 275); + this.AssetDownloaderBatch_Status.Location = new System.Drawing.Point(86, 315); this.AssetDownloaderBatch_Status.Name = "AssetDownloaderBatch_Status"; this.AssetDownloaderBatch_Status.Size = new System.Drawing.Size(84, 13); this.AssetDownloaderBatch_Status.TabIndex = 1; @@ -149,7 +119,7 @@ // // AssetDownloader_BatchMode // - this.AssetDownloader_BatchMode.Location = new System.Drawing.Point(157, 132); + this.AssetDownloader_BatchMode.Location = new System.Drawing.Point(163, 86); this.AssetDownloader_BatchMode.Name = "AssetDownloader_BatchMode"; this.AssetDownloader_BatchMode.Size = new System.Drawing.Size(96, 24); this.AssetDownloader_BatchMode.TabIndex = 22; @@ -160,11 +130,11 @@ // AssetDownloaderBatch_BatchIDBox // this.AssetDownloaderBatch_BatchIDBox.Enabled = false; - this.AssetDownloaderBatch_BatchIDBox.Location = new System.Drawing.Point(6, 195); + this.AssetDownloaderBatch_BatchIDBox.Location = new System.Drawing.Point(7, 161); this.AssetDownloaderBatch_BatchIDBox.Multiline = true; this.AssetDownloaderBatch_BatchIDBox.Name = "AssetDownloaderBatch_BatchIDBox"; this.AssetDownloaderBatch_BatchIDBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.AssetDownloaderBatch_BatchIDBox.Size = new System.Drawing.Size(242, 77); + this.AssetDownloaderBatch_BatchIDBox.Size = new System.Drawing.Size(242, 151); this.AssetDownloaderBatch_BatchIDBox.TabIndex = 0; // // AssetDownloader_AssetNameBox @@ -184,7 +154,7 @@ // // AssetDownloader_LoadHelpMessage // - this.AssetDownloader_LoadHelpMessage.Location = new System.Drawing.Point(6, 132); + this.AssetDownloader_LoadHelpMessage.Location = new System.Drawing.Point(12, 86); this.AssetDownloader_LoadHelpMessage.Name = "AssetDownloader_LoadHelpMessage"; this.AssetDownloader_LoadHelpMessage.Size = new System.Drawing.Size(145, 24); this.AssetDownloader_LoadHelpMessage.TabIndex = 19; @@ -192,21 +162,6 @@ this.AssetDownloader_LoadHelpMessage.UseVisualStyleBackColor = true; this.AssetDownloader_LoadHelpMessage.CheckedChanged += new System.EventHandler(this.AssetDownloader_LoadHelpMessage_CheckedChanged); // - // AssetDownloader_URLSelection - // - this.AssetDownloader_URLSelection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.AssetDownloader_URLSelection.DropDownWidth = 242; - this.AssetDownloader_URLSelection.FormattingEnabled = true; - this.AssetDownloader_URLSelection.Items.AddRange(new object[] { - "https://assetdelivery.roblox.com/", - "https://www.roblox.com/catalog/", - "https://www.roblox.com/library/"}); - this.AssetDownloader_URLSelection.Location = new System.Drawing.Point(8, 76); - this.AssetDownloader_URLSelection.Name = "AssetDownloader_URLSelection"; - this.AssetDownloader_URLSelection.Size = new System.Drawing.Size(114, 21); - this.AssetDownloader_URLSelection.TabIndex = 18; - this.AssetDownloader_URLSelection.SelectedIndexChanged += new System.EventHandler(this.AssetDownloader_URLSelection_SelectedIndexChanged); - // // AssetDownloader_AssetVersionText // this.AssetDownloader_AssetVersionText.Location = new System.Drawing.Point(194, 14); @@ -245,7 +200,7 @@ // // AssetDownloader_AssetDownloaderButton // - this.AssetDownloader_AssetDownloaderButton.Location = new System.Drawing.Point(7, 103); + this.AssetDownloader_AssetDownloaderButton.Location = new System.Drawing.Point(12, 57); this.AssetDownloader_AssetDownloaderButton.Name = "AssetDownloader_AssetDownloaderButton"; this.AssetDownloader_AssetDownloaderButton.Size = new System.Drawing.Size(242, 23); this.AssetDownloader_AssetDownloaderButton.TabIndex = 13; @@ -253,8 +208,47 @@ this.AssetDownloader_AssetDownloaderButton.UseVisualStyleBackColor = true; this.AssetDownloader_AssetDownloaderButton.Click += new System.EventHandler(this.AssetDownloader_AssetDownloaderButton_Click); // + // CustomDLURLLabel + // + this.CustomDLURLLabel.AutoSize = true; + this.CustomDLURLLabel.Location = new System.Drawing.Point(286, 14); + this.CustomDLURLLabel.Name = "CustomDLURLLabel"; + this.CustomDLURLLabel.Size = new System.Drawing.Size(67, 13); + this.CustomDLURLLabel.TabIndex = 26; + this.CustomDLURLLabel.Text = "Custom URL"; + // + // URLOverrideBox + // + this.URLOverrideBox.Location = new System.Drawing.Point(353, 11); + this.URLOverrideBox.Name = "URLOverrideBox"; + this.URLOverrideBox.Size = new System.Drawing.Size(187, 20); + this.URLOverrideBox.TabIndex = 25; + this.URLOverrideBox.Click += new System.EventHandler(this.URLOverrideBox_Click); + this.URLOverrideBox.TextChanged += new System.EventHandler(this.URLOverrideBox_TextChanged); + // + // URLListLabel + // + this.URLListLabel.AutoSize = true; + this.URLListLabel.Location = new System.Drawing.Point(12, 14); + this.URLListLabel.Name = "URLListLabel"; + this.URLListLabel.Size = new System.Drawing.Size(48, 13); + this.URLListLabel.TabIndex = 24; + this.URLListLabel.Text = "URL List"; + // + // URLSelection + // + this.URLSelection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.URLSelection.DropDownWidth = 242; + this.URLSelection.FormattingEnabled = true; + this.URLSelection.Location = new System.Drawing.Point(66, 11); + this.URLSelection.Name = "URLSelection"; + this.URLSelection.Size = new System.Drawing.Size(214, 21); + this.URLSelection.TabIndex = 18; + this.URLSelection.SelectedIndexChanged += new System.EventHandler(this.URLSelection_SelectedIndexChanged); + // // AssetLocalization // + this.AssetLocalization.Controls.Add(this.AssetLocalization_AssetLinks); this.AssetLocalization.Controls.Add(this.AssetLocalization_LocalizePermanentlyBox); this.AssetLocalization.Controls.Add(this.AssetLocalization_SaveBackups); this.AssetLocalization.Controls.Add(this.AssetLocalization_StatusBar); @@ -266,17 +260,17 @@ this.AssetLocalization.Controls.Add(this.AssetLocalization_StatusText); this.AssetLocalization.Controls.Add(this.AssetLocalization_AssetTypeBox); this.AssetLocalization.Controls.Add(this.AssetLocalization_LocalizeButton); - this.AssetLocalization.Location = new System.Drawing.Point(278, 126); + this.AssetLocalization.Location = new System.Drawing.Point(278, 152); this.AssetLocalization.Name = "AssetLocalization"; - this.AssetLocalization.Size = new System.Drawing.Size(267, 182); + this.AssetLocalization.Size = new System.Drawing.Size(267, 218); this.AssetLocalization.TabIndex = 1; this.AssetLocalization.TabStop = false; - this.AssetLocalization.Text = "Asset Localization"; + this.AssetLocalization.Text = "Asset Fixer"; // // AssetLocalization_LocalizePermanentlyBox // this.AssetLocalization_LocalizePermanentlyBox.AutoSize = true; - this.AssetLocalization_LocalizePermanentlyBox.Location = new System.Drawing.Point(125, 98); + this.AssetLocalization_LocalizePermanentlyBox.Location = new System.Drawing.Point(125, 96); this.AssetLocalization_LocalizePermanentlyBox.Name = "AssetLocalization_LocalizePermanentlyBox"; this.AssetLocalization_LocalizePermanentlyBox.Size = new System.Drawing.Size(126, 17); this.AssetLocalization_LocalizePermanentlyBox.TabIndex = 21; @@ -288,7 +282,7 @@ // AssetLocalization_SaveBackups // this.AssetLocalization_SaveBackups.AutoSize = true; - this.AssetLocalization_SaveBackups.Location = new System.Drawing.Point(19, 98); + this.AssetLocalization_SaveBackups.Location = new System.Drawing.Point(15, 96); this.AssetLocalization_SaveBackups.Name = "AssetLocalization_SaveBackups"; this.AssetLocalization_SaveBackups.Size = new System.Drawing.Size(96, 17); this.AssetLocalization_SaveBackups.TabIndex = 20; @@ -298,15 +292,15 @@ // // AssetLocalization_StatusBar // - this.AssetLocalization_StatusBar.Location = new System.Drawing.Point(6, 161); + this.AssetLocalization_StatusBar.Location = new System.Drawing.Point(6, 183); this.AssetLocalization_StatusBar.Name = "AssetLocalization_StatusBar"; - this.AssetLocalization_StatusBar.Size = new System.Drawing.Size(254, 16); + this.AssetLocalization_StatusBar.Size = new System.Drawing.Size(254, 29); this.AssetLocalization_StatusBar.TabIndex = 19; // // AssetLocalization_AssetTypeText // this.AssetLocalization_AssetTypeText.AutoSize = true; - this.AssetLocalization_AssetTypeText.Location = new System.Drawing.Point(6, 16); + this.AssetLocalization_AssetTypeText.Location = new System.Drawing.Point(6, 18); this.AssetLocalization_AssetTypeText.Name = "AssetLocalization_AssetTypeText"; this.AssetLocalization_AssetTypeText.Size = new System.Drawing.Size(63, 13); this.AssetLocalization_AssetTypeText.TabIndex = 18; @@ -315,7 +309,7 @@ // AssetLocalization_UsesHatMeshText // this.AssetLocalization_UsesHatMeshText.AutoSize = true; - this.AssetLocalization_UsesHatMeshText.Location = new System.Drawing.Point(6, 69); + this.AssetLocalization_UsesHatMeshText.Location = new System.Drawing.Point(6, 71); this.AssetLocalization_UsesHatMeshText.Name = "AssetLocalization_UsesHatMeshText"; this.AssetLocalization_UsesHatMeshText.Size = new System.Drawing.Size(118, 13); this.AssetLocalization_UsesHatMeshText.TabIndex = 17; @@ -327,7 +321,7 @@ this.AssetLocalization_UsesHatMeshBox.FormattingEnabled = true; this.AssetLocalization_UsesHatMeshBox.Items.AddRange(new object[] { "None"}); - this.AssetLocalization_UsesHatMeshBox.Location = new System.Drawing.Point(134, 66); + this.AssetLocalization_UsesHatMeshBox.Location = new System.Drawing.Point(134, 68); this.AssetLocalization_UsesHatMeshBox.Name = "AssetLocalization_UsesHatMeshBox"; this.AssetLocalization_UsesHatMeshBox.Size = new System.Drawing.Size(126, 21); this.AssetLocalization_UsesHatMeshBox.TabIndex = 16; @@ -336,7 +330,7 @@ // AssetLocalization_ItemNameText // this.AssetLocalization_ItemNameText.AutoSize = true; - this.AssetLocalization_ItemNameText.Location = new System.Drawing.Point(6, 43); + this.AssetLocalization_ItemNameText.Location = new System.Drawing.Point(6, 45); this.AssetLocalization_ItemNameText.Name = "AssetLocalization_ItemNameText"; this.AssetLocalization_ItemNameText.Size = new System.Drawing.Size(125, 13); this.AssetLocalization_ItemNameText.TabIndex = 15; @@ -344,7 +338,7 @@ // // AssetLocalization_ItemNameBox // - this.AssetLocalization_ItemNameBox.Location = new System.Drawing.Point(134, 40); + this.AssetLocalization_ItemNameBox.Location = new System.Drawing.Point(134, 42); this.AssetLocalization_ItemNameBox.Name = "AssetLocalization_ItemNameBox"; this.AssetLocalization_ItemNameBox.Size = new System.Drawing.Size(126, 20); this.AssetLocalization_ItemNameBox.TabIndex = 14; @@ -352,7 +346,7 @@ // // AssetLocalization_StatusText // - this.AssetLocalization_StatusText.Location = new System.Drawing.Point(6, 145); + this.AssetLocalization_StatusText.Location = new System.Drawing.Point(6, 167); this.AssetLocalization_StatusText.Name = "AssetLocalization_StatusText"; this.AssetLocalization_StatusText.Size = new System.Drawing.Size(254, 13); this.AssetLocalization_StatusText.TabIndex = 13; @@ -373,7 +367,7 @@ "Shirt", "Pants", "Lua Script"}); - this.AssetLocalization_AssetTypeBox.Location = new System.Drawing.Point(75, 13); + this.AssetLocalization_AssetTypeBox.Location = new System.Drawing.Point(75, 15); this.AssetLocalization_AssetTypeBox.Name = "AssetLocalization_AssetTypeBox"; this.AssetLocalization_AssetTypeBox.Size = new System.Drawing.Size(185, 21); this.AssetLocalization_AssetTypeBox.TabIndex = 12; @@ -381,7 +375,7 @@ // // AssetLocalization_LocalizeButton // - this.AssetLocalization_LocalizeButton.Location = new System.Drawing.Point(6, 121); + this.AssetLocalization_LocalizeButton.Location = new System.Drawing.Point(6, 143); this.AssetLocalization_LocalizeButton.Name = "AssetLocalization_LocalizeButton"; this.AssetLocalization_LocalizeButton.Size = new System.Drawing.Size(254, 21); this.AssetLocalization_LocalizeButton.TabIndex = 11; @@ -396,13 +390,26 @@ this.MeshConverter.Controls.Add(this.MeshConverter_MeshVersionText); this.MeshConverter.Controls.Add(this.MeshConverter_CreditText); this.MeshConverter.Controls.Add(this.MeshConverter_ConvertButton); - this.MeshConverter.Location = new System.Drawing.Point(278, 12); + this.MeshConverter.Location = new System.Drawing.Point(278, 38); this.MeshConverter.Name = "MeshConverter"; this.MeshConverter.Size = new System.Drawing.Size(262, 106); this.MeshConverter.TabIndex = 2; this.MeshConverter.TabStop = false; this.MeshConverter.Text = "Mesh Converter"; // + // MeshConverter_MeshVersionSelector + // + this.MeshConverter_MeshVersionSelector.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.MeshConverter_MeshVersionSelector.FormattingEnabled = true; + this.MeshConverter_MeshVersionSelector.Items.AddRange(new object[] { + "1.00", + "1.01", + "2.00"}); + this.MeshConverter_MeshVersionSelector.Location = new System.Drawing.Point(125, 14); + this.MeshConverter_MeshVersionSelector.Name = "MeshConverter_MeshVersionSelector"; + this.MeshConverter_MeshVersionSelector.Size = new System.Drawing.Size(90, 21); + this.MeshConverter_MeshVersionSelector.TabIndex = 11; + // // MeshConverter_StatusText // this.MeshConverter_StatusText.Location = new System.Drawing.Point(12, 66); @@ -449,28 +456,30 @@ this.AssetLocalization_BackgroundWorker.ProgressChanged += new System.ComponentModel.ProgressChangedEventHandler(this.AssetLocalization_BackgroundWorker_ProgressChanged); this.AssetLocalization_BackgroundWorker.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.AssetLocalization_BackgroundWorker_RunWorkerCompleted); // - // MeshConverter_MeshVersionSelector + // AssetLocalization_AssetLinks // - this.MeshConverter_MeshVersionSelector.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.MeshConverter_MeshVersionSelector.FormattingEnabled = true; - this.MeshConverter_MeshVersionSelector.Items.AddRange(new object[] { - "1.00", - "1.01", - "2.00"}); - this.MeshConverter_MeshVersionSelector.Location = new System.Drawing.Point(125, 14); - this.MeshConverter_MeshVersionSelector.Name = "MeshConverter_MeshVersionSelector"; - this.MeshConverter_MeshVersionSelector.Size = new System.Drawing.Size(90, 21); - this.MeshConverter_MeshVersionSelector.TabIndex = 11; + this.AssetLocalization_AssetLinks.AutoSize = true; + this.AssetLocalization_AssetLinks.Location = new System.Drawing.Point(22, 119); + this.AssetLocalization_AssetLinks.Name = "AssetLocalization_AssetLinks"; + this.AssetLocalization_AssetLinks.Size = new System.Drawing.Size(215, 17); + this.AssetLocalization_AssetLinks.TabIndex = 22; + this.AssetLocalization_AssetLinks.Text = "Replace Asset Links with Selected URL"; + this.AssetLocalization_AssetLinks.UseVisualStyleBackColor = true; + this.AssetLocalization_AssetLinks.CheckedChanged += new System.EventHandler(this.AssetLocalization_AssetLinks_CheckedChanged); // // AssetSDK // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.ClientSize = new System.Drawing.Size(557, 320); + this.ClientSize = new System.Drawing.Size(557, 382); + this.Controls.Add(this.URLOverrideBox); + this.Controls.Add(this.CustomDLURLLabel); this.Controls.Add(this.MeshConverter); this.Controls.Add(this.AssetLocalization); + this.Controls.Add(this.URLListLabel); this.Controls.Add(this.AssetDownloader); + this.Controls.Add(this.URLSelection); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; @@ -487,6 +496,7 @@ this.MeshConverter.ResumeLayout(false); this.MeshConverter.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } @@ -512,7 +522,7 @@ private System.Windows.Forms.TextBox AssetDownloader_AssetNameBox; private System.Windows.Forms.Label AssetDownloader_AssetNameText; private System.Windows.Forms.CheckBox AssetDownloader_LoadHelpMessage; - private System.Windows.Forms.ComboBox AssetDownloader_URLSelection; + private System.Windows.Forms.ComboBox URLSelection; private System.Windows.Forms.Label AssetDownloader_AssetVersionText; private System.Windows.Forms.Label AssetDownloader_AssetIDText; private System.Windows.Forms.NumericUpDown AssetDownloader_AssetVersionSelector; @@ -528,4 +538,5 @@ private System.Windows.Forms.Label URLListLabel; private System.Windows.Forms.CheckBox AssetLocalization_LocalizePermanentlyBox; private System.Windows.Forms.ComboBox MeshConverter_MeshVersionSelector; + private System.Windows.Forms.CheckBox AssetLocalization_AssetLinks; } \ No newline at end of file diff --git a/Novetus/NovetusLauncher/Forms/SDK/AssetSDK.cs b/Novetus/NovetusLauncher/Forms/SDK/AssetSDK.cs index aadf940..851a030 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/AssetSDK.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/AssetSDK.cs @@ -12,14 +12,16 @@ using System.Xml.Linq; public partial class AssetSDK : Form { #region Private Variables + //shared + public Provider[] contentProviders; + private string url = ""; + private bool isWebSite = false; //localizer private RobloxFileType currentType; private string path; private string name; private string meshname; //downloader - private string url = "https://assetdelivery.roblox.com/v1/asset/?id="; - private bool isWebSite = false; private bool batchMode = false; private bool hasOverrideWarningOpenedOnce = false; //obj2mesh @@ -47,10 +49,27 @@ public partial class AssetSDK : Form #region Load/Close Events private void AssetSDK_Load(object sender, EventArgs e) { - //asset downloader - AssetDownloader_URLSelection.SelectedItem = "https://assetdelivery.roblox.com/"; + //shared + if (File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ContentProviderXMLName)) + { + contentProviders = OnlineClothing.GetContentProviders(); + + for (int i = 0; i < contentProviders.Length; i++) + { + if (contentProviders[i].URL.Contains("?id=")) + { + URLSelection.Items.Add(contentProviders[i].Name); + } + } + } + + URLSelection.Items.Add("https://www.roblox.com/catalog/"); + URLSelection.Items.Add("https://www.roblox.com/library/"); isWebSite = false; + URLSelection.SelectedItem = URLSelection.Items[0]; + + //downloader AssetDownloader_LoadHelpMessage.Checked = GlobalVars.UserConfiguration.DisabledItemMakerHelp; //asset localizer @@ -88,6 +107,54 @@ public partial class AssetSDK : Form //asset localizer AssetLocalization_BackgroundWorker.CancelAsync(); } + + private void URLSelection_SelectedIndexChanged(object sender, EventArgs e) + { + SetURL(); + } + + private void URLOverrideBox_Click(object sender, EventArgs e) + { + if (hasOverrideWarningOpenedOnce == false) + { + MessageBox.Show("By using the custom URL setting, you will override any selected entry in the default URL list. Keep this in mind before downloading anything with this option.\n\nAlso, the URL must be a asset url with 'asset/?id=' at the end of it in order for the Asset Downloader to work smoothly.", "Novetus Asset SDK - URL Override Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); + hasOverrideWarningOpenedOnce = true; + } + } + + private void URLOverrideBox_TextChanged(object sender, EventArgs e) + { + if (!string.IsNullOrWhiteSpace(URLOverrideBox.Text)) + { + URLSelection.Enabled = false; + url = URLOverrideBox.Text; + } + else + { + URLSelection.Enabled = true; + SetURL(); + } + + MessageBox.Show(url); + } + + void SetURL() + { + if (URLSelection.SelectedItem.Equals("https://www.roblox.com/catalog/") || URLSelection.SelectedItem.Equals("https://www.roblox.com/library/")) + { + url = URLSelection.SelectedItem.ToString(); + isWebSite = true; + } + else + { + Provider pro = OnlineClothing.FindContentProviderByName(contentProviders, URLSelection.SelectedItem.ToString()); + if (pro != null) + { + url = pro.URL; + isWebSite = false; + } + } + } #endregion #region Asset Downloader @@ -180,26 +247,6 @@ public partial class AssetSDK : Form return noErrors; } - private void AssetDownloader_URLSelection_SelectedIndexChanged(object sender, EventArgs e) - { - switch (AssetDownloader_URLSelection.SelectedIndex) - { - case 1: - url = "https://www.roblox.com/catalog/"; - isWebSite = true; - break; - case 2: - url = "https://www.roblox.com/library/"; - isWebSite = true; - break; - default: - //use defaults - url = "https://assetdelivery.roblox.com/v1/asset/?id="; - isWebSite = false; - break; - } - } - private void AssetDownloader_AssetDownloaderButton_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(URLOverrideBox.Text)) @@ -297,30 +344,9 @@ public partial class AssetSDK : Form AssetDownloader_AssetVersionSelector.Enabled = true; } } - - private void URLOverrideBox_Click(object sender, EventArgs e) - { - if (hasOverrideWarningOpenedOnce == false) - { - MessageBox.Show("By using the custom URL setting, you will override any selected entry in the default URL list. Keep this in mind before downloading anything with this option.\n\nAlso, the URL must be a asset url with 'asset/?id=' at the end of it in order for the Asset Downloader to work smoothly.", "Novetus Asset SDK - URL Override Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); - hasOverrideWarningOpenedOnce = true; - } - } - - private void URLOverrideBox_TextChanged(object sender, EventArgs e) - { - if (!string.IsNullOrWhiteSpace(URLOverrideBox.Text)) - { - AssetDownloader_URLSelection.Enabled = false; - } - else - { - AssetDownloader_URLSelection.Enabled = true; - } - } #endregion - #region Asset Localizer + #region Asset Fixer private static void DownloadFilesFromNode(string url, string path, string fileext, string id) { if (!string.IsNullOrWhiteSpace(id)) @@ -339,14 +365,26 @@ public partial class AssetSDK : Form } } - public static void DownloadFromNodes(XDocument doc, AssetCacheDef assetdef, string name = "", string meshname = "") + public static void DownloadOrFixURLS(XDocument doc, bool remote, string url, AssetCacheDef assetdef, string name = "", string meshname = "") { - DownloadFromNodes(doc, assetdef.Class, assetdef.Id[0], assetdef.Ext[0], assetdef.Dir[0], assetdef.GameDir[0], name, meshname); + DownloadOrFixURLS(doc, remote, url, assetdef, 0, 0, 0, 0, name, meshname); } - public static void DownloadFromNodes(XDocument doc, AssetCacheDef assetdef, int idIndex, int extIndex, int outputPathIndex, int inGameDirIndex, string name = "", string meshname = "") + public static void DownloadOrFixURLS(XDocument doc, bool remote, string url, AssetCacheDef assetdef, int idIndex, int extIndex, int outputPathIndex, int inGameDirIndex, string name = "", string meshname = "") { - DownloadFromNodes(doc, assetdef.Class, assetdef.Id[idIndex], assetdef.Ext[extIndex], assetdef.Dir[outputPathIndex], assetdef.GameDir[inGameDirIndex], name, meshname); + DownloadOrFixURLS(doc, remote, url, assetdef.Class, assetdef.Id[idIndex], assetdef.Ext[extIndex], assetdef.Dir[outputPathIndex], assetdef.GameDir[inGameDirIndex], name, meshname); + } + + public static void DownloadOrFixURLS(XDocument doc, bool remote, string url, string itemClassValue, string itemIdValue, string fileext, string outputPath, string inGameDir, string name = "", string meshname = "") + { + if (remote) + { + FixURLInNodes(doc, itemClassValue, itemIdValue, url); + } + else + { + DownloadFromNodes(doc, itemClassValue, itemIdValue, fileext, outputPath, inGameDir, name, meshname); + } } public static void DownloadFromNodes(XDocument doc, string itemClassValue, string itemIdValue, string fileext, string outputPath, string inGameDir, string name = "", string meshname = "") @@ -443,6 +481,66 @@ public partial class AssetSDK : Form } } + public static void FixURLInNodes(XDocument doc, string itemClassValue, string itemIdValue, string url) + { + var v = from nodes in doc.Descendants("Item") + where nodes.Attribute("class").Value == itemClassValue + select nodes; + + foreach (var item in v) + { + var v2 = from nodes in item.Descendants("Content") + where nodes.Attribute("name").Value == itemIdValue + select nodes; + + foreach (var item2 in v2) + { + var v3 = from nodes in item2.Descendants("url") + select nodes; + + foreach (var item3 in v3) + { + if (!item3.Value.Contains("rbxassetid")) + { + if (!item3.Value.Contains("rbxasset")) + { + string oldurl = item3.Value; + string urlFixed = oldurl.Replace("http://", "") + .Replace("https://", "") + .Replace("?version=1&id=", "?id=") + .Replace("www.roblox.com/asset/?id=", url) + .Replace("www.roblox.com/asset?id=", url) + .Replace("assetgame.roblox.com/asset/?id=", url) + .Replace("assetgame.roblox.com/asset?id=", url) + .Replace("roblox.com/asset/?id=", url) + .Replace("roblox.com/asset?id=", url) + .Replace("&", "&") + .Replace("amp;", "&"); + string peram = "id="; + + if (urlFixed.Contains(peram)) + { + item3.Value = urlFixed; + } + } + } + else + { + string oldurl = item3.Value; + string rbxassetid = "rbxassetid://"; + string urlFixed = url + oldurl.After(rbxassetid); + string peram = "id="; + + if (urlFixed.Contains(peram)) + { + item3.Value = urlFixed; + } + } + } + } + } + } + //TODO: actually download the script assets instead of fixing the scripts lol. fixing the scripts won't work anyways because we don't support https natively. /* public static void DownloadScriptFromNodes(string filepath, string itemClassValue) @@ -742,7 +840,7 @@ public partial class AssetSDK : Form return progressString + " " + percent.ToString() + "%"; } - public static void LocalizeAsset(RobloxFileType type, BackgroundWorker worker, string path, string itemname, string meshname) + public void LocalizeAsset(RobloxFileType type, BackgroundWorker worker, string path, string itemname, string meshname, bool useURLs = false, string remoteurl = "") { string oldfile = File.ReadAllText(path); string fixedfile = RobloxXML.RemoveInvalidXmlChars(RobloxXML.ReplaceHexadecimalSymbols(oldfile)).Replace(" ", "\t").Replace("#9;", "\t"); @@ -780,44 +878,44 @@ public partial class AssetSDK : Form } //meshes worker.ReportProgress(5); - DownloadFromNodes(doc, RobloxDefs.Fonts); - DownloadFromNodes(doc, RobloxDefs.Fonts, 1, 1, 1, 1); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Fonts); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Fonts, 1, 1, 1, 1); //skybox worker.ReportProgress(10); - DownloadFromNodes(doc, RobloxDefs.Sky); - DownloadFromNodes(doc, RobloxDefs.Sky, 1, 0, 0, 0); - DownloadFromNodes(doc, RobloxDefs.Sky, 2, 0, 0, 0); - DownloadFromNodes(doc, RobloxDefs.Sky, 3, 0, 0, 0); - DownloadFromNodes(doc, RobloxDefs.Sky, 4, 0, 0, 0); - DownloadFromNodes(doc, RobloxDefs.Sky, 5, 0, 0, 0); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sky); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sky, 1, 0, 0, 0); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sky, 2, 0, 0, 0); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sky, 3, 0, 0, 0); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sky, 4, 0, 0, 0); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sky, 5, 0, 0, 0); //decal worker.ReportProgress(15); - DownloadFromNodes(doc, RobloxDefs.Decal); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Decal); //texture worker.ReportProgress(20); - DownloadFromNodes(doc, RobloxDefs.Texture); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Texture); //tools and hopperbin worker.ReportProgress(25); - DownloadFromNodes(doc, RobloxDefs.Tool); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Tool); worker.ReportProgress(30); - DownloadFromNodes(doc, RobloxDefs.HopperBin); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.HopperBin); //sound worker.ReportProgress(40); - DownloadFromNodes(doc, RobloxDefs.Sound); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sound); worker.ReportProgress(50); - DownloadFromNodes(doc, RobloxDefs.ImageLabel); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ImageLabel); //clothing worker.ReportProgress(60); - DownloadFromNodes(doc, RobloxDefs.Shirt); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Shirt); worker.ReportProgress(65); - DownloadFromNodes(doc, RobloxDefs.ShirtGraphic); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ShirtGraphic); worker.ReportProgress(70); - DownloadFromNodes(doc, RobloxDefs.Pants); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Pants); //scripts worker.ReportProgress(80); - DownloadFromNodes(doc, RobloxDefs.Script); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Script); worker.ReportProgress(90); - DownloadFromNodes(doc, RobloxDefs.LocalScript); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.LocalScript); //localize any scripts that are not handled /* worker.ReportProgress(95); @@ -845,44 +943,44 @@ public partial class AssetSDK : Form worker.ReportProgress(0); } //meshes - DownloadFromNodes(doc, RobloxDefs.Fonts); - DownloadFromNodes(doc, RobloxDefs.Fonts, 1, 1, 1, 1); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Fonts); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Fonts, 1, 1, 1, 1); //skybox worker.ReportProgress(10); - DownloadFromNodes(doc, RobloxDefs.Sky); - DownloadFromNodes(doc, RobloxDefs.Sky, 1, 0, 0, 0); - DownloadFromNodes(doc, RobloxDefs.Sky, 2, 0, 0, 0); - DownloadFromNodes(doc, RobloxDefs.Sky, 3, 0, 0, 0); - DownloadFromNodes(doc, RobloxDefs.Sky, 4, 0, 0, 0); - DownloadFromNodes(doc, RobloxDefs.Sky, 5, 0, 0, 0); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sky); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sky, 1, 0, 0, 0); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sky, 2, 0, 0, 0); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sky, 3, 0, 0, 0); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sky, 4, 0, 0, 0); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sky, 5, 0, 0, 0); //decal worker.ReportProgress(15); - DownloadFromNodes(doc, RobloxDefs.Decal); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Decal); //texture worker.ReportProgress(20); - DownloadFromNodes(doc, RobloxDefs.Texture); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Texture); //tools and hopperbin worker.ReportProgress(25); - DownloadFromNodes(doc, RobloxDefs.Tool); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Tool); worker.ReportProgress(30); - DownloadFromNodes(doc, RobloxDefs.HopperBin); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.HopperBin); //sound worker.ReportProgress(40); - DownloadFromNodes(doc, RobloxDefs.Sound); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Sound); worker.ReportProgress(50); - DownloadFromNodes(doc, RobloxDefs.ImageLabel); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ImageLabel); //clothing worker.ReportProgress(60); - DownloadFromNodes(doc, RobloxDefs.Shirt); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Shirt); worker.ReportProgress(65); - DownloadFromNodes(doc, RobloxDefs.ShirtGraphic); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ShirtGraphic); worker.ReportProgress(70); - DownloadFromNodes(doc, RobloxDefs.Pants); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Pants); //scripts worker.ReportProgress(80); - DownloadFromNodes(doc, RobloxDefs.Script); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.Script); worker.ReportProgress(90); - DownloadFromNodes(doc, RobloxDefs.LocalScript); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.LocalScript); //localize any scripts that are not handled /* worker.ReportProgress(95); @@ -910,15 +1008,15 @@ public partial class AssetSDK : Form worker.ReportProgress(0); } //meshes - DownloadFromNodes(doc, RobloxDefs.ItemHatFonts, itemname, meshname); - DownloadFromNodes(doc, RobloxDefs.ItemHatFonts, 1, 1, 1, 1, itemname); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ItemHatFonts, itemname, meshname); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ItemHatFonts, 1, 1, 1, 1, itemname); worker.ReportProgress(25); - DownloadFromNodes(doc, RobloxDefs.ItemHatSound); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ItemHatSound); //scripts worker.ReportProgress(50); - DownloadFromNodes(doc, RobloxDefs.ItemHatScript); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ItemHatScript); worker.ReportProgress(75); - DownloadFromNodes(doc, RobloxDefs.ItemHatLocalScript); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ItemHatLocalScript); worker.ReportProgress(100); break; case RobloxFileType.Head: @@ -940,8 +1038,8 @@ public partial class AssetSDK : Form worker.ReportProgress(0); } //meshes - DownloadFromNodes(doc, RobloxDefs.ItemHeadFonts, itemname); - DownloadFromNodes(doc, RobloxDefs.ItemHeadFonts, 1, 1, 1, 1, itemname); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ItemHeadFonts, itemname); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ItemHeadFonts, 1, 1, 1, 1, itemname); worker.ReportProgress(100); break; case RobloxFileType.Face: @@ -963,7 +1061,7 @@ public partial class AssetSDK : Form worker.ReportProgress(0); } //decal - DownloadFromNodes(doc, RobloxDefs.ItemFaceTexture, itemname); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ItemFaceTexture, itemname); worker.ReportProgress(100); break; case RobloxFileType.TShirt: @@ -985,7 +1083,7 @@ public partial class AssetSDK : Form worker.ReportProgress(0); } //texture - DownloadFromNodes(doc, RobloxDefs.ItemTShirtTexture, itemname); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ItemTShirtTexture, itemname); worker.ReportProgress(100); break; case RobloxFileType.Shirt: @@ -1007,7 +1105,7 @@ public partial class AssetSDK : Form worker.ReportProgress(0); } //texture - DownloadFromNodes(doc, RobloxDefs.ItemShirtTexture, itemname); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ItemShirtTexture, itemname); worker.ReportProgress(100); break; case RobloxFileType.Pants: @@ -1029,7 +1127,7 @@ public partial class AssetSDK : Form worker.ReportProgress(0); } //texture - DownloadFromNodes(doc, RobloxDefs.ItemPantsTexture, itemname); + DownloadOrFixURLS(doc, useURLs, remoteurl, RobloxDefs.ItemPantsTexture, itemname); worker.ReportProgress(100); break; /*case RobloxFileType.Script: @@ -1062,7 +1160,7 @@ public partial class AssetSDK : Form catch (Exception ex) { GlobalFuncs.LogExceptions(ex); - MessageBox.Show("Error: Unable to localize the asset. " + ex.Message, "Novetus Asset SDK - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("Error: Unable to fix the asset. " + ex.Message, "Novetus Asset SDK - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { @@ -1147,6 +1245,12 @@ public partial class AssetSDK : Form private void AssetLocalization_LocalizeButton_Click(object sender, EventArgs e) { + if (isWebSite) + { + MessageBox.Show("Error: Unable to fix the asset because you chose a URL that cannot be downloaded from. Please choose a different URL.", "Novetus Asset SDK - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + OpenFileDialog robloxFileDialog = LoadROBLOXFileDialog(currentType); if (robloxFileDialog.ShowDialog() == DialogResult.OK) @@ -1160,7 +1264,9 @@ public partial class AssetSDK : Form private void AssetLocalization_BackgroundWorker_DoWork(object sender, DoWorkEventArgs e) { BackgroundWorker worker = sender as BackgroundWorker; - LocalizeAsset(currentType, worker, path, name, meshname); + LocalizeAsset(currentType, worker, path, name, meshname, + AssetLocalization_AssetLinks.Checked ? AssetLocalization_AssetLinks.Checked : false, + AssetLocalization_AssetLinks.Checked ? url : ""); } // This event handler updates the progress. @@ -1201,6 +1307,27 @@ public partial class AssetSDK : Form } private void AssetLocalization_LocalizePermanentlyBox_CheckedChanged(object sender, EventArgs e) + { + LocalizePermanentlyIfNeeded(); + } + + private void AssetLocalization_AssetLinks_CheckedChanged(object sender, EventArgs e) + { + if (AssetLocalization_AssetLinks.Checked) + { + AssetLocalization_LocalizeButton.Text = AssetLocalization_LocalizeButton.Text.Replace("Localize", "Fix"); + AssetLocalization_LocalizePermanentlyBox.Enabled = false; + SetAssetCachePaths(); + } + else + { + AssetLocalization_LocalizeButton.Text = AssetLocalization_LocalizeButton.Text.Replace("Fix", "Localize"); + AssetLocalization_LocalizePermanentlyBox.Enabled = true; + LocalizePermanentlyIfNeeded(); + } + } + + void LocalizePermanentlyIfNeeded() { if (AssetLocalization_LocalizePermanentlyBox.Checked) { diff --git a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs index cbbc441..3f571bb 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs @@ -62,6 +62,8 @@ partial class ClientinfoEditor this.studioToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.no3dToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.sharedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.validateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.addValidateTagsForRelativePathToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.variablesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.generalToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mapfileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -69,12 +71,13 @@ partial class ClientinfoEditor this.mapfilecToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.luafileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ipToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.portToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.addonscriptpathToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.scripttypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.versionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.doublequoteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.joinportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.validatedextrafilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.argstringToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.serverToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.limitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.notificationsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -144,10 +147,7 @@ partial class ClientinfoEditor this.comboBox1 = new System.Windows.Forms.ComboBox(); this.label10 = new System.Windows.Forms.Label(); this.checkBox5 = new System.Windows.Forms.CheckBox(); - this.validatedextrafilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.validateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.argstringToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.addValidateTagsForRelativePathToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.portToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -378,6 +378,22 @@ partial class ClientinfoEditor this.sharedToolStripMenuItem.Text = ""; this.sharedToolStripMenuItem.Click += new System.EventHandler(this.sharedToolStripMenuItem_Click); // + // validateToolStripMenuItem + // + this.validateToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.addValidateTagsForRelativePathToolStripMenuItem}); + this.validateToolStripMenuItem.Name = "validateToolStripMenuItem"; + this.validateToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.validateToolStripMenuItem.Text = ""; + this.validateToolStripMenuItem.Click += new System.EventHandler(this.validateToolStripMenuItem_Click); + // + // addValidateTagsForRelativePathToolStripMenuItem + // + this.addValidateTagsForRelativePathToolStripMenuItem.Name = "addValidateTagsForRelativePathToolStripMenuItem"; + this.addValidateTagsForRelativePathToolStripMenuItem.Size = new System.Drawing.Size(255, 22); + this.addValidateTagsForRelativePathToolStripMenuItem.Text = "Add Validate Tags for Relative Path"; + this.addValidateTagsForRelativePathToolStripMenuItem.Click += new System.EventHandler(this.addValidateTagsForRelativePathToolStripMenuItem_click); + // // variablesToolStripMenuItem // this.variablesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -399,7 +415,6 @@ partial class ClientinfoEditor this.mapfilecToolStripMenuItem, this.luafileToolStripMenuItem, this.ipToolStripMenuItem, - this.portToolStripMenuItem, this.addonscriptpathToolStripMenuItem, this.scripttypeToolStripMenuItem, this.versionToolStripMenuItem, @@ -446,13 +461,6 @@ partial class ClientinfoEditor this.ipToolStripMenuItem.Text = "%ip%"; this.ipToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // - // portToolStripMenuItem - // - this.portToolStripMenuItem.Name = "portToolStripMenuItem"; - this.portToolStripMenuItem.Size = new System.Drawing.Size(189, 22); - this.portToolStripMenuItem.Text = "%port%"; - this.portToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); - // // addonscriptpathToolStripMenuItem // this.addonscriptpathToolStripMenuItem.Name = "addonscriptpathToolStripMenuItem"; @@ -488,11 +496,26 @@ partial class ClientinfoEditor this.joinportToolStripMenuItem.Text = "%joinport%"; this.joinportToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // + // validatedextrafilesToolStripMenuItem + // + this.validatedextrafilesToolStripMenuItem.Name = "validatedextrafilesToolStripMenuItem"; + this.validatedextrafilesToolStripMenuItem.Size = new System.Drawing.Size(189, 22); + this.validatedextrafilesToolStripMenuItem.Text = "%validatedextrafiles%"; + this.validatedextrafilesToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); + // + // argstringToolStripMenuItem + // + this.argstringToolStripMenuItem.Name = "argstringToolStripMenuItem"; + this.argstringToolStripMenuItem.Size = new System.Drawing.Size(189, 22); + this.argstringToolStripMenuItem.Text = "%argstring%"; + this.argstringToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); + // // serverToolStripMenuItem1 // this.serverToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.limitToolStripMenuItem, - this.notificationsToolStripMenuItem}); + this.notificationsToolStripMenuItem, + this.portToolStripMenuItem}); this.serverToolStripMenuItem1.Name = "serverToolStripMenuItem1"; this.serverToolStripMenuItem1.Size = new System.Drawing.Size(180, 22); this.serverToolStripMenuItem1.Text = "Server"; @@ -599,7 +622,7 @@ partial class ClientinfoEditor this.charappToolStripMenuItem, this.loadoutToolStripMenuItem}); this.customizationToolStripMenuItem.Name = "customizationToolStripMenuItem"; - this.customizationToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.customizationToolStripMenuItem.Size = new System.Drawing.Size(151, 22); this.customizationToolStripMenuItem.Text = "Customization"; // // bodyColorsToolStripMenuItem @@ -899,21 +922,21 @@ partial class ClientinfoEditor // nameToolStripMenuItem // this.nameToolStripMenuItem.Name = "nameToolStripMenuItem"; - this.nameToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.nameToolStripMenuItem.Size = new System.Drawing.Size(151, 22); this.nameToolStripMenuItem.Text = "%name%"; this.nameToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // idToolStripMenuItem // this.idToolStripMenuItem.Name = "idToolStripMenuItem"; - this.idToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.idToolStripMenuItem.Size = new System.Drawing.Size(151, 22); this.idToolStripMenuItem.Text = "%id%"; this.idToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // tripcodeToolStripMenuItem // this.tripcodeToolStripMenuItem.Name = "tripcodeToolStripMenuItem"; - this.tripcodeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.tripcodeToolStripMenuItem.Size = new System.Drawing.Size(151, 22); this.tripcodeToolStripMenuItem.Text = "%tripcode%"; this.tripcodeToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // @@ -929,14 +952,14 @@ partial class ClientinfoEditor // donothingToolStripMenuItem // this.donothingToolStripMenuItem.Name = "donothingToolStripMenuItem"; - this.donothingToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.donothingToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.donothingToolStripMenuItem.Text = "%donothing%"; this.donothingToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // disabledToolStripMenuItem // this.disabledToolStripMenuItem.Name = "disabledToolStripMenuItem"; - this.disabledToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.disabledToolStripMenuItem.Size = new System.Drawing.Size(150, 22); this.disabledToolStripMenuItem.Text = "%disabled%"; this.disabledToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // @@ -1077,35 +1100,12 @@ partial class ClientinfoEditor this.checkBox5.UseVisualStyleBackColor = true; this.checkBox5.CheckedChanged += new System.EventHandler(this.checkBox5_CheckedChanged); // - // validatedextrafilesToolStripMenuItem + // portToolStripMenuItem // - this.validatedextrafilesToolStripMenuItem.Name = "validatedextrafilesToolStripMenuItem"; - this.validatedextrafilesToolStripMenuItem.Size = new System.Drawing.Size(189, 22); - this.validatedextrafilesToolStripMenuItem.Text = "%validatedextrafiles%"; - this.validatedextrafilesToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); - // - // validateToolStripMenuItem - // - this.validateToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.addValidateTagsForRelativePathToolStripMenuItem}); - this.validateToolStripMenuItem.Name = "validateToolStripMenuItem"; - this.validateToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.validateToolStripMenuItem.Text = ""; - this.validateToolStripMenuItem.Click += new System.EventHandler(this.validateToolStripMenuItem_Click); - // - // argstringToolStripMenuItem - // - this.argstringToolStripMenuItem.Name = "argstringToolStripMenuItem"; - this.argstringToolStripMenuItem.Size = new System.Drawing.Size(189, 22); - this.argstringToolStripMenuItem.Text = "%argstring%"; - this.argstringToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); - // - // addValidateTagsForRelativePathToolStripMenuItem - // - this.addValidateTagsForRelativePathToolStripMenuItem.Name = "addValidateTagsForRelativePathToolStripMenuItem"; - this.addValidateTagsForRelativePathToolStripMenuItem.Size = new System.Drawing.Size(255, 22); - this.addValidateTagsForRelativePathToolStripMenuItem.Text = "Add Validate Tags for Relative Path"; - this.addValidateTagsForRelativePathToolStripMenuItem.Click += new System.EventHandler(this.addValidateTagsForRelativePathToolStripMenuItem_click); + this.portToolStripMenuItem.Name = "portToolStripMenuItem"; + this.portToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.portToolStripMenuItem.Text = "%port%"; + this.portToolStripMenuItem.Click += new System.EventHandler(this.variableToolStripMenuItem_Click); // // ClientinfoEditor // @@ -1178,7 +1178,6 @@ partial class ClientinfoEditor private System.Windows.Forms.ToolStripMenuItem mapfiledToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem luafileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ipToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem portToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem addonscriptpathToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem serverToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem limitToolStripMenuItem; @@ -1257,4 +1256,5 @@ partial class ClientinfoEditor private System.Windows.Forms.ToolStripMenuItem validatedextrafilesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem argstringToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem addValidateTagsForRelativePathToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem portToolStripMenuItem; } diff --git a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs index e103cfa..65b8fdf 100644 --- a/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs @@ -479,10 +479,10 @@ public partial class ClientinfoEditor : Form { SelectedClientInfo.ScriptMD5 = ClientScriptMD5.ToUpper(CultureInfo.InvariantCulture); } - else + /*else { MessageBox.Show("Cannot load '" + GlobalPaths.ScriptName + ".lua'. Please make sure you saved the clientinfo.nov into the client directory and if the file exists.", "Novetus Client SDK - Error while generating MD5 for script", MessageBoxButtons.OK, MessageBoxIcon.Error); - } + }*/ } private void AddClientinfoText(string text)