diff --git a/NUS Downloader/Database.cs b/NUS Downloader/Database.cs index 2f6ce37..1ddca95 100644 --- a/NUS Downloader/Database.cs +++ b/NUS Downloader/Database.cs @@ -37,14 +37,9 @@ namespace NUS_Downloader // Does it exist? if (!File.Exists(databaseFile)) throw new FileNotFoundException("I couldn't find the database file!", "database.xml"); - // Load database.xml into MemoryStream + databaseString = File.ReadAllText(databaseFile); - /*System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); - byte[] databasebytes = encoding.GetBytes(databasestr); - - // Load the memory stream - databaseStream = new MemoryStream(databasebytes); - databaseStream.Seek(0, SeekOrigin.Begin);*/ + } public string GetDatabaseVersion() diff --git a/NUS Downloader/Form1.Designer.cs b/NUS Downloader/Form1.Designer.cs index 08cc985..867ebf6 100644 --- a/NUS Downloader/Form1.Designer.cs +++ b/NUS Downloader/Form1.Designer.cs @@ -48,7 +48,6 @@ namespace NUS_Downloader this.IOSMenuList = new System.Windows.Forms.ToolStripMenuItem(); this.VCMenuList = new System.Windows.Forms.ToolStripMenuItem(); this.C64MenuList = new System.Windows.Forms.ToolStripMenuItem(); - this.C64MenuListDrop = new System.Windows.Forms.ContextMenuStrip(this.components); this.GenesisMenuList = new System.Windows.Forms.ToolStripMenuItem(); this.MSXMenuList = new System.Windows.Forms.ToolStripMenuItem(); this.N64MenuList = new System.Windows.Forms.ToolStripMenuItem(); @@ -111,6 +110,10 @@ 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(); @@ -183,16 +186,20 @@ namespace NUS_Downloader // this.databaseStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.SystemMenuList, + this.systemFakeMenuItem, this.IOSMenuList, + this.iosFakeMenuItem, this.VCMenuList, + this.vcFakeMenuItem, this.WiiWareMenuList, + this.wwFakeMenuItem, this.toolStripSeparator1, this.RegionCodesList, this.toolStripSeparator4, this.updateDatabaseToolStripMenuItem}); this.databaseStrip.Name = "databaseStrip"; this.databaseStrip.ShowItemToolTips = false; - this.databaseStrip.Size = new System.Drawing.Size(164, 148); + this.databaseStrip.Size = new System.Drawing.Size(164, 258); // // SystemMenuList // @@ -227,17 +234,10 @@ namespace NUS_Downloader // // C64MenuList // - this.C64MenuList.DropDown = this.C64MenuListDrop; this.C64MenuList.Name = "C64MenuList"; this.C64MenuList.Size = new System.Drawing.Size(194, 22); this.C64MenuList.Text = "Commodore 64"; // - // C64MenuListDrop - // - this.C64MenuListDrop.Name = "C64MenuListDrop"; - this.C64MenuListDrop.OwnerItem = this.C64MenuList; - this.C64MenuListDrop.Size = new System.Drawing.Size(61, 4); - // // GenesisMenuList // this.GenesisMenuList.Name = "GenesisMenuList"; @@ -837,6 +837,38 @@ 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; @@ -932,7 +964,6 @@ namespace NUS_Downloader private System.Windows.Forms.TextBox ProxyPwdBox; private wyDay.Controls.Windows7ProgressBar dlprogress; private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; - private System.Windows.Forms.ContextMenuStrip C64MenuListDrop; private System.Windows.Forms.ComboBox consoleCBox; private wmgCMS.WaterMarkTextBox titleidbox; private wmgCMS.WaterMarkTextBox titleversion; @@ -960,6 +991,10 @@ namespace NUS_Downloader private System.Windows.Forms.Button iosPatchGroupBoxOKbtn; private System.Windows.Forms.Label label2; private System.Windows.Forms.Panel richPanel; + private System.Windows.Forms.ToolStripMenuItem systemFakeMenuItem; + private System.Windows.Forms.ToolStripMenuItem iosFakeMenuItem; + private System.Windows.Forms.ToolStripMenuItem vcFakeMenuItem; + private System.Windows.Forms.ToolStripMenuItem wwFakeMenuItem; } } diff --git a/NUS Downloader/Form1.cs b/NUS Downloader/Form1.cs index 61ef883..a34cfec 100644 --- a/NUS Downloader/Form1.cs +++ b/NUS Downloader/Form1.cs @@ -61,13 +61,6 @@ namespace NUS_Downloader private delegate void SetPropertyThreadSafeCallback(System.ComponentModel.Component what, object setto, string property); private delegate string OfficialWADNamingCallback(string whut); - // Images do not compare unless globalized... - private Image green = Properties.Resources.bullet_green; - private Image orange = Properties.Resources.bullet_orange; - private Image redorb = Properties.Resources.bullet_red; - private Image redgreen = Properties.Resources.bullet_redgreen; - private Image redorange = Properties.Resources.bullet_redorange; - private string WAD_Saveas_Filename; // TODO: OOP scripting @@ -807,9 +800,9 @@ namespace NUS_Downloader { if (tsmiclear.Name != "VCMenuList") // Don't clear the VC Menu... tsmiclear.DropDownItems.Clear(); - + /* if (tsmiclear.OwnerItem != VCMenuList) // and don't disable the VC menu subparts... - tsmiclear.Enabled = false; + tsmiclear.Enabled = false;*/ } } @@ -821,6 +814,17 @@ namespace NUS_Downloader // Something needs to be done to remove this i guess //Control.CheckForIllegalCrossThreadCalls = false; + // Set fake items visible and real ones not. Only way to stop buggy enabled stuff. + SetPropertyThreadSafe(SystemMenuList, false, "Visible"); + SetPropertyThreadSafe(IOSMenuList, false, "Visible"); + SetPropertyThreadSafe(VCMenuList, false, "Visible"); + SetPropertyThreadSafe(WiiWareMenuList, false, "Visible"); + + SetPropertyThreadSafe(systemFakeMenuItem, true, "Visible"); + SetPropertyThreadSafe(iosFakeMenuItem, true, "Visible"); + SetPropertyThreadSafe(vcFakeMenuItem, true, "Visible"); + SetPropertyThreadSafe(wwFakeMenuItem, true, "Visible"); + Database databaseObj = new Database(); databaseObj.LoadDatabaseToStream(Path.Combine(CURRENT_DIR, "database.xml")); @@ -839,7 +843,7 @@ namespace NUS_Downloader AddToolStripItemToStrip(SystemMenuList, systemItems[a]); //SystemMenuList.DropDownItems.Add(systemItems[a]); } - SetPropertyThreadSafe(SystemMenuList, true, "Enabled"); + SetPropertyThreadSafe(systemFakeMenuItem, false, "Visible"); SetPropertyThreadSafe(SystemMenuList, true, "Visible"); worker.ReportProgress(25); @@ -851,7 +855,7 @@ namespace NUS_Downloader AddToolStripItemToStrip(IOSMenuList, iosItems[a]); //IOSMenuList.DropDownItems.Add(iosItems[a]); } - SetPropertyThreadSafe(IOSMenuList, true, "Enabled"); + SetPropertyThreadSafe(iosFakeMenuItem, false, "Visible"); SetPropertyThreadSafe(IOSMenuList, true, "Visible"); worker.ReportProgress(50); @@ -879,7 +883,7 @@ namespace NUS_Downloader } } } - SetPropertyThreadSafe(VCMenuList, true, "Enabled"); + SetPropertyThreadSafe(vcFakeMenuItem, false, "Visible"); SetPropertyThreadSafe(VCMenuList, true, "Visible"); worker.ReportProgress(75); @@ -899,7 +903,7 @@ namespace NUS_Downloader AddToolStripItemToStrip(WiiWareMenuList, wwItems[a]); //WiiWareMenuList.DropDownItems.Add(wwItems[a]); } - SetPropertyThreadSafe(WiiWareMenuList, true, "Enabled"); + SetPropertyThreadSafe(wwFakeMenuItem, false, "Visible"); SetPropertyThreadSafe(WiiWareMenuList, true, "Visible"); worker.ReportProgress(100); @@ -1484,33 +1488,6 @@ namespace NUS_Downloader } } - /// - /// Selects the database item image. - /// - /// if set to true [ticket]. - /// if set to true [danger]. - /// Correct Image - private System.Drawing.Image SelectItemImage(bool ticket, bool danger) - { - // All is good, go green... - if ((ticket) && (!danger)) - return green; - - // There's no ticket, but danger is clear... - if ((!ticket) && (!danger)) - return orange; - - // DANGER WILL ROBINSON... - if ((ticket) && (danger)) - return redgreen; - - // Double bad... - if ((!ticket) && (danger)) - return redorange; - - return null; - } - /// /// Updates the name of the packed WAD in the textbox. /// @@ -2433,6 +2410,7 @@ namespace NUS_Downloader } public void ScriptItem_Clicked(object sender, ToolStripItemClickedEventArgs e) - { } + { //TODO + } } } \ No newline at end of file diff --git a/NUS Downloader/Form1.resx b/NUS Downloader/Form1.resx index b2d2eec..9e392ad 100644 --- a/NUS Downloader/Form1.resx +++ b/NUS Downloader/Form1.resx @@ -123,9 +123,6 @@ 159, 17 - - 394, 17 - 285, 17 diff --git a/NUS Downloader/Latest/NUS Downloader.exe b/NUS Downloader/Latest/NUS Downloader.exe index b12248e..f3b5c77 100644 Binary files a/NUS Downloader/Latest/NUS Downloader.exe and b/NUS Downloader/Latest/NUS Downloader.exe differ