diff --git a/NUS Downloader/Form1.Designer.cs b/NUS Downloader/Form1.Designer.cs index 867ebf6..1ceca54 100644 --- a/NUS Downloader/Form1.Designer.cs +++ b/NUS Downloader/Form1.Designer.cs @@ -45,7 +45,9 @@ namespace NUS_Downloader this.wadnamebox = new System.Windows.Forms.TextBox(); this.databaseStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.SystemMenuList = new System.Windows.Forms.ToolStripMenuItem(); + this.systemFakeMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.IOSMenuList = new System.Windows.Forms.ToolStripMenuItem(); + this.iosFakeMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.VCMenuList = new System.Windows.Forms.ToolStripMenuItem(); this.C64MenuList = new System.Windows.Forms.ToolStripMenuItem(); this.GenesisMenuList = new System.Windows.Forms.ToolStripMenuItem(); @@ -58,7 +60,9 @@ namespace NUS_Downloader this.TurboGrafx16MenuList = new System.Windows.Forms.ToolStripMenuItem(); this.TurboGrafxCDMenuList = new System.Windows.Forms.ToolStripMenuItem(); this.VCArcadeMenuList = new System.Windows.Forms.ToolStripMenuItem(); + this.vcFakeMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.WiiWareMenuList = new System.Windows.Forms.ToolStripMenuItem(); + this.wwFakeMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.RegionCodesList = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); @@ -110,10 +114,6 @@ namespace NUS_Downloader this.titleversion = new wmgCMS.WaterMarkTextBox(); this.titleidbox = new wmgCMS.WaterMarkTextBox(); this.dlprogress = new wyDay.Controls.Windows7ProgressBar(); - this.systemFakeMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.iosFakeMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.vcFakeMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.wwFakeMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.databaseStrip.SuspendLayout(); this.extrasStrip.SuspendLayout(); this.proxyBox.SuspendLayout(); @@ -199,7 +199,7 @@ namespace NUS_Downloader this.updateDatabaseToolStripMenuItem}); this.databaseStrip.Name = "databaseStrip"; this.databaseStrip.ShowItemToolTips = false; - this.databaseStrip.Size = new System.Drawing.Size(164, 258); + this.databaseStrip.Size = new System.Drawing.Size(164, 236); // // SystemMenuList // @@ -208,12 +208,28 @@ namespace NUS_Downloader this.SystemMenuList.Size = new System.Drawing.Size(154, 22); this.SystemMenuList.Text = "System"; // + // systemFakeMenuItem + // + this.systemFakeMenuItem.Image = global::NUS_Downloader.Properties.Resources.arrow_ticker; + this.systemFakeMenuItem.Name = "systemFakeMenuItem"; + this.systemFakeMenuItem.Size = new System.Drawing.Size(163, 22); + this.systemFakeMenuItem.Text = "System"; + this.systemFakeMenuItem.Visible = false; + // // IOSMenuList // this.IOSMenuList.Name = "IOSMenuList"; this.IOSMenuList.Size = new System.Drawing.Size(163, 22); this.IOSMenuList.Text = "IOS"; // + // iosFakeMenuItem + // + this.iosFakeMenuItem.Image = global::NUS_Downloader.Properties.Resources.arrow_ticker; + this.iosFakeMenuItem.Name = "iosFakeMenuItem"; + this.iosFakeMenuItem.Size = new System.Drawing.Size(163, 22); + this.iosFakeMenuItem.Text = "IOS"; + this.iosFakeMenuItem.Visible = false; + // // VCMenuList // this.VCMenuList.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -298,12 +314,28 @@ namespace NUS_Downloader this.VCArcadeMenuList.Size = new System.Drawing.Size(194, 22); this.VCArcadeMenuList.Text = "Virtual Console Arcade"; // + // vcFakeMenuItem + // + this.vcFakeMenuItem.Image = global::NUS_Downloader.Properties.Resources.arrow_ticker; + this.vcFakeMenuItem.Name = "vcFakeMenuItem"; + this.vcFakeMenuItem.Size = new System.Drawing.Size(163, 22); + this.vcFakeMenuItem.Text = "Virtual Console"; + this.vcFakeMenuItem.Visible = false; + // // WiiWareMenuList // this.WiiWareMenuList.Name = "WiiWareMenuList"; this.WiiWareMenuList.Size = new System.Drawing.Size(163, 22); this.WiiWareMenuList.Text = "WiiWare"; // + // wwFakeMenuItem + // + this.wwFakeMenuItem.Image = global::NUS_Downloader.Properties.Resources.arrow_ticker; + this.wwFakeMenuItem.Name = "wwFakeMenuItem"; + this.wwFakeMenuItem.Size = new System.Drawing.Size(163, 22); + this.wwFakeMenuItem.Text = "WiiWare"; + this.wwFakeMenuItem.Visible = false; + // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; @@ -552,13 +584,14 @@ namespace NUS_Downloader this.emulateUpdate}); this.scriptsStrip.Name = "scriptsStrip"; this.scriptsStrip.ShowItemToolTips = false; - this.scriptsStrip.Size = new System.Drawing.Size(220, 98); + this.scriptsStrip.Size = new System.Drawing.Size(220, 120); // // scriptsLocalMenuEntry // this.scriptsLocalMenuEntry.Enabled = false; this.scriptsLocalMenuEntry.Image = global::NUS_Downloader.Properties.Resources.script_code; this.scriptsLocalMenuEntry.Name = "scriptsLocalMenuEntry"; + this.scriptsLocalMenuEntry.Overflow = System.Windows.Forms.ToolStripItemOverflow.AsNeeded; this.scriptsLocalMenuEntry.Size = new System.Drawing.Size(219, 22); this.scriptsLocalMenuEntry.Text = "Scripts (Local)"; // @@ -837,38 +870,6 @@ namespace NUS_Downloader this.dlprogress.Size = new System.Drawing.Size(250, 15); this.dlprogress.TabIndex = 47; // - // systemFakeMenuItem - // - this.systemFakeMenuItem.Image = global::NUS_Downloader.Properties.Resources.arrow_ticker; - this.systemFakeMenuItem.Name = "systemFakeMenuItem"; - this.systemFakeMenuItem.Size = new System.Drawing.Size(163, 22); - this.systemFakeMenuItem.Text = "System"; - this.systemFakeMenuItem.Visible = false; - // - // iosFakeMenuItem - // - this.iosFakeMenuItem.Image = global::NUS_Downloader.Properties.Resources.arrow_ticker; - this.iosFakeMenuItem.Name = "iosFakeMenuItem"; - this.iosFakeMenuItem.Size = new System.Drawing.Size(163, 22); - this.iosFakeMenuItem.Text = "IOS"; - this.iosFakeMenuItem.Visible = false; - // - // vcFakeMenuItem - // - this.vcFakeMenuItem.Image = global::NUS_Downloader.Properties.Resources.arrow_ticker; - this.vcFakeMenuItem.Name = "vcFakeMenuItem"; - this.vcFakeMenuItem.Size = new System.Drawing.Size(163, 22); - this.vcFakeMenuItem.Text = "Virtual Console"; - this.vcFakeMenuItem.Visible = false; - // - // wwFakeMenuItem - // - this.wwFakeMenuItem.Image = global::NUS_Downloader.Properties.Resources.arrow_ticker; - this.wwFakeMenuItem.Name = "wwFakeMenuItem"; - this.wwFakeMenuItem.Size = new System.Drawing.Size(163, 22); - this.wwFakeMenuItem.Text = "WiiWare"; - this.wwFakeMenuItem.Visible = false; - // // Form1 // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; diff --git a/NUS Downloader/Form1.cs b/NUS Downloader/Form1.cs index a34cfec..745a093 100644 --- a/NUS Downloader/Form1.cs +++ b/NUS Downloader/Form1.cs @@ -142,6 +142,16 @@ namespace NUS_Downloader while (String.IsNullOrEmpty(proxy_pwd)) Thread.Sleep(1000); + if ((args.Length == 1) && (args[0] == "folderfix")) + { + // Organizing folders from past NUSD releases... + BackgroundWorker folder_fixer = new BackgroundWorker(); + folder_fixer.DoWork += new DoWorkEventHandler(ReorganizePreviousFolderStructure); + folder_fixer.RunWorkerCompleted += new RunWorkerCompletedEventHandler(ReorganizePreviousFolderStructure_Completed); + WriteStatus("Organizing your old folder structure..."); + folder_fixer.RunWorkerAsync(); + } + if ((args.Length == 1) && (File.Exists(args[0]))) { script_filename = args[0]; @@ -151,6 +161,8 @@ namespace NUS_Downloader } } + + private void Form1_Load(object sender, EventArgs e) { this.Text = String.Format("NUSD - {0}", version); ; @@ -1060,11 +1072,11 @@ namespace NUS_Downloader /// The attributes. private void AddToolStripItemToStrip(ToolStripMenuItem menulist, ToolStripMenuItem additionitem) { - Debug.WriteLine(String.Format("Adding item")); + //Debug.WriteLine(String.Format("Adding item")); if (this.InvokeRequired) { - Debug.WriteLine("InvokeRequired..."); + //Debug.WriteLine("InvokeRequired..."); AddToolStripItemToStripCallback atsitsc = new AddToolStripItemToStripCallback(AddToolStripItemToStrip); this.Invoke(atsitsc, new object[] {menulist, additionitem}); return; @@ -2376,10 +2388,6 @@ namespace NUS_Downloader iosPatchesListBox.Enabled = true; iosPatchGroupBoxOKbtn.Enabled = true; } - else - { - //packbox.Enabled = true; - } } private void iosPatchGroupBoxOKbtn_Click(object sender, EventArgs e) @@ -2389,11 +2397,11 @@ namespace NUS_Downloader if (iosPatchesListBox.CheckedIndices.Count == 0) // Uncheck the checkbox to indicate no patches iosPatchCheckbox.Checked = false; - //packbox.Enabled = false; } private void FillDatabaseScripts() { + SetPropertyThreadSafe(scriptsDatabaseToolStripMenuItem, false, "Visible"); Database databaseObj = new Database(); databaseObj.LoadDatabaseToStream(Path.Combine(CURRENT_DIR, "database.xml")); @@ -2405,12 +2413,42 @@ namespace NUS_Downloader AddToolStripItemToStrip(scriptsDatabaseToolStripMenuItem, scriptItems[a]); //SystemMenuList.DropDownItems.Add(systemItems[a]); } + SetPropertyThreadSafe(scriptsDatabaseToolStripMenuItem, true, "Enabled"); SetPropertyThreadSafe(scriptsDatabaseToolStripMenuItem, true, "Visible"); } public void ScriptItem_Clicked(object sender, ToolStripItemClickedEventArgs e) - { //TODO + {// STILL TODO + ToolStripMenuItem tsmi = (ToolStripMenuItem)sender; + string folderpath = "\000"; + script_filename = folderpath; + BackgroundWorker scripter = new BackgroundWorker(); + scripter.DoWork += new DoWorkEventHandler(RunScript); + scripter.RunWorkerAsync(); + } + + void ReorganizePreviousFolderStructure(object sender, DoWorkEventArgs e) + { + // 0000000000000000v000\* become titles\0000000000000000\v000\* + Regex TitleDirectoryRegex = new Regex(@"[a-zA-Z0-9]{16}v?([0-9]*)?"); + + if (Directory.Exists(Path.Combine(CURRENT_DIR, "titles")) == false) + Directory.CreateDirectory(Path.Combine(CURRENT_DIR, "titles")); + + string[] directories = Directory.GetDirectories(CURRENT_DIR, "*", SearchOption.TopDirectoryOnly); + foreach (string directory in directories) + { + DirectoryInfo dinfo = new DirectoryInfo(directory); + if (TitleDirectoryRegex.IsMatch(dinfo.Name.ToString()) == false) + break; + } + + } + + void ReorganizePreviousFolderStructure_Completed(object sender, RunWorkerCompletedEventArgs e) + { + } } } \ No newline at end of file diff --git a/NUS Downloader/Form1.resx b/NUS Downloader/Form1.resx index 9e392ad..c4cbda7 100644 --- a/NUS Downloader/Form1.resx +++ b/NUS Downloader/Form1.resx @@ -127,7 +127,7 @@ 285, 17 - 544, 17 + 386, 21 diff --git a/NUS Downloader/Latest/NUS Downloader.exe b/NUS Downloader/Latest/NUS Downloader.exe index f3b5c77..67224e3 100644 Binary files a/NUS Downloader/Latest/NUS Downloader.exe and b/NUS Downloader/Latest/NUS Downloader.exe differ