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

122 lines
2.8 KiB
C#
Raw Normal View History

2014-06-23 23:25:08 +00:00
using System.Collections.Generic;
using System.Drawing;
namespace BizHawk.Client.EmuHawk
{
[SchemaAttributes("GBA")]
public class GBASchema : IVirtualPadSchema
2014-06-23 23:25:08 +00:00
{
public IEnumerable<PadSchema> GetPadSchemas()
2014-06-23 23:25:08 +00:00
{
2014-06-29 12:47:42 +00:00
yield return StandardController();
2014-06-28 16:13:58 +00:00
yield return ConsoleButtons();
2014-06-23 23:25:08 +00:00
}
2014-06-28 16:13:58 +00:00
2014-06-29 12:47:42 +00:00
public static PadSchema StandardController()
2014-06-23 23:25:08 +00:00
{
return new PadSchema
{
IsConsole = false,
2014-06-28 16:13:58 +00:00
DefaultSize = new Size(194, 90),
2014-06-23 23:25:08 +00:00
Buttons = new[]
{
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "Up",
2014-06-23 23:25:08 +00:00
DisplayName = "",
Icon = Properties.Resources.BlueUp,
2014-06-28 16:13:58 +00:00
Location = new Point(29, 17),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "Down",
2014-06-23 23:25:08 +00:00
DisplayName = "",
Icon = Properties.Resources.BlueDown,
2014-06-28 16:13:58 +00:00
Location = new Point(29, 61),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "Left",
2014-06-23 23:25:08 +00:00
DisplayName = "",
Icon = Properties.Resources.Back,
2014-06-28 16:13:58 +00:00
Location = new Point(17, 39),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "Right",
2014-06-23 23:25:08 +00:00
DisplayName = "",
Icon = Properties.Resources.Forward,
2014-06-28 16:13:58 +00:00
Location = new Point(39, 39),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "B",
2014-06-23 23:25:08 +00:00
DisplayName = "B",
2014-06-28 16:13:58 +00:00
Location = new Point(130, 39),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "A",
2014-06-23 23:25:08 +00:00
DisplayName = "A",
2014-06-28 16:13:58 +00:00
Location = new Point(154, 39),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "Select",
2014-06-23 23:25:08 +00:00
DisplayName = "s",
2014-06-28 16:13:58 +00:00
Location = new Point(64, 39),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "Start",
2014-06-23 23:25:08 +00:00
DisplayName = "S",
2014-06-28 16:13:58 +00:00
Location = new Point(86, 39),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "L",
2014-06-23 23:25:08 +00:00
DisplayName = "L",
2014-06-28 16:13:58 +00:00
Location = new Point(2, 12),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
2014-06-29 12:47:42 +00:00
Name = "R",
2014-06-23 23:25:08 +00:00
DisplayName = "R",
2014-06-28 16:13:58 +00:00
Location = new Point(166, 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.ButtonScema
{
Name = "Power",
DisplayName = "Power",
Location = new Point(10, 15),
2014-06-23 23:25:08 +00:00
Type = PadSchema.PadInputType.Boolean
}
}
};
}
}
}