Finished SDK regions

This commit is contained in:
Bitl 2020-07-09 18:03:26 -07:00
parent d25ef8dedb
commit c2fabb9ec2
8 changed files with 311 additions and 263 deletions

View File

@ -1,13 +1,30 @@
#region Usings
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Security.Policy;
using System.Text;
using System.Windows.Forms;
#endregion
namespace NovetusLauncher
{
#region SDKApps
enum SDKApps
{
ItemSDK = 0,
ClientSDK = 1,
ClientScriptDoc = 2,
AssetLocalizer = 3,
SplashTester = 4,
Obj2MeshV1GUI = 5,
ScriptGenerator = 6,
LegacyPlaceConverter = 7,
DiogenesEditor = 8
}
#endregion
#region SDK Functions
class SDKFuncs
{
@ -493,7 +510,7 @@ namespace NovetusLauncher
{
MessageBox.Show("Error: Unable to localize the asset. " + ex.Message, "Novetus Asset Localizer", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
#endregion
#region Client SDK
@ -673,6 +690,239 @@ namespace NovetusLauncher
return result.ToString();
}
public static void LoadDiogenes(string veroutput, string textoutput)
{
using (var ofd = new OpenFileDialog())
{
ofd.Filter = "ROBLOX Diogenes filter (diogenes.fnt)|diogenes.fnt";
ofd.FilterIndex = 1;
ofd.FileName = "diogenes.fnt";
ofd.Title = "Load diogenes.fnt";
if (ofd.ShowDialog() == DialogResult.OK)
{
StringBuilder builder = new StringBuilder();
using (StreamReader reader = new StreamReader(ofd.FileName))
{
while (!reader.EndOfStream)
{
string line = reader.ReadLine();
try
{
line = DiogenesCrypt(line);
veroutput = "v2";
}
catch (Exception)
{
veroutput = "v1";
continue;
}
builder.Append(line + Environment.NewLine);
}
}
textoutput = builder.ToString();
}
}
}
public static void SaveDiogenes(string veroutput, string[] lineinput, bool textonly = false)
{
using (var sfd = new SaveFileDialog())
{
sfd.Filter = "ROBLOX Diogenes filter v2 (diogenes.fnt)|diogenes.fnt|ROBLOX Diogenes filter v1 (diogenes.fnt)|diogenes.fnt";
sfd.FilterIndex = 1;
sfd.FileName = "diogenes.fnt";
sfd.Title = "Save diogenes.fnt";
if (sfd.ShowDialog() == DialogResult.OK)
{
if (!textonly)
{
StringBuilder builder = new StringBuilder();
foreach (string s in lineinput)
{
if (sfd.FilterIndex == 1)
{
builder.Append(DiogenesCrypt(s) + Environment.NewLine);
veroutput = "v2";
}
else
{
builder.Append(s + Environment.NewLine);
veroutput = "v1";
}
}
using (StreamWriter sw = File.CreateText(sfd.FileName))
{
sw.Write(builder.ToString());
}
}
else
{
File.WriteAllLines(sfd.FileName, lineinput);
}
}
}
}
#endregion
#region Item SDK
public static void StartItemDownload(string name, string url, string id, int ver, bool iswebsite)
{
try
{
string version = ((ver != 0) && (!iswebsite)) ? "&version=" + ver : "";
string fullURL = url + id + version;
if (!iswebsite)
{
if (!GlobalVars.UserConfiguration.DisabledItemMakerHelp)
{
string helptext = "If you're trying to create a offline item, please use these file extension names when saving your files:\n.rbxm - ROBLOX Model/Item\n.mesh - ROBLOX Mesh\n.png - Texture/Icon\n.wav - Sound";
MessageBox.Show(helptext, "Novetus Item SDK", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
Downloader download = new Downloader(fullURL, name, "Roblox Model (*.rbxm)|*.rbxm|Roblox Mesh (*.mesh)|*.mesh|PNG Image (*.png)|*.png|WAV Sound (*.wav)|*.wav");
try
{
string helptext = "In order for the item to work in Novetus, you'll need to find an icon for your item (it must be a .png file), then name it the same name as your item.\n\nIf you want to create a local (offline) item, you'll have to download the meshes/textures from the links in the rbxm file, then replace the links in the file pointing to where they are using rbxasset://. Look at the directory in the 'shareddata/charcustom' folder that best suits your item type, then look at the rbxm for any one of the items. If you get a corrupted file, change the URL using the drop down box.";
download.InitDownload((!GlobalVars.UserConfiguration.DisabledItemMakerHelp) ? helptext : "");
}
catch (Exception ex)
{
MessageBox.Show("Error: Unable to download the file. " + ex.Message, "Novetus Item SDK | Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
if (!string.IsNullOrWhiteSpace(download.getDownloadOutcome()))
{
MessageBox.Show(download.getDownloadOutcome(), "Novetus Item SDK", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
else
{
System.Diagnostics.Process.Start(fullURL);
if (!GlobalVars.UserConfiguration.DisabledItemMakerHelp)
{
string helptext = "In order for the item to work in Novetus, you'll need to find an icon for your item (it must be a .png file), then name it the same name as your item.\n\nIf you want to create a local (offline) item, you'll have to download the meshes/textures from the links in the rbxm file, then replace the links in the file pointing to where they are using rbxasset://. Look at the directory in the 'shareddata/charcustom' folder that best suits your item type, then look at the rbxm for any one of the items. If you get a corrupted file, change the URL using the drop down box.\n\nIf you're trying to create a offline item, please use these file extension names when saving your files:\n.rbxm - ROBLOX Model/Item\n.mesh - ROBLOX Mesh\n.png - Texture/Icon\n.wav - Sound";
MessageBox.Show(helptext, "Novetus Item SDK", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
catch (Exception)
{
MessageBox.Show("Error: Unable to download the file. Try using a different file name or ID.", "Novetus Item SDK | Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
public static void SelectItemDownloadURL(int index, string url, bool iswebsite)
{
switch (index)
{
case 1:
url = "http://assetgame.roblox.com/asset/?id=";
iswebsite = false;
break;
case 2:
url = "https://www.roblox.com/catalog/";
iswebsite = true;
break;
case 3:
url = "https://www.roblox.com/library/";
iswebsite = true;
break;
default:
url = "http://www.roblox.com/asset?id=";
iswebsite = false;
break;
}
}
#endregion
#region SDK Launcher
public static void LaunchSDKAppByIndex(int index)
{
SDKApps selectedApp = GetSDKAppForIndex(index);
switch (selectedApp)
{
case SDKApps.ClientSDK:
ClientinfoEditor cie = new ClientinfoEditor();
cie.Show();
break;
case SDKApps.ClientScriptDoc:
ClientScriptDocumentation csd = new ClientScriptDocumentation();
csd.Show();
break;
case SDKApps.AssetLocalizer:
AssetLocalizer al = new AssetLocalizer();
al.Show();
break;
case SDKApps.SplashTester:
SplashTester st = new SplashTester();
st.Show();
break;
case SDKApps.Obj2MeshV1GUI:
Obj2MeshV1GUI obj = new Obj2MeshV1GUI();
obj.Show();
break;
case SDKApps.ScriptGenerator:
Process proc = new Process();
proc.StartInfo.FileName = GlobalPaths.ConfigDirData + "\\RSG.exe";
proc.StartInfo.CreateNoWindow = false;
proc.StartInfo.UseShellExecute = false;
proc.Start();
break;
case SDKApps.LegacyPlaceConverter:
Process proc2 = new Process();
proc2.StartInfo.FileName = GlobalPaths.ConfigDirData + "\\Roblox_Legacy_Place_Converter.exe";
proc2.StartInfo.CreateNoWindow = false;
proc2.StartInfo.UseShellExecute = false;
proc2.Start();
break;
case SDKApps.DiogenesEditor:
DiogenesEditor dio = new DiogenesEditor();
dio.Show();
break;
default:
ItemMaker im = new ItemMaker();
im.Show();
break;
}
}
public static SDKApps GetSDKAppForIndex(int index)
{
switch (index)
{
case 1:
return SDKApps.ClientSDK;
case 2:
return SDKApps.ClientScriptDoc;
case 3:
return SDKApps.AssetLocalizer;
case 4:
return SDKApps.SplashTester;
case 5:
return SDKApps.Obj2MeshV1GUI;
case 6:
return SDKApps.ScriptGenerator;
case 7:
return SDKApps.LegacyPlaceConverter;
case 8:
return SDKApps.DiogenesEditor;
default:
return SDKApps.ItemSDK;
}
}
#endregion
}
#endregion

View File

@ -1,4 +1,4 @@
namespace NovetusLauncher.SDK
namespace NovetusLauncher
{
partial class DiogenesEditor
{

View File

@ -5,19 +5,19 @@ using System.Text;
using System.Windows.Forms;
#endregion
namespace NovetusLauncher.SDK
namespace NovetusLauncher
{
//UNFINISHED REGIONING
#region Diogenes Editor
public partial class DiogenesEditor : Form
{
#region Constructor
public DiogenesEditor()
{
InitializeComponent();
}
#endregion
#region Form Events
void NewToolStripMenuItemClick(object sender, EventArgs e)
{
label2.Text = "Not Loaded";
@ -26,92 +26,19 @@ namespace NovetusLauncher.SDK
void LoadToolStripMenuItemClick(object sender, EventArgs e)
{
using (var ofd = new OpenFileDialog())
{
ofd.Filter = "ROBLOX Diogenes filter (diogenes.fnt)|diogenes.fnt";
ofd.FilterIndex = 1;
ofd.FileName = "diogenes.fnt";
ofd.Title = "Load diogenes.fnt";
if (ofd.ShowDialog() == DialogResult.OK)
{
StringBuilder builder = new StringBuilder();
using (StreamReader reader = new StreamReader(ofd.FileName))
{
while (!reader.EndOfStream)
{
string line = reader.ReadLine();
try
{
line = DiogenesCrypt(line);
label2.Text = "v2";
}
catch(Exception)
{
label2.Text = "v1";
continue;
}
builder.Append(line + Environment.NewLine);
}
}
richTextBox1.Text = builder.ToString();
}
}
SDKFuncs.LoadDiogenes(label2.Text, richTextBox1.Text);
}
void SaveToolStripMenuItemClick(object sender, EventArgs e)
{
using (var sfd = new SaveFileDialog())
{
sfd.Filter = "ROBLOX Diogenes filter v2 (diogenes.fnt)|diogenes.fnt|ROBLOX Diogenes filter v1 (diogenes.fnt)|diogenes.fnt";
sfd.FilterIndex = 1;
sfd.FileName = "diogenes.fnt";
sfd.Title = "Save diogenes.fnt";
if (sfd.ShowDialog() == DialogResult.OK)
{
StringBuilder builder = new StringBuilder();
foreach (string s in richTextBox1.Lines)
{
if (sfd.FilterIndex == 1)
{
builder.Append(DiogenesCrypt(s) + Environment.NewLine);
label2.Text = "v2";
}
else
{
builder.Append(s + Environment.NewLine);
label2.Text = "v1";
}
}
using (StreamWriter sw = File.CreateText(sfd.FileName))
{
sw.Write(builder.ToString());
}
}
}
SDKFuncs.SaveDiogenes(label2.Text, richTextBox1.Lines);
}
void saveAsTextFileToolStripMenuItem_Click(object sender, EventArgs e)
{
using (var sfd = new SaveFileDialog())
{
sfd.Filter = "Text file (*.txt)|*.txt";
sfd.FilterIndex = 1;
sfd.FileName = "diogenes.txt";
sfd.Title = "Save diogenes.txt";
if (sfd.ShowDialog() == DialogResult.OK)
{
File.WriteAllLines(sfd.FileName, richTextBox1.Lines);
}
}
SDKFuncs.SaveDiogenes(label2.Text, richTextBox1.Lines, true);
}
#endregion
}
#endregion
}

View File

@ -1,108 +1,34 @@
/*
* Created by SharpDevelop.
* User: BITL
* Date: 10/31/2018
* Time: 11:55 AM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
#region Usings
using System;
using System.Windows.Forms;
using System.ComponentModel;
using System.IO;
#endregion
namespace NovetusLauncher
{
/// <summary>
/// Description of ItemMaker.
/// </summary>
public partial class ItemMaker : Form
#region Item SDK
public partial class ItemMaker : Form
{
private string url = "http://www.roblox.com/asset?id=";
#region Private Variables
private string url = "http://www.roblox.com/asset?id=";
private bool isWebSite = false;
public ItemMaker()
#endregion
#region Constructor
public ItemMaker()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void Button1Click(object sender, EventArgs e)
#endregion
#region Form Events
void Button1Click(object sender, EventArgs e)
{
try
{
string version = ((numericUpDown1.Value != 0) && (!isWebSite)) ? "&version=" + numericUpDown1.Value : "";
string fullURL = url + textBox2.Text + version;
if (!isWebSite)
{
if (!GlobalVars.UserConfiguration.DisabledItemMakerHelp)
{
string helptext = "If you're trying to create a offline item, please use these file extension names when saving your files:\n.rbxm - ROBLOX Model/Item\n.mesh - ROBLOX Mesh\n.png - Texture/Icon\n.wav - Sound";
MessageBox.Show(helptext, "Novetus Item SDK", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
Downloader download = new Downloader(fullURL, textBox1.Text, "Roblox Model (*.rbxm)|*.rbxm|Roblox Mesh (*.mesh)|*.mesh|PNG Image (*.png)|*.png|WAV Sound (*.wav)|*.wav");
try
{
string helptext = "In order for the item to work in Novetus, you'll need to find an icon for your item (it must be a .png file), then name it the same name as your item.\n\nIf you want to create a local (offline) item, you'll have to download the meshes/textures from the links in the rbxm file, then replace the links in the file pointing to where they are using rbxasset://. Look at the directory in the 'shareddata/charcustom' folder that best suits your item type, then look at the rbxm for any one of the items. If you get a corrupted file, change the URL using the drop down box.";
download.InitDownload((!GlobalVars.UserConfiguration.DisabledItemMakerHelp) ? helptext : "");
}
catch (Exception ex)
{
MessageBox.Show("Error: Unable to download the file. " +ex.Message, "Novetus Item SDK | Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
if (!string.IsNullOrWhiteSpace(download.getDownloadOutcome()))
{
MessageBox.Show(download.getDownloadOutcome(), "Novetus Item SDK", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
else
{
System.Diagnostics.Process.Start(fullURL);
if (!GlobalVars.UserConfiguration.DisabledItemMakerHelp)
{
string helptext = "In order for the item to work in Novetus, you'll need to find an icon for your item (it must be a .png file), then name it the same name as your item.\n\nIf you want to create a local (offline) item, you'll have to download the meshes/textures from the links in the rbxm file, then replace the links in the file pointing to where they are using rbxasset://. Look at the directory in the 'shareddata/charcustom' folder that best suits your item type, then look at the rbxm for any one of the items. If you get a corrupted file, change the URL using the drop down box.\n\nIf you're trying to create a offline item, please use these file extension names when saving your files:\n.rbxm - ROBLOX Model/Item\n.mesh - ROBLOX Mesh\n.png - Texture/Icon\n.wav - Sound";
MessageBox.Show(helptext, "Novetus Item SDK", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
catch (Exception)
{
MessageBox.Show("Error: Unable to download the file. Try using a different file name or ID.","Novetus Item SDK | Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
SDKFuncs.StartItemDownload(textBox1.Text, url, textBox2.Text, Convert.ToInt32(numericUpDown1.Value), isWebSite);
}
void ComboBox1SelectedIndexChanged(object sender, EventArgs e)
{
switch (comboBox1.SelectedIndex)
{
case 1:
url = "http://assetgame.roblox.com/asset/?id=";
isWebSite = false;
break;
case 2:
url = "https://www.roblox.com/catalog/";
isWebSite = true;
break;
case 3:
url = "https://www.roblox.com/library/";
isWebSite = true;
break;
default:
url = "http://www.roblox.com/asset?id=";
isWebSite = false;
break;
}
SDKFuncs.SelectItemDownloadURL(comboBox1.SelectedIndex, url, isWebSite);
}
void ItemMakerLoad(object sender, EventArgs e)
@ -117,5 +43,7 @@ namespace NovetusLauncher
{
GlobalVars.UserConfiguration.DisabledItemMakerHelp = checkBox1.Checked;
}
}
#endregion
}
#endregion
}

View File

@ -1,38 +1,23 @@
using NovetusLauncher.SDK;
#region Usings
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Windows.Forms;
#endregion
namespace NovetusLauncher
{
#region Novetus SDK Launcher
public partial class NovetusSDK : Form
{
#region Constructor
public NovetusSDK()
{
InitializeComponent();
}
#endregion
private void button1_Click(object sender, EventArgs e)
{
ItemMaker im = new ItemMaker();
im.Show();
}
private void button2_Click(object sender, EventArgs e)
{
ClientinfoEditor cie = new ClientinfoEditor();
cie.Show();
}
private void button3_Click(object sender, EventArgs e)
{
ClientScriptDocumentation csd = new ClientScriptDocumentation();
csd.Show();
}
#region Form Events
private void NovetusSDK_Load(object sender, EventArgs e)
{
Text = "Novetus SDK " + GlobalVars.ProgramInformation.Version;
@ -46,51 +31,9 @@ namespace NovetusLauncher
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
switch (listBox1.SelectedIndex)
{
case 1:
ClientinfoEditor cie = new ClientinfoEditor();
cie.Show();
break;
case 2:
ClientScriptDocumentation csd = new ClientScriptDocumentation();
csd.Show();
break;
case 3:
AssetLocalizer al = new AssetLocalizer();
al.Show();
break;
case 4:
SplashTester st = new SplashTester();
st.Show();
break;
case 5:
Obj2MeshV1GUI obj = new Obj2MeshV1GUI();
obj.Show();
break;
case 6:
Process proc = new Process();
proc.StartInfo.FileName = GlobalPaths.ConfigDirData + "\\RSG.exe";
proc.StartInfo.CreateNoWindow = false;
proc.StartInfo.UseShellExecute = false;
proc.Start();
break;
case 7:
Process proc2 = new Process();
proc2.StartInfo.FileName = GlobalPaths.ConfigDirData + "\\Roblox_Legacy_Place_Converter.exe";
proc2.StartInfo.CreateNoWindow = false;
proc2.StartInfo.UseShellExecute = false;
proc2.Start();
break;
case 8:
DiogenesEditor dio = new DiogenesEditor();
dio.Show();
break;
default:
ItemMaker im = new ItemMaker();
im.Show();
break;
}
SDKFuncs.LaunchSDKAppByIndex(listBox1.SelectedIndex);
}
#endregion
}
#endregion
}

View File

@ -1,14 +1,20 @@
using System;
#region Usings
using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
#endregion
namespace NovetusLauncher
{
#region RBXMeshConverter GUI
public partial class Obj2MeshV1GUI : Form
{
#region Private Variables
private OpenFileDialog openFileDialog1;
#endregion
#region Constructor
public Obj2MeshV1GUI()
{
InitializeComponent();
@ -20,7 +26,9 @@ namespace NovetusLauncher
Title = "Open model .obj"
};
}
#endregion
#region Form Events
private void button1_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog() == DialogResult.OK)
@ -49,5 +57,7 @@ namespace NovetusLauncher
string properName = Path.GetFileName(openFileDialog1.FileName) + ".mesh";
MessageBox.Show("File " + properName + " created!");
}
#endregion
}
#endregion
}

View File

@ -48,18 +48,18 @@ namespace NovetusLauncher
this.label12.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label12.ForeColor = System.Drawing.Color.Black;
this.label12.Location = new System.Drawing.Point(28, 22);
this.label12.Location = new System.Drawing.Point(12, 22);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(214, 17);
this.label12.Size = new System.Drawing.Size(261, 17);
this.label12.TabIndex = 0;
this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(7, 58);
this.textBox1.Location = new System.Drawing.Point(12, 58);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(265, 39);
this.textBox1.Size = new System.Drawing.Size(261, 39);
this.textBox1.TabIndex = 52;
this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);

View File

@ -1,36 +1,26 @@
/*
* Created by SharpDevelop.
* User: BITL-Gaming
* Date: 10/7/2016
* Time: 3:01 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
#region Usings
using System;
using System.Windows.Forms;
#endregion
namespace NovetusLauncher
{
/// <summary>
/// Description of MainForm.
/// </summary>
#region Splash Tester
public partial class SplashTester : Form
{
#region Constructor
public SplashTester()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
#endregion
#region Form Events
private void textBox1_TextChanged(object sender, EventArgs e)
{
label12.Text = textBox1.Text;
}
#endregion
}
#endregion
}