diff --git a/DATabase/DATabase.cs b/DATabase/DATabase.cs
index db024f17..b06ef90a 100644
--- a/DATabase/DATabase.cs
+++ b/DATabase/DATabase.cs
@@ -52,7 +52,7 @@ namespace SabreTools
// Determine which switches are enabled (with values if necessary)
bool help = false, import = false, generate = false, convert = false,
listsys = false, listsrc = false, norename = false, old = false,
- log = false, genall = false, add = false, rem = false;
+ log = false, genall = false, add = false, rem = false, skip = false;
string systems = "", sources = "", input = "", manu = "", url = "";
foreach (string arg in args)
{
@@ -71,6 +71,7 @@ namespace SabreTools
log = log || (arg == "-l" || arg == "--log");
old = old || (arg == "-old" || arg == "--romvault");
norename = norename || (arg == "-nr" || arg == "--no-rename");
+ skip = skip || (arg == "--skip");
// User input strings
systems = (arg.StartsWith("system=") && systems == "" ? arg.Split('=')[1] : systems);
@@ -89,6 +90,12 @@ namespace SabreTools
input == "" ? arg : input);
}
+ // If skip is set, it's being called from the UI so we just exit
+ if (skip)
+ {
+ return;
+ }
+
// If more than one switch is enabled or help is set, show the help screen
if (help || !(import ^ generate ^ listsys ^ listsrc ^ genall ^ add ^ rem))
{
diff --git a/SabreToolsUI/App.config b/SabreToolsUI/App.config
index 88fa4027..d0fd1b77 100644
--- a/SabreToolsUI/App.config
+++ b/SabreToolsUI/App.config
@@ -1,6 +1,27 @@
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SabreToolsUI/Program.cs b/SabreToolsUI/Program.cs
index 9a21c21f..5c6ad82f 100644
--- a/SabreToolsUI/Program.cs
+++ b/SabreToolsUI/Program.cs
@@ -4,7 +4,7 @@ using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
-namespace SabreToolsUI
+namespace SabreTools
{
static class Program
{
diff --git a/SabreToolsUI/SabreToolsUI.Designer.cs b/SabreToolsUI/SabreToolsUI.Designer.cs
index 34cc20c8..d28fa8e7 100644
--- a/SabreToolsUI/SabreToolsUI.Designer.cs
+++ b/SabreToolsUI/SabreToolsUI.Designer.cs
@@ -1,4 +1,4 @@
-namespace SabreToolsUI
+namespace SabreTools
{
partial class SabreToolsUI
{
@@ -30,10 +30,19 @@
{
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.quitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.quitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.label3 = new System.Windows.Forms.Label();
+ this.checkedListBox1 = new System.Windows.Forms.CheckedListBox();
+ this.checkedListBox2 = new System.Windows.Forms.CheckedListBox();
+ this.label4 = new System.Windows.Forms.Label();
+ this.label5 = new System.Windows.Forms.Label();
+ this.button1 = new System.Windows.Forms.Button();
+ this.button2 = new System.Windows.Forms.Button();
this.menuStrip1.SuspendLayout();
this.SuspendLayout();
//
@@ -45,7 +54,7 @@
this.helpToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
- this.menuStrip1.Size = new System.Drawing.Size(575, 24);
+ this.menuStrip1.Size = new System.Drawing.Size(681, 24);
this.menuStrip1.TabIndex = 0;
this.menuStrip1.Text = "menuStrip1";
//
@@ -57,6 +66,14 @@
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "File";
//
+ // quitToolStripMenuItem
+ //
+ this.quitToolStripMenuItem.Name = "quitToolStripMenuItem";
+ this.quitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.X)));
+ this.quitToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
+ this.quitToolStripMenuItem.Text = "Exit";
+ this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click);
+ //
// editToolStripMenuItem
//
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
@@ -71,23 +88,111 @@
this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
this.helpToolStripMenuItem.Text = "Help";
//
- // quitToolStripMenuItem
- //
- this.quitToolStripMenuItem.Name = "quitToolStripMenuItem";
- this.quitToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
- this.quitToolStripMenuItem.Text = "Exit";
- //
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
- this.aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.aboutToolStripMenuItem.Size = new System.Drawing.Size(107, 22);
this.aboutToolStripMenuItem.Text = "About";
+ this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label1.Location = new System.Drawing.Point(12, 34);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(112, 17);
+ this.label1.TabIndex = 1;
+ this.label1.Text = "Generate DAT";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(15, 65);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(0, 13);
+ this.label2.TabIndex = 2;
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label3.Location = new System.Drawing.Point(15, 65);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(56, 15);
+ this.label3.TabIndex = 3;
+ this.label3.Text = "Systems:";
+ //
+ // checkedListBox1
+ //
+ this.checkedListBox1.FormattingEnabled = true;
+ this.checkedListBox1.Items.AddRange(GetAllSystems());
+ this.checkedListBox1.Location = new System.Drawing.Point(77, 65);
+ this.checkedListBox1.Name = "checkedListBox1";
+ this.checkedListBox1.Size = new System.Drawing.Size(260, 34);
+ this.checkedListBox1.TabIndex = 4;
+ //
+ // checkedListBox2
+ //
+ this.checkedListBox2.FormattingEnabled = true;
+ this.checkedListBox2.Items.AddRange(GetAllSources());
+ this.checkedListBox2.Location = new System.Drawing.Point(415, 65);
+ this.checkedListBox2.Name = "checkedListBox2";
+ this.checkedListBox2.Size = new System.Drawing.Size(244, 34);
+ this.checkedListBox2.TabIndex = 7;
+ //
+ // label4
+ //
+ this.label4.AutoSize = true;
+ this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.label4.Location = new System.Drawing.Point(353, 65);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(55, 15);
+ this.label4.TabIndex = 6;
+ this.label4.Text = "Sources:";
+ //
+ // label5
+ //
+ this.label5.AutoSize = true;
+ this.label5.Location = new System.Drawing.Point(363, 65);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(0, 13);
+ this.label5.TabIndex = 5;
+ //
+ // button1
+ //
+ this.button1.Location = new System.Drawing.Point(18, 107);
+ this.button1.Name = "button1";
+ this.button1.Size = new System.Drawing.Size(75, 23);
+ this.button1.TabIndex = 8;
+ this.button1.Text = "Generate";
+ this.button1.UseVisualStyleBackColor = true;
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // button2
+ //
+ this.button2.Location = new System.Drawing.Point(100, 107);
+ this.button2.Name = "button2";
+ this.button2.Size = new System.Drawing.Size(97, 23);
+ this.button2.TabIndex = 9;
+ this.button2.Text = "Generate All";
+ this.button2.UseVisualStyleBackColor = true;
+ this.button2.Click += new System.EventHandler(this.button2_Click);
//
// SabreToolsUI
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(575, 342);
+ this.ClientSize = new System.Drawing.Size(681, 477);
+ this.Controls.Add(this.button2);
+ this.Controls.Add(this.button1);
+ this.Controls.Add(this.checkedListBox2);
+ this.Controls.Add(this.label4);
+ this.Controls.Add(this.label5);
+ this.Controls.Add(this.checkedListBox1);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.label1);
this.Controls.Add(this.menuStrip1);
this.MainMenuStrip = this.menuStrip1;
this.Name = "SabreToolsUI";
@@ -107,6 +212,15 @@
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.CheckedListBox checkedListBox1;
+ private System.Windows.Forms.CheckedListBox checkedListBox2;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Button button2;
}
}
diff --git a/SabreToolsUI/SabreToolsUI.cs b/SabreToolsUI/SabreToolsUI.cs
index 2078af76..65645d19 100644
--- a/SabreToolsUI/SabreToolsUI.cs
+++ b/SabreToolsUI/SabreToolsUI.cs
@@ -2,19 +2,138 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
+using System.Data.SQLite;
+using System.Diagnostics;
using System.Drawing;
using System.Linq;
+using System.Runtime.InteropServices;
using System.Text;
+using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
-namespace SabreToolsUI
+namespace SabreTools
{
public partial class SabreToolsUI : Form
{
+ private static string _dbName = "DATabase.sqlite";
+ private static string _connectionString = "Data Source=" + _dbName + ";Version = 3;";
+
public SabreToolsUI()
{
+ AllocConsole();
InitializeComponent();
}
+
+ [DllImport("kernel32.dll", SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ static extern bool AllocConsole();
+
+ private void quitToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ Environment.Exit(0);
+ }
+
+ private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ MessageBox.Show("SabreTools designed and coded by: Matt Nadareski (darksabre76)\nTested by: @tractivo", "About");
+ }
+
+ private static object[] GetAllSystems()
+ {
+ List