Finalized Asset Localizer

This commit is contained in:
Bitl 2019-11-12 19:39:38 -07:00
parent 2ef7260714
commit 974aefb46a
3 changed files with 152 additions and 13 deletions

View File

@ -25,7 +25,7 @@ public static class RobloxXMLLocalizer
Pants Pants
} }
public static void LoadRBXFile(DLType type) public static void LoadRBXFile(DLType type, string stringToUpdate = "")
{ {
OpenFileDialog openFileDialog1 = new OpenFileDialog() OpenFileDialog openFileDialog1 = new OpenFileDialog()
{ {
@ -44,16 +44,31 @@ public static class RobloxXMLLocalizer
//backup the original copy //backup the original copy
try try
{ {
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Backing up RBXL...";
}
File.Copy(path, path.Replace(".rbxl", " BAK.rbxl")); File.Copy(path, path.Replace(".rbxl", " BAK.rbxl"));
} }
catch(Exception) when (!Env.Debugging) catch(Exception ex) when (!Env.Debugging)
{ {
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Failed to back up RBXL. " + ex.Message;
}
} }
//meshes //meshes
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXL Meshes and Textures...";
}
DownloadFromNodes(path, GlobalVars.Fonts); DownloadFromNodes(path, GlobalVars.Fonts);
DownloadFromNodes(path, GlobalVars.Fonts, 1, 1, 1, 1); DownloadFromNodes(path, GlobalVars.Fonts, 1, 1, 1, 1);
//skybox //skybox
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXL Skybox Textures...";
}
DownloadFromNodes(path, GlobalVars.Sky); DownloadFromNodes(path, GlobalVars.Sky);
DownloadFromNodes(path, GlobalVars.Sky, 1, 0, 0, 0); DownloadFromNodes(path, GlobalVars.Sky, 1, 0, 0, 0);
DownloadFromNodes(path, GlobalVars.Sky, 2, 0, 0, 0); DownloadFromNodes(path, GlobalVars.Sky, 2, 0, 0, 0);
@ -61,26 +76,70 @@ public static class RobloxXMLLocalizer
DownloadFromNodes(path, GlobalVars.Sky, 4, 0, 0, 0); DownloadFromNodes(path, GlobalVars.Sky, 4, 0, 0, 0);
DownloadFromNodes(path, GlobalVars.Sky, 5, 0, 0, 0); DownloadFromNodes(path, GlobalVars.Sky, 5, 0, 0, 0);
//decal //decal
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXL Decal Textures...";
}
DownloadFromNodes(path, GlobalVars.Decal); DownloadFromNodes(path, GlobalVars.Decal);
//texture //texture
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXL Textures...";
}
DownloadFromNodes(path, GlobalVars.Texture); DownloadFromNodes(path, GlobalVars.Texture);
//tools and hopperbin //tools and hopperbin
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXL Tool Textures...";
}
DownloadFromNodes(path, GlobalVars.Tool); DownloadFromNodes(path, GlobalVars.Tool);
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXL HopperBin Textures...";
}
DownloadFromNodes(path, GlobalVars.HopperBin); DownloadFromNodes(path, GlobalVars.HopperBin);
//sound //sound
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXL Sounds...";
}
DownloadFromNodes(path, GlobalVars.Sound); DownloadFromNodes(path, GlobalVars.Sound);
//gui //gui
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXL GUI Textures...";
}
DownloadFromNodes(path, GlobalVars.ImageLabel); DownloadFromNodes(path, GlobalVars.ImageLabel);
//clothing //clothing
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXL Shirt Textures...";
}
DownloadFromNodes(path, GlobalVars.Shirt); DownloadFromNodes(path, GlobalVars.Shirt);
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXL T-Shirt Textures...";
}
DownloadFromNodes(path, GlobalVars.ShirtGraphic); DownloadFromNodes(path, GlobalVars.ShirtGraphic);
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXL Pants Textures...";
}
DownloadFromNodes(path, GlobalVars.Pants); DownloadFromNodes(path, GlobalVars.Pants);
break; goto default;
case DLType.RBXM: case DLType.RBXM:
//meshes //meshes
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXM Meshes and Textures...";
}
DownloadFromNodes(path, GlobalVars.Fonts); DownloadFromNodes(path, GlobalVars.Fonts);
DownloadFromNodes(path, GlobalVars.Fonts, 1, 1, 1, 1); DownloadFromNodes(path, GlobalVars.Fonts, 1, 1, 1, 1);
//skybox //skybox
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXM Skybox Textures...";
}
DownloadFromNodes(path, GlobalVars.Sky); DownloadFromNodes(path, GlobalVars.Sky);
DownloadFromNodes(path, GlobalVars.Sky, 1, 0, 0, 0); DownloadFromNodes(path, GlobalVars.Sky, 1, 0, 0, 0);
DownloadFromNodes(path, GlobalVars.Sky, 2, 0, 0, 0); DownloadFromNodes(path, GlobalVars.Sky, 2, 0, 0, 0);
@ -88,49 +147,117 @@ public static class RobloxXMLLocalizer
DownloadFromNodes(path, GlobalVars.Sky, 4, 0, 0, 0); DownloadFromNodes(path, GlobalVars.Sky, 4, 0, 0, 0);
DownloadFromNodes(path, GlobalVars.Sky, 5, 0, 0, 0); DownloadFromNodes(path, GlobalVars.Sky, 5, 0, 0, 0);
//decal //decal
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXM Decal Textures...";
}
DownloadFromNodes(path, GlobalVars.Decal); DownloadFromNodes(path, GlobalVars.Decal);
//texture //texture
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXM Textures...";
}
DownloadFromNodes(path, GlobalVars.Texture); DownloadFromNodes(path, GlobalVars.Texture);
//tools and hopperbin //tools and hopperbin
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXM Tool Textures...";
}
DownloadFromNodes(path, GlobalVars.Tool); DownloadFromNodes(path, GlobalVars.Tool);
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXM HopperBin Textures...";
}
DownloadFromNodes(path, GlobalVars.HopperBin); DownloadFromNodes(path, GlobalVars.HopperBin);
//sound //sound
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXM Sounds...";
}
DownloadFromNodes(path, GlobalVars.Sound); DownloadFromNodes(path, GlobalVars.Sound);
//gui //gui
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXM GUI Textures...";
}
DownloadFromNodes(path, GlobalVars.ImageLabel); DownloadFromNodes(path, GlobalVars.ImageLabel);
//clothing //clothing
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXM Shirt Textures...";
}
DownloadFromNodes(path, GlobalVars.Shirt); DownloadFromNodes(path, GlobalVars.Shirt);
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXM T-Shirt Textures...";
}
DownloadFromNodes(path, GlobalVars.ShirtGraphic); DownloadFromNodes(path, GlobalVars.ShirtGraphic);
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading RBXM Pants Textures...";
}
DownloadFromNodes(path, GlobalVars.Pants); DownloadFromNodes(path, GlobalVars.Pants);
break; goto default;
case DLType.Hat: case DLType.Hat:
//meshes //meshes
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading Hat Meshes and Textures...";
}
DownloadFromNodes(path, GlobalVars.ItemHatFonts); DownloadFromNodes(path, GlobalVars.ItemHatFonts);
DownloadFromNodes(path, GlobalVars.ItemHatFonts, 1, 1, 1, 1); DownloadFromNodes(path, GlobalVars.ItemHatFonts, 1, 1, 1, 1);
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading Hat Sounds...";
}
DownloadFromNodes(path, GlobalVars.ItemHatSound); DownloadFromNodes(path, GlobalVars.ItemHatSound);
break; goto default;
case DLType.Head: case DLType.Head:
//meshes //meshes
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading Head Meshes and Textures...";
}
DownloadFromNodes(path, GlobalVars.ItemHeadFonts); DownloadFromNodes(path, GlobalVars.ItemHeadFonts);
DownloadFromNodes(path, GlobalVars.ItemHeadFonts, 1, 1, 1, 1); DownloadFromNodes(path, GlobalVars.ItemHeadFonts, 1, 1, 1, 1);
break; goto default;
case DLType.Face: case DLType.Face:
//decal //decal
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading Face Textures...";
}
DownloadFromNodes(path, GlobalVars.ItemFaceTexture); DownloadFromNodes(path, GlobalVars.ItemFaceTexture);
break; goto default;
case DLType.TShirt: case DLType.TShirt:
//texture //texture
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading T-Shirt Textures...";
}
DownloadFromNodes(path, GlobalVars.ItemTShirtTexture); DownloadFromNodes(path, GlobalVars.ItemTShirtTexture);
break; goto default;
case DLType.Shirt: case DLType.Shirt:
//texture //texture
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading Shirt Textures...";
}
DownloadFromNodes(path, GlobalVars.ItemShirtTexture); DownloadFromNodes(path, GlobalVars.ItemShirtTexture);
break; goto default;
case DLType.Pants: case DLType.Pants:
//texture //texture
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Downloading Pants Textures...";
}
DownloadFromNodes(path, GlobalVars.ItemPantsTexture); DownloadFromNodes(path, GlobalVars.ItemPantsTexture);
break; goto default;
default: default:
if (!string.IsNullOrWhiteSpace(stringToUpdate))
{
stringToUpdate = "Doing Nothing";
}
break; break;
} }
} }

