rename ToolAttributes

This commit is contained in:
adelikat 2017-07-12 14:44:14 -05:00
parent 5d855ef60b
commit 6e06947a33
10 changed files with 11 additions and 11 deletions

View File

@ -4,9 +4,9 @@ using System.Collections.Generic;
namespace BizHawk.Client.EmuHawk
{
[AttributeUsage(AttributeTargets.Class)]
public class ToolAttributes : Attribute
public class ToolAttribute : Attribute
{
public ToolAttributes(bool released, string[] supportedSystems)
public ToolAttribute(bool released, string[] supportedSystems)
{
Released = released;
SupportedSystems = supportedSystems;

View File

@ -11,7 +11,7 @@ using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk
{
[ToolAttributes(released: false, supportedSystems: null)]
[Tool(released: false, supportedSystems: null)]
public partial class AutoHawk : Form, IToolFormAutoConfig
{
public AutoHawk()

View File

@ -9,7 +9,7 @@ using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
[ToolAttributes(false, null)]
[Tool(false, null)]
public partial class GBGameGenie : Form, IToolFormAutoConfig
{
// TODO: fix the use of Global.Game.System and Emulator.SystemId

View File

@ -20,7 +20,7 @@ namespace BizHawk.Client.EmuHawk
//Verify all wording in the error reports
[ToolAttributes(released: true, supportedSystems: new[] { "GB", "GBA", "GEN", "N64", "NES", "PSX", "SAT", "SMS", "SNES" })]
[Tool(released: true, supportedSystems: new[] { "GB", "GBA", "GEN", "N64", "NES", "PSX", "SAT", "SMS", "SNES" })]
public partial class GameShark : Form, IToolForm, IToolFormAutoConfig
{
#region " Game Genie Dictionary "

View File

@ -12,7 +12,7 @@ using BizHawk.Emulation.Cores.Consoles.Sega.gpgx;
namespace BizHawk.Client.EmuHawk
{
[ToolAttributes(false, null)]
[Tool(false, null)]
public partial class GenGameGenie : Form, IToolFormAutoConfig
{
#pragma warning disable 675

View File

@ -10,7 +10,7 @@ using BizHawk.Client.EmuHawk.ToolExtensions;
namespace BizHawk.Client.EmuHawk
{
[ToolAttributes(false, null)]
[Tool(false, null)]
public partial class MacroInputTool : Form, IToolFormAutoConfig
{
[RequiredService]

View File

@ -8,7 +8,7 @@ using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
[ToolAttributes(false, null)]
[Tool(false, null)]
public partial class NESGameGenie : Form, IToolFormAutoConfig
{
[RequiredService]

View File

@ -10,7 +10,7 @@ using BizHawk.Client.Common;
namespace BizHawk.Client.EmuHawk
{
[ToolAttributes(false, null)]
[Tool(false, null)]
public partial class SNESGameGenie : Form, IToolFormAutoConfig
{
[RequiredService]

View File

@ -60,7 +60,7 @@ namespace BizHawk.Client.EmuHawk
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))
if (VersionInfo.DeveloperBuild && t.GetCustomAttributes(false).OfType<ToolAttribute>().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;

View File

@ -740,7 +740,7 @@ namespace BizHawk.Client.EmuHawk
}
var attr = tool.GetCustomAttributes(false)
.OfType<ToolAttributes>()
.OfType<ToolAttribute>()
.FirstOrDefault();
// If no supported systems mentioned assume all