2014-05-10 02:03:23 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Data;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Windows.Forms;
|
2014-07-03 17:29:01 +00:00
|
|
|
|
|
2014-05-10 02:03:23 +00:00
|
|
|
|
using BizHawk.Common;
|
2014-07-03 17:29:01 +00:00
|
|
|
|
using BizHawk.Common.ReflectionExtensions;
|
|
|
|
|
|
|
|
|
|
using BizHawk.Emulation.Cores.Nintendo.N64;
|
2014-05-10 02:03:23 +00:00
|
|
|
|
|
|
|
|
|
namespace BizHawk.Client.EmuHawk
|
|
|
|
|
{
|
|
|
|
|
public partial class N64ControllerSettingControl : UserControl
|
|
|
|
|
{
|
|
|
|
|
private int _controllerNumber = 1;
|
|
|
|
|
|
|
|
|
|
public N64ControllerSettingControl()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
ControllerNameLabel.Text = "Controller " + ControllerNumber;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void N64ControllerSettingControl_Load(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int ControllerNumber
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return _controllerNumber;
|
|
|
|
|
}
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_controllerNumber = value;
|
|
|
|
|
Refresh();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsConnected
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return EnabledCheckbox.Checked;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2014-05-17 13:00:03 +00:00
|
|
|
|
EnabledCheckbox.Checked = value;
|
|
|
|
|
if (PakTypeDropdown != null) // Null check for designer
|
|
|
|
|
{
|
|
|
|
|
PakTypeDropdown.Enabled = value;
|
|
|
|
|
}
|
2014-05-10 13:58:42 +00:00
|
|
|
|
|
2014-05-10 02:03:23 +00:00
|
|
|
|
Refresh();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-20 17:10:20 +00:00
|
|
|
|
public N64SyncSettings.N64ControllerSettings.N64ControllerPakType PakType
|
2014-05-10 02:03:23 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2014-05-17 13:00:03 +00:00
|
|
|
|
if (PakTypeDropdown.SelectedItem != null) // Null check for designer
|
|
|
|
|
{
|
2014-07-03 17:35:49 +00:00
|
|
|
|
return PakTypeDropdown.SelectedItem
|
|
|
|
|
.ToString()
|
2014-07-20 17:10:20 +00:00
|
|
|
|
.GetEnumFromDescription<N64SyncSettings.N64ControllerSettings.N64ControllerPakType>();
|
2014-05-17 13:00:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-07-20 17:10:20 +00:00
|
|
|
|
return N64SyncSettings.N64ControllerSettings.N64ControllerPakType.NO_PAK;
|
2014-05-10 02:03:23 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2014-05-18 17:35:02 +00:00
|
|
|
|
if (PakTypeDropdown.Items.Count > 0) // Null check for designer
|
2014-05-17 13:00:03 +00:00
|
|
|
|
{
|
|
|
|
|
var toSelect = PakTypeDropdown.Items
|
|
|
|
|
.OfType<object>()
|
2014-07-03 17:01:10 +00:00
|
|
|
|
.FirstOrDefault(item => item.ToString() == value.GetDescription());
|
2014-05-17 13:00:03 +00:00
|
|
|
|
PakTypeDropdown.SelectedItem = toSelect;
|
2014-05-10 02:03:23 +00:00
|
|
|
|
|
2014-05-17 13:00:03 +00:00
|
|
|
|
Refresh();
|
|
|
|
|
}
|
2014-05-10 02:03:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Refresh()
|
|
|
|
|
{
|
|
|
|
|
ControllerNameLabel.Text = "Controller " + ControllerNumber;
|
|
|
|
|
base.Refresh();
|
|
|
|
|
}
|
2014-06-25 13:39:33 +00:00
|
|
|
|
|
|
|
|
|
private void EnabledCheckbox_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
PakTypeDropdown.Enabled = EnabledCheckbox.Checked;
|
|
|
|
|
}
|
2014-05-10 02:03:23 +00:00
|
|
|
|
}
|
|
|
|
|
}
|