This commit is contained in:
hegyak 2015-12-10 04:43:05 -08:00
commit 2f2bfc0656
4 changed files with 28 additions and 32 deletions

View File

@ -288,7 +288,7 @@ namespace BizHawk.Client.Common
{
get
{
return FormatValue(_value);
return FormatValue(GetByte());
}
}

View File

@ -58,7 +58,7 @@ namespace BizHawk.Client.EmuHawk
//notably, if we're frame-advancing, we should be paused.
if (signal_paused && !signal_continuousframeAdvancing)
{
Console.WriteLine("THE THING: {0} {1}", signal_paused ,signal_continuousframeAdvancing);
//Console.WriteLine("THE THING: {0} {1}", signal_paused ,signal_continuousframeAdvancing);
skipnextframe = false;
framesskipped = 0;
framestoskip = 0;

View File

@ -107,6 +107,7 @@
//
// RemoveButton
//
this.RemoveButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.RemoveButton.Enabled = false;
this.RemoveButton.Location = new System.Drawing.Point(93, 284);
this.RemoveButton.Name = "RemoveButton";
@ -140,6 +141,7 @@
//
// RemoveAllBtn
//
this.RemoveAllBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.RemoveAllBtn.Enabled = false;
this.RemoveAllBtn.Location = new System.Drawing.Point(174, 284);
this.RemoveAllBtn.Name = "RemoveAllBtn";
@ -161,7 +163,7 @@
this.Controls.Add(this.FunctionView);
this.Controls.Add(this.OK);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MinimumSize = new System.Drawing.Size(200, 50);
this.MinimumSize = new System.Drawing.Size(360, 150);
this.Name = "LuaRegisteredFunctionsList";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Active Registered Functions";

View File

@ -55,43 +55,37 @@ namespace BizHawk.Client.EmuHawk
{
ToolBoxStrip.Items.Clear();
var availableTools = Assembly
.GetAssembly(typeof(IToolForm))
.GetTypes()
.Where(t => typeof(IToolForm).IsAssignableFrom(t))
.Where(t => typeof(Form).IsAssignableFrom(t))
.Where(t => !(typeof(ToolBox).IsAssignableFrom(t)))
.Where(t => VersionInfo.DeveloperBuild ? true : !(t.GetCustomAttributes(false)
.OfType<ToolAttributes>().Any(a => !a.Released)))
.Where(t => !(t == typeof(GBGameGenie))) // Hack, this tool is specific to a system id and a sub-system (gb and gg) we have no reasonable way to declare a dependency like that
.Where(t => BizHawk.Emulation.Common.ServiceInjector.IsAvailable(Global.Emulator.ServiceProvider, t))
.Select(t => Activator.CreateInstance(t))
.Select(instance => new
{
Type = instance.GetType(),
Instance = instance,
Icon = (instance as Form).Icon.ToBitmap(),
Text = (instance as Form).Text,
ShowIcon = (instance as Form).ShowIcon
})
.ToList();
foreach (var tool in availableTools)
foreach (var t in Assembly.GetAssembly(GetType()).GetTypes())
{
var t = new ToolStripButton
if (!typeof(IToolForm).IsAssignableFrom(t))
continue;
if (!typeof(Form).IsAssignableFrom(t))
continue;
if (typeof(ToolBox).IsAssignableFrom(t)) //yo dawg i head you like toolboxes
continue;
if (VersionInfo.DeveloperBuild && t.GetCustomAttributes(false).OfType<ToolAttributes>().Any(a => !a.Released))
continue;
if (t == typeof(GBGameGenie)) // Hack, this tool is specific to a system id and a sub-system (gb and gg) we have no reasonable way to declare a dependency like that
continue;
if (!BizHawk.Emulation.Common.ServiceInjector.IsAvailable(Global.Emulator.ServiceProvider, t))
continue;
var instance = Activator.CreateInstance(t);
var tsb = new ToolStripButton
{
Image = tool.Icon,
Text = tool.Text,
DisplayStyle = tool.ShowIcon ? ToolStripItemDisplayStyle.Image : ToolStripItemDisplayStyle.Text
Image = (instance as Form).Icon.ToBitmap(),
Text = (instance as Form).Text,
DisplayStyle = (instance as Form).ShowIcon ? ToolStripItemDisplayStyle.Image : ToolStripItemDisplayStyle.Text
};
t.Click += (o, e) =>
tsb.Click += (o, e) =>
{
GlobalWin.Tools.Load(tool.Type);
GlobalWin.Tools.Load(t);
Close();
};
ToolBoxStrip.Items.Add(t);
ToolBoxStrip.Items.Add(tsb);
}
}