using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using BizHawk.Client.Common; namespace BizHawk.Client.EmuHawk { [SchemaAttributes("SNES")] public class SnesSchema : IVirtualPadSchema { public IEnumerable GetPads() { yield return new VirtualPad(StandardController(1)) { Location = new Point(15, 15) }; yield return new VirtualPad(StandardController(2)) { Location = new Point(200, 15) }; } public static PadSchema StandardController(int controller) { return new PadSchema { IsConsole = false, DefaultSize = new Size(174, 74), Buttons = new[] { new PadSchema.ButtonScema { Name = "P" + controller + " Up", DisplayName = "", Icon = Properties.Resources.BlueUp, Location = new Point(14, 2), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema { Name = "P" + controller + " Down", DisplayName = "", Icon = Properties.Resources.BlueDown, Location = new Point(14, 46), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema { Name = "P" + controller + " Left", DisplayName = "", Icon = Properties.Resources.Back, Location = new Point(2, 24), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema { Name = "P" + controller + " Right", DisplayName = "", Icon = Properties.Resources.Forward, Location = new Point(24, 24), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema { Name = "P" + controller + " B", DisplayName = "B", Location = new Point(134, 48), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema { Name = "P" + controller + " A", DisplayName = "A", Location = new Point(146, 22), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema { Name = "P" + controller + " Select", DisplayName = "s", Location = new Point(56, 42), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema { Name = "P" + controller + " Start", DisplayName = "S", Location = new Point(78, 42), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema { Name = "P" + controller + " X", DisplayName = "X", Location = new Point(122, 12), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema { Name = "P" + controller + " Y", DisplayName = "Y", Location = new Point(110, 34), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema { Name = "P" + controller + " L", DisplayName = "L", Location = new Point(42, 0), Type = PadSchema.PadInputType.Boolean }, new PadSchema.ButtonScema { Name = "P" + controller + " R", DisplayName = "R", Location = new Point(94, 0), Type = PadSchema.PadInputType.Boolean } } }; } } }