View File

@ -31,6 +31,7 @@
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AssetLocalizer)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AssetLocalizer));
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
this.comboBox1 = new System.Windows.Forms.ComboBox(); this.comboBox1 = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout(); this.SuspendLayout();
// //
// button1 // button1
@ -62,12 +63,22 @@
this.comboBox1.TabIndex = 1; this.comboBox1.TabIndex = 1;
this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
// //
// label2
//
this.label2.Location = new System.Drawing.Point(12, 67);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(240, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Doing Nothing";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// AssetLocalizer // AssetLocalizer
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ControlLightLight; this.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.ClientSize = new System.Drawing.Size(264, 70); this.ClientSize = new System.Drawing.Size(264, 89);
this.Controls.Add(this.label2);
this.Controls.Add(this.comboBox1); this.Controls.Add(this.comboBox1);
this.Controls.Add(this.button1); this.Controls.Add(this.button1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
@ -83,5 +94,6 @@
private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button1;
private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Label label2;
} }
} }

View File

@ -23,7 +23,7 @@ namespace NovetusLauncher
{ {
try try
{ {
RobloxXMLLocalizer.LoadRBXFile(currentType); RobloxXMLLocalizer.LoadRBXFile(currentType, label2.Text);
} }
catch (Exception ex) when (!Env.Debugging) catch (Exception ex) when (!Env.Debugging)
{ {