Start schema objects

This commit is contained in:
adelikat 2014-06-22 14:29:46 +00:00
parent 60d1784895
commit 27532b7b2b
3 changed files with 111 additions and 71 deletions

View File

@ -884,7 +884,10 @@
</Compile>
<Compile Include="tools\VirtualPads\IVirtualPad.cs" />
<Compile Include="tools\VirtualPads\PadSchema.cs" />
<Compile Include="tools\VirtualPads\VirtualPadButton.cs" />
<Compile Include="tools\VirtualPads\schema\NesSchema.cs" />
<Compile Include="tools\VirtualPads\VirtualPadButton.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="tools\VirtualPads\VirtualPadControl.cs">
<SubType>UserControl</SubType>
</Compile>
@ -1528,6 +1531,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="config\Saturn\" />
<Folder Include="tools\VirtualPads\controls\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -68,77 +68,16 @@ namespace BizHawk.Client.EmuHawk
switch(Global.Emulator.SystemId)
{
case "NES":
var pad = new PadSchema
{
IsConsole = false,
DefaultSize = new Size(174, 74),
Buttons = new[]
ControllerBox.Controls.Add(new VirtualPadControl(
NesSchema.StandardController(1))
{
new PadSchema.ButtonScema
{
Name = "P1 Up",
DisplayName = "",
Icon = Properties.Resources.BlueUp,
Location = new Point(14, 2),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P1 Down",
DisplayName = "",
Icon = Properties.Resources.BlueDown,
Location = new Point(14, 46),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P1 Left",
DisplayName = "",
Icon = Properties.Resources.Back,
Location = new Point(2, 24),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P1 Right",
DisplayName = "",
Icon = Properties.Resources.Forward,
Location = new Point(24, 24),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P1 B",
DisplayName = "B",
Location = new Point(122, 24),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P1 A",
DisplayName = "A",
Location = new Point(146, 24),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P1 Select",
DisplayName = "s",
Location = new Point(52, 24),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P1 Start",
DisplayName = "S",
Location = new Point(74, 24),
Type = PadSchema.PadInputType.Boolean
}
}
};
ControllerBox.Controls.Add(new VirtualPadControl(pad));
Location = new Point(15, 15)
});
ControllerBox.Controls.Add(new VirtualPadControl(
NesSchema.StandardController(2))
{
Location = new Point(200, 15)
});
break;
}

View File

@ -0,0 +1,97 @@
using System.Drawing;
namespace BizHawk.Client.EmuHawk
{
public static class NesSchema
{
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(122, 24),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " A",
DisplayName = "A",
Location = new Point(146, 24),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Select",
DisplayName = "s",
Location = new Point(52, 24),
Type = PadSchema.PadInputType.Boolean
},
new PadSchema.ButtonScema
{
Name = "P" + controller + " Start",
DisplayName = "S",
Location = new Point(74, 24),
Type = PadSchema.PadInputType.Boolean
}
}
};
}
// TODO
public static PadSchema Zapper()
{
return new PadSchema();
}
// TODO
public static PadSchema ArkanoidPaddle()
{
return new PadSchema();
}
// TODO
public static PadSchema PowerPad()
{
return new PadSchema();
}
}
}