From d09af7eff2daeb223ba63bac4fc7cad8791c30d9 Mon Sep 17 00:00:00 2001 From: goyuken Date: Fri, 16 Jan 2015 00:55:50 +0000 Subject: [PATCH] corefeatureanalysis: stuff --- .../CoreFeatureAnalysis.Designer.cs | 94 +++++-------------- BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs | 16 +++- .../CoreFeatureAnalysis.resx | 3 + 3 files changed, 43 insertions(+), 70 deletions(-) diff --git a/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.Designer.cs b/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.Designer.cs index 601fa60844..57da4ec9c8 100644 --- a/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.Designer.cs +++ b/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.Designer.cs @@ -29,42 +29,28 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CoreFeatureAnalysis)); - this.OkBtn = new System.Windows.Forms.Button(); this.CoreTree = new System.Windows.Forms.TreeView(); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.CurrentCoreTree = new System.Windows.Forms.TreeView(); this.tabPage2 = new System.Windows.Forms.TabPage(); - this.ReleasedCoresLabel = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.TotalCoresLabel = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); + this.statusStrip1.SuspendLayout(); this.SuspendLayout(); // - // OkBtn - // - this.OkBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.OkBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.OkBtn.Location = new System.Drawing.Point(456, 569); - this.OkBtn.Name = "OkBtn"; - this.OkBtn.Size = new System.Drawing.Size(60, 23); - this.OkBtn.TabIndex = 0; - this.OkBtn.Text = "&Ok"; - this.OkBtn.UseVisualStyleBackColor = true; - this.OkBtn.Click += new System.EventHandler(this.OkBtn_Click); - // // CoreTree // this.CoreTree.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.CoreTree.Location = new System.Drawing.Point(6, 24); + this.CoreTree.Location = new System.Drawing.Point(6, 6); this.CoreTree.Name = "CoreTree"; - this.CoreTree.Size = new System.Drawing.Size(481, 480); + this.CoreTree.Size = new System.Drawing.Size(481, 498); this.CoreTree.TabIndex = 0; // // tabControl1 @@ -103,10 +89,6 @@ // // tabPage2 // - this.tabPage2.Controls.Add(this.ReleasedCoresLabel); - this.tabPage2.Controls.Add(this.label2); - this.tabPage2.Controls.Add(this.TotalCoresLabel); - this.tabPage2.Controls.Add(this.label1); this.tabPage2.Controls.Add(this.CoreTree); this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabPage2.Name = "tabPage2"; @@ -116,42 +98,6 @@ this.tabPage2.Text = "All"; this.tabPage2.UseVisualStyleBackColor = true; // - // ReleasedCoresLabel - // - this.ReleasedCoresLabel.AutoSize = true; - this.ReleasedCoresLabel.Location = new System.Drawing.Point(62, 8); - this.ReleasedCoresLabel.Name = "ReleasedCoresLabel"; - this.ReleasedCoresLabel.Size = new System.Drawing.Size(19, 13); - this.ReleasedCoresLabel.TabIndex = 9; - this.ReleasedCoresLabel.Text = "20"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(10, 8); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(55, 13); - this.label2.TabIndex = 8; - this.label2.Text = "Released:"; - // - // TotalCoresLabel - // - this.TotalCoresLabel.AutoSize = true; - this.TotalCoresLabel.Location = new System.Drawing.Point(130, 8); - this.TotalCoresLabel.Name = "TotalCoresLabel"; - this.TotalCoresLabel.Size = new System.Drawing.Size(19, 13); - this.TotalCoresLabel.TabIndex = 7; - this.TotalCoresLabel.Text = "20"; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(97, 8); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(34, 13); - this.label1.TabIndex = 6; - this.label1.Text = "Total:"; - // // menuStrip1 // this.menuStrip1.Location = new System.Drawing.Point(0, 0); @@ -160,15 +106,29 @@ this.menuStrip1.TabIndex = 7; this.menuStrip1.Text = "menuStrip1"; // + // statusStrip1 + // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripStatusLabel1}); + this.statusStrip1.Location = new System.Drawing.Point(0, 582); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Size = new System.Drawing.Size(528, 22); + this.statusStrip1.TabIndex = 8; + this.statusStrip1.Text = "statusStrip1"; + // + // toolStripStatusLabel1 + // + this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; + this.toolStripStatusLabel1.Size = new System.Drawing.Size(109, 17); + this.toolStripStatusLabel1.Text = "toolStripStatusLabel1"; + // // CoreFeatureAnalysis // - this.AcceptButton = this.OkBtn; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.OkBtn; this.ClientSize = new System.Drawing.Size(528, 604); + this.Controls.Add(this.statusStrip1); this.Controls.Add(this.tabControl1); - this.Controls.Add(this.OkBtn); this.Controls.Add(this.menuStrip1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MainMenuStrip = this.menuStrip1; @@ -178,7 +138,8 @@ this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.tabPage2.ResumeLayout(false); - this.tabPage2.PerformLayout(); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -186,16 +147,13 @@ #endregion - private System.Windows.Forms.Button OkBtn; private System.Windows.Forms.TreeView CoreTree; private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.TabPage tabPage2; - private System.Windows.Forms.Label ReleasedCoresLabel; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label TotalCoresLabel; - private System.Windows.Forms.Label label1; private System.Windows.Forms.TreeView CurrentCoreTree; private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs b/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs index 77dbeb2178..80984e45c0 100644 --- a/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs +++ b/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs @@ -181,14 +181,26 @@ namespace BizHawk.Client.EmuHawk CurrentCoreTree.EndUpdate(); } + private static int CountAllEmuCores() + { + return Assembly + .Load("BizHawk.Emulation.Cores") + .GetTypes() + .Where(t => typeof(IEmulator).IsAssignableFrom(t) && !t.IsAbstract) + .Count(); + } + + private void DoAllCoresTree(CoreInfo current_ci) { CoreTree.ImageList = new ImageList(); CoreTree.ImageList.Images.Add("Good", Properties.Resources.GreenCheck); CoreTree.ImageList.Images.Add("Bad", Properties.Resources.ExclamationRed); - TotalCoresLabel.Text = KnownCores.Count.ToString(); - ReleasedCoresLabel.Text = KnownCores.Values.Count(c => c.Released).ToString(); + toolStripStatusLabel1.Text = string.Format("Total: {0} Released: {1} Profiled: {2}", + CountAllEmuCores(), + KnownCores.Values.Count(c => c.Released), + KnownCores.Count); CoreTree.Nodes.Clear(); CoreTree.BeginUpdate(); diff --git a/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.resx b/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.resx index 487177ea6d..7c97a753b1 100644 --- a/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.resx +++ b/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.resx @@ -120,6 +120,9 @@ 17, 17 + + 126, 17 +