BizHawk/BizHawk.Client.EmuHawk/tools/VirtualPads/schema/NgpSchema.cs

103 lines
2.3 KiB
C#

using System.Collections.Generic;
using System.Drawing;
using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk
{
[Schema("NGP")]
public class NgpSchema : IVirtualPadSchema
{
public IEnumerable<PadSchema> GetPadSchemas(IEmulator core)
{
yield return StandardController();
yield return ConsoleButtons();
}
private static PadSchema StandardController()
{
return new PadSchema
{
IsConsole = false,
DefaultSize = new Size(174, 79),
Buttons = new[]
{
new PadSchema.ButtonSchema
{
Name = "Up",
DisplayName = "",
Icon = Properties.Resources.BlueUp,
Location = new Point(14, 12),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonSchema
{
Name = "Down",
DisplayName = "",
Icon = Properties.Resources.BlueDown,
Location = new Point(14, 56),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonSchema
{
Name = "Left",
DisplayName = "",
Icon = Properties.Resources.Back,
Location = new Point(2, 34),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonSchema
{
Name = "Right",
DisplayName = "",
Icon = Properties.Resources.Forward,
Location = new Point(24, 34),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonSchema
{
Name = "B",
DisplayName = "B",
Location = new Point(74, 34),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonSchema
{
Name = "A",
DisplayName = "A",
Location = new Point(98, 34),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonSchema
{
Name = "Option",
DisplayName = "O",
Location = new Point(146, 12),
Type = PadSchema.PadInputType.Boolean
}
}
};
}
private static PadSchema ConsoleButtons()
{
return new PadSchema
{
DisplayName = "Console",
IsConsole = true,
DefaultSize = new Size(75, 50),
Buttons = new[]
{
new PadSchema.ButtonSchema
{
Name = "Power",
DisplayName = "Power",
Location = new Point(10, 15),
Type = PadSchema.PadInputType.Boolean
}
}
};
}
}
}