2009-07-28 21:32:10 +00:00
|
|
|
// Copyright (C) 2003 Dolphin Project.
|
2008-12-08 05:25:12 +00:00
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
2009-07-09 03:58:53 +00:00
|
|
|
#include "wiimote_real.h" // for MAX_WIIMOTES
|
2009-02-01 13:01:50 +00:00
|
|
|
#include "wiimote_hid.h"
|
2009-01-28 16:09:08 +00:00
|
|
|
#include "main.h"
|
2009-07-05 04:29:00 +00:00
|
|
|
#include "ConfigPadDlg.h"
|
|
|
|
#include "ConfigBasicDlg.h"
|
2008-12-08 05:25:12 +00:00
|
|
|
#include "Config.h"
|
2009-02-08 15:39:28 +00:00
|
|
|
#include "EmuDefinitions.h" // for joyinfo
|
2009-01-25 23:07:15 +00:00
|
|
|
|
2009-07-06 00:27:32 +00:00
|
|
|
BEGIN_EVENT_TABLE(WiimotePadConfigDialog,wxDialog)
|
2009-12-09 14:52:30 +00:00
|
|
|
|
2009-07-05 04:29:00 +00:00
|
|
|
EVT_CLOSE(WiimotePadConfigDialog::OnClose)
|
|
|
|
EVT_BUTTON(ID_CLOSE, WiimotePadConfigDialog::CloseClick)
|
2009-12-14 03:30:21 +00:00
|
|
|
// EVT_BUTTON(ID_APPLY, WiimotePadConfigDialog::CloseClick)
|
2009-12-27 19:31:02 +00:00
|
|
|
EVT_NOTEBOOK_PAGE_CHANGED(ID_NOTEBOOK, WiimotePadConfigDialog::NotebookPageChanged)
|
2009-07-05 04:29:00 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
EVT_TIMER(IDTM_BUTTON, WiimotePadConfigDialog::OnButtonTimer)
|
2009-12-27 19:31:02 +00:00
|
|
|
EVT_TIMER(IDTM_UPDATE_PAD, WiimotePadConfigDialog::UpdatePadInfo)
|
2009-12-09 14:52:30 +00:00
|
|
|
|
2009-12-06 01:15:13 +00:00
|
|
|
EVT_COMBOBOX(IDC_JOYNAME, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_CHECKBOX(IDC_RUMBLE, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_COMBOBOX(IDC_RUMBLE_STRENGTH, WiimotePadConfigDialog::GeneralSettingsChanged)
|
2009-12-09 14:52:30 +00:00
|
|
|
EVT_COMBOBOX(IDC_DEAD_ZONE_LEFT, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_COMBOBOX(IDC_DEAD_ZONE_RIGHT, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_COMBOBOX(IDC_STICK_DIAGONAL, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_CHECKBOX(IDC_STICK_C2S, WiimotePadConfigDialog::GeneralSettingsChanged)
|
2009-12-17 14:15:56 +00:00
|
|
|
EVT_COMBOBOX(IDC_TILT_TYPE_WM, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_COMBOBOX(IDC_TILT_TYPE_NC, WiimotePadConfigDialog::GeneralSettingsChanged)
|
2009-12-14 02:23:14 +00:00
|
|
|
EVT_COMBOBOX(IDC_TILT_ROLL, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_CHECKBOX(IDC_TILT_ROLL_SWING, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_COMBOBOX(IDC_TILT_PITCH, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_CHECKBOX(IDC_TILT_PITCH_SWING, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_CHECKBOX(IDC_TILT_ROLL_INVERT, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_CHECKBOX(IDC_TILT_PITCH_INVERT, WiimotePadConfigDialog::GeneralSettingsChanged)
|
2009-12-09 14:52:30 +00:00
|
|
|
EVT_COMBOBOX(IDC_TRIGGER_TYPE, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_COMBOBOX(IDC_NUNCHUCK_STICK, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_COMBOBOX(IDC_CC_LEFT_STICK, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_COMBOBOX(IDC_CC_RIGHT_STICK, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_COMBOBOX(IDC_CC_TRIGGERS, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
EVT_COMBOBOX(IDC_GH3_ANALOG, WiimotePadConfigDialog::GeneralSettingsChanged)
|
|
|
|
|
|
|
|
// Analog
|
2010-01-22 23:19:16 +00:00
|
|
|
EVT_BUTTON(IDB_ANALOG_LEFT_X, WiimotePadConfigDialog::OnAxisClick) EVT_BUTTON(IDB_ANALOG_LEFT_Y, WiimotePadConfigDialog::OnAxisClick)
|
|
|
|
EVT_BUTTON(IDB_ANALOG_RIGHT_X, WiimotePadConfigDialog::OnAxisClick) EVT_BUTTON(IDB_ANALOG_RIGHT_Y, WiimotePadConfigDialog::OnAxisClick)
|
|
|
|
EVT_BUTTON(IDB_TRIGGER_L, WiimotePadConfigDialog::OnAxisClick) EVT_BUTTON(IDB_TRIGGER_R, WiimotePadConfigDialog::OnAxisClick)
|
2009-12-09 14:52:30 +00:00
|
|
|
|
2009-02-15 18:23:42 +00:00
|
|
|
// Wiimote
|
2009-07-05 04:29:00 +00:00
|
|
|
EVT_BUTTON(IDB_WM_A, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_WM_B, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_WM_1, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_WM_2, WiimotePadConfigDialog::OnButtonClick)
|
2009-12-08 19:58:19 +00:00
|
|
|
EVT_BUTTON(IDB_WM_P, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_WM_M, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_WM_H, WiimotePadConfigDialog::OnButtonClick)
|
2009-07-05 04:29:00 +00:00
|
|
|
EVT_BUTTON(IDB_WM_L, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_WM_R, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_WM_U, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_WM_D, WiimotePadConfigDialog::OnButtonClick)
|
2009-12-08 19:58:19 +00:00
|
|
|
EVT_BUTTON(IDB_WM_ROLL_L, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_WM_ROLL_R, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_WM_PITCH_U, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_WM_PITCH_D, WiimotePadConfigDialog::OnButtonClick)
|
2009-07-05 04:29:00 +00:00
|
|
|
EVT_BUTTON(IDB_WM_SHAKE, WiimotePadConfigDialog::OnButtonClick)
|
2009-02-16 09:25:22 +00:00
|
|
|
|
2009-02-15 18:23:42 +00:00
|
|
|
// Nunchuck
|
2009-07-05 04:29:00 +00:00
|
|
|
EVT_BUTTON(IDB_NC_Z, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_NC_C, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_NC_L, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_NC_R, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_NC_U, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_NC_D, WiimotePadConfigDialog::OnButtonClick)
|
2009-12-17 14:15:56 +00:00
|
|
|
EVT_BUTTON(IDB_NC_ROLL_L, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_NC_ROLL_R, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_NC_PITCH_U, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_NC_PITCH_D, WiimotePadConfigDialog::OnButtonClick)
|
2009-07-05 04:29:00 +00:00
|
|
|
EVT_BUTTON(IDB_NC_SHAKE, WiimotePadConfigDialog::OnButtonClick)
|
2009-02-15 18:23:42 +00:00
|
|
|
|
2009-02-24 02:40:17 +00:00
|
|
|
// Classic Controller
|
2009-07-05 04:29:00 +00:00
|
|
|
EVT_BUTTON(IDB_CC_A, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_B, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_X, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_Y, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_CC_P, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_M, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_H, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_CC_TL, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_ZL, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_ZR, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_TR, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_CC_DL, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_DU, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_DR, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_DD, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_CC_DL, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_DU, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_DR, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_DD, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_CC_LL, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_LU, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_LR, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_LD, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_CC_RL, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_RU, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_RR, WiimotePadConfigDialog::OnButtonClick) EVT_BUTTON(IDB_CC_RD, WiimotePadConfigDialog::OnButtonClick)
|
2009-07-09 03:58:53 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// Guitar Hero 3
|
2009-07-09 03:58:53 +00:00
|
|
|
EVT_BUTTON(IDB_GH3_GREEN, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_GH3_RED, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_GH3_YELLOW, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_GH3_BLUE, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_GH3_ORANGE, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_GH3_PLUS, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_GH3_MINUS, WiimotePadConfigDialog::OnButtonClick)
|
2009-12-09 14:52:30 +00:00
|
|
|
EVT_BUTTON(IDB_GH3_WHAMMY, WiimotePadConfigDialog::OnButtonClick)
|
2009-07-09 03:58:53 +00:00
|
|
|
EVT_BUTTON(IDB_GH3_ANALOG_LEFT, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_GH3_ANALOG_RIGHT, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_GH3_ANALOG_UP, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_GH3_ANALOG_DOWN, WiimotePadConfigDialog::OnButtonClick)
|
|
|
|
EVT_BUTTON(IDB_GH3_STRUM_UP, WiimotePadConfigDialog::OnButtonClick)
|
2009-12-09 14:52:30 +00:00
|
|
|
EVT_BUTTON(IDB_GH3_STRUM_DOWN, WiimotePadConfigDialog::OnButtonClick)
|
2009-07-09 03:58:53 +00:00
|
|
|
|
2008-12-08 05:25:12 +00:00
|
|
|
END_EVENT_TABLE()
|
2009-02-06 06:15:59 +00:00
|
|
|
|
2009-07-05 04:29:00 +00:00
|
|
|
WiimotePadConfigDialog::WiimotePadConfigDialog(wxWindow *parent, wxWindowID id, const wxString &title,
|
2009-01-26 07:01:43 +00:00
|
|
|
const wxPoint &position, const wxSize& size, long style)
|
2009-07-06 00:27:32 +00:00
|
|
|
: wxDialog(parent, id, title, position, size, style)
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2010-01-22 23:19:16 +00:00
|
|
|
m_ControlsCreated = false;;
|
|
|
|
CreatePadGUIControls();
|
|
|
|
|
2009-07-05 04:29:00 +00:00
|
|
|
#if wxUSE_TIMER
|
|
|
|
m_ButtonMappingTimer = new wxTimer(this, IDTM_BUTTON);
|
2009-12-09 14:52:30 +00:00
|
|
|
m_UpdatePadTimer = new wxTimer(this, IDTM_UPDATE_PAD);
|
2009-07-05 04:29:00 +00:00
|
|
|
|
|
|
|
// Reset values
|
2009-12-17 16:14:48 +00:00
|
|
|
g_Pressed = 0;
|
|
|
|
ClickedButton = NULL;
|
2009-07-05 04:29:00 +00:00
|
|
|
GetButtonWaitingID = 0;
|
|
|
|
GetButtonWaitingTimer = 0;
|
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
if (WiiMoteEmu::NumGoodPads)
|
|
|
|
{
|
|
|
|
// Start the permanent timer
|
|
|
|
const int TimesPerSecond = 10;
|
|
|
|
m_UpdatePadTimer->Start(1000 / TimesPerSecond);
|
|
|
|
}
|
2009-07-05 04:29:00 +00:00
|
|
|
#endif
|
2009-01-26 14:13:27 +00:00
|
|
|
|
2010-01-29 03:11:29 +00:00
|
|
|
m_Page = g_Config.CurrentPage;
|
|
|
|
m_Notebook->ChangeSelection(m_Page);
|
2009-02-14 01:15:35 +00:00
|
|
|
// Set control values
|
2009-01-26 07:01:43 +00:00
|
|
|
UpdateGUI();
|
2009-01-28 16:09:08 +00:00
|
|
|
|
|
|
|
wxTheApp->Connect(wxID_ANY, wxEVT_KEY_DOWN, // Keyboard
|
2009-07-05 04:29:00 +00:00
|
|
|
wxKeyEventHandler(WiimotePadConfigDialog::OnKeyDown),
|
2009-01-28 16:09:08 +00:00
|
|
|
(wxObject*)0, this);
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
|
|
|
|
2009-11-29 17:58:52 +00:00
|
|
|
WiimotePadConfigDialog::~WiimotePadConfigDialog()
|
|
|
|
{
|
|
|
|
if (m_ButtonMappingTimer)
|
2009-12-09 14:52:30 +00:00
|
|
|
{
|
2009-11-29 17:58:52 +00:00
|
|
|
delete m_ButtonMappingTimer;
|
2009-12-09 14:52:30 +00:00
|
|
|
m_ButtonMappingTimer = NULL;
|
|
|
|
}
|
|
|
|
if (m_UpdatePadTimer)
|
|
|
|
{
|
|
|
|
delete m_UpdatePadTimer;
|
|
|
|
m_UpdatePadTimer = NULL;
|
|
|
|
}
|
2009-11-29 17:58:52 +00:00
|
|
|
}
|
|
|
|
|
2010-01-22 23:19:16 +00:00
|
|
|
// Notebook page changed
|
|
|
|
void WiimotePadConfigDialog::NotebookPageChanged(wxNotebookEvent& event)
|
|
|
|
{
|
|
|
|
// Update the global variable
|
|
|
|
m_Page = event.GetSelection();
|
|
|
|
|
|
|
|
// Update GUI
|
|
|
|
if (m_ControlsCreated)
|
|
|
|
UpdateGUI();
|
|
|
|
}
|
|
|
|
|
|
|
|
void WiimotePadConfigDialog::OnClose(wxCloseEvent& event)
|
|
|
|
{
|
|
|
|
if (m_UpdatePadTimer)
|
|
|
|
m_UpdatePadTimer->Stop();
|
|
|
|
if (m_ButtonMappingTimer)
|
|
|
|
m_ButtonMappingTimer->Stop();
|
|
|
|
|
|
|
|
g_Config.CurrentPage = m_Page;
|
|
|
|
|
|
|
|
EndModal(wxID_CLOSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
void WiimotePadConfigDialog::CloseClick(wxCommandEvent& event)
|
|
|
|
{
|
|
|
|
switch(event.GetId())
|
|
|
|
{
|
|
|
|
case ID_CLOSE:
|
|
|
|
Close();
|
|
|
|
break;
|
|
|
|
case ID_APPLY:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
// Save keyboard key mapping
|
|
|
|
void WiimotePadConfigDialog::SaveButtonMapping(int Id, int Key)
|
|
|
|
{
|
|
|
|
if (IDB_ANALOG_LEFT_X <= Id && Id <= IDB_TRIGGER_R)
|
|
|
|
{
|
|
|
|
WiiMoteEmu::WiiMapping[m_Page].AxisMapping.Code[Id - IDB_ANALOG_LEFT_X] = Key;
|
|
|
|
}
|
|
|
|
else if (IDB_WM_A <= Id && Id <= IDB_GH3_STRUM_DOWN)
|
|
|
|
{
|
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Button[Id - IDB_WM_A] = Key;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-07-05 04:29:00 +00:00
|
|
|
void WiimotePadConfigDialog::OnKeyDown(wxKeyEvent& event)
|
2009-01-28 16:09:08 +00:00
|
|
|
{
|
2010-01-29 03:11:29 +00:00
|
|
|
//event.Skip();
|
2009-01-28 16:09:08 +00:00
|
|
|
|
2009-02-15 18:23:42 +00:00
|
|
|
if(ClickedButton != NULL)
|
|
|
|
{
|
2009-11-29 17:58:52 +00:00
|
|
|
// Save the key
|
|
|
|
g_Pressed = event.GetKeyCode();
|
|
|
|
// Handle the keyboard key mapping
|
|
|
|
char keyStr[128] = {0};
|
|
|
|
|
2009-02-15 18:23:42 +00:00
|
|
|
// Allow the escape key to set a blank key
|
|
|
|
if (g_Pressed == WXK_ESCAPE)
|
|
|
|
{
|
2009-12-27 19:31:02 +00:00
|
|
|
SaveButtonMapping(ClickedButton->GetId(), -1);
|
|
|
|
SetButtonText(ClickedButton->GetId(), wxString());
|
2009-02-15 18:23:42 +00:00
|
|
|
}
|
2009-11-29 17:58:52 +00:00
|
|
|
else
|
|
|
|
{
|
2009-02-15 18:23:42 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
BYTE keyState[256];
|
|
|
|
GetKeyboardState(keyState);
|
|
|
|
for (int i = 1; i < 256; ++i)
|
|
|
|
{
|
|
|
|
if ((keyState[i] & 0x80) != 0)
|
|
|
|
{
|
|
|
|
// Use the left and right specific keys instead of the common ones
|
|
|
|
if (i == VK_SHIFT || i == VK_CONTROL || i == VK_MENU) continue;
|
|
|
|
// Update the button label
|
2009-12-27 19:31:02 +00:00
|
|
|
SetButtonText(ClickedButton->GetId(),
|
|
|
|
wxString::FromAscii(InputCommon::VKToString(i).c_str()));
|
2009-02-15 18:23:42 +00:00
|
|
|
// Save the setting
|
2009-12-27 19:31:02 +00:00
|
|
|
SaveButtonMapping(ClickedButton->GetId(), i);
|
2009-11-28 19:45:24 +00:00
|
|
|
break;
|
2009-02-15 18:23:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#elif defined(HAVE_X11) && HAVE_X11
|
2009-12-17 16:14:48 +00:00
|
|
|
int XKey = InputCommon::wxCharCodeWXToX(g_Pressed);
|
|
|
|
InputCommon::XKeyToString(XKey, keyStr);
|
2009-12-29 12:13:47 +00:00
|
|
|
SetButtonText(ClickedButton->GetId(),
|
|
|
|
wxString::FromAscii(keyStr));
|
|
|
|
SaveButtonMapping(ClickedButton->GetId(), XKey);
|
2009-02-15 18:23:42 +00:00
|
|
|
#endif
|
2009-11-29 17:58:52 +00:00
|
|
|
}
|
|
|
|
m_ButtonMappingTimer->Stop();
|
|
|
|
GetButtonWaitingTimer = 0;
|
|
|
|
GetButtonWaitingID = 0;
|
|
|
|
ClickedButton = NULL;
|
2009-02-15 18:23:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Input button clicked
|
2009-07-05 04:29:00 +00:00
|
|
|
void WiimotePadConfigDialog::OnButtonClick(wxCommandEvent& event)
|
2009-02-15 18:23:42 +00:00
|
|
|
{
|
2009-12-17 16:14:48 +00:00
|
|
|
event.Skip();
|
2009-11-29 17:58:52 +00:00
|
|
|
|
2009-02-15 18:23:42 +00:00
|
|
|
// Don't allow space to start a new Press Key option, that will interfer with setting a key to space
|
|
|
|
if (g_Pressed == WXK_SPACE) { g_Pressed = 0; return; }
|
|
|
|
|
2009-12-17 16:14:48 +00:00
|
|
|
if (m_ButtonMappingTimer->IsRunning()) return;
|
|
|
|
|
2009-02-15 18:23:42 +00:00
|
|
|
// Create the button object
|
|
|
|
ClickedButton = (wxButton *)event.GetEventObject();
|
2009-11-29 17:58:52 +00:00
|
|
|
// Save old label so we can revert back
|
2009-02-15 18:23:42 +00:00
|
|
|
OldLabel = ClickedButton->GetLabel();
|
2009-12-28 04:35:03 +00:00
|
|
|
ClickedButton->SetWindowStyle(wxWANTS_CHARS);
|
2009-11-29 17:58:52 +00:00
|
|
|
ClickedButton->SetLabel(wxT("<Press Key>"));
|
|
|
|
DoGetButtons(ClickedButton->GetId());
|
2009-01-28 16:09:08 +00:00
|
|
|
}
|
2009-02-03 07:43:52 +00:00
|
|
|
|
2010-01-22 23:19:16 +00:00
|
|
|
void WiimotePadConfigDialog::OnAxisClick(wxCommandEvent& event)
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2010-01-22 23:19:16 +00:00
|
|
|
event.Skip();
|
2009-12-27 19:31:02 +00:00
|
|
|
|
2010-01-22 23:19:16 +00:00
|
|
|
if (m_ButtonMappingTimer->IsRunning()) return;
|
2009-02-03 07:43:52 +00:00
|
|
|
|
2010-01-22 23:19:16 +00:00
|
|
|
ClickedButton = NULL;
|
|
|
|
wxButton* pButton = (wxButton *)event.GetEventObject();
|
|
|
|
OldLabel = pButton->GetLabel();
|
|
|
|
pButton->SetWindowStyle(wxWANTS_CHARS);
|
|
|
|
pButton->SetLabel(wxT("<Move Axis>"));
|
|
|
|
DoGetButtons(pButton->GetId());
|
2009-02-07 04:19:52 +00:00
|
|
|
}
|
2009-02-10 17:25:08 +00:00
|
|
|
|
2009-02-04 13:35:28 +00:00
|
|
|
// Bitmap box and dot
|
2009-07-05 04:29:00 +00:00
|
|
|
wxBitmap WiimotePadConfigDialog::CreateBitmap()
|
2009-02-04 13:35:28 +00:00
|
|
|
{
|
|
|
|
BoxW = 70, BoxH = 70;
|
|
|
|
wxBitmap bitmap(BoxW, BoxH);
|
|
|
|
wxMemoryDC dc;
|
|
|
|
dc.SelectObject(bitmap);
|
|
|
|
|
|
|
|
// Set outline and fill colors
|
|
|
|
wxPen LightBluePen(_T("#7f9db9")); // Windows XP color
|
|
|
|
dc.SetPen(LightBluePen);
|
|
|
|
dc.SetBrush(*wxWHITE_BRUSH);
|
|
|
|
|
|
|
|
dc.Clear();
|
|
|
|
dc.DrawRectangle(0, 0, BoxW, BoxH);
|
|
|
|
dc.SelectObject(wxNullBitmap);
|
|
|
|
return bitmap;
|
2009-01-28 16:09:08 +00:00
|
|
|
}
|
2009-12-09 14:52:30 +00:00
|
|
|
|
2009-07-05 04:29:00 +00:00
|
|
|
wxBitmap WiimotePadConfigDialog::CreateBitmapDot()
|
2009-01-28 16:09:08 +00:00
|
|
|
{
|
2009-02-04 13:35:28 +00:00
|
|
|
int w = 2, h = 2;
|
|
|
|
wxBitmap bitmap(w, h);
|
|
|
|
wxMemoryDC dc;
|
|
|
|
dc.SelectObject(bitmap);
|
|
|
|
|
|
|
|
// Set outline and fill colors
|
|
|
|
dc.SetPen(*wxRED_PEN);
|
|
|
|
dc.SetBrush(*wxRED_BRUSH);
|
|
|
|
|
|
|
|
dc.Clear();
|
|
|
|
dc.DrawRectangle(0, 0, w, h);
|
|
|
|
dc.SelectObject(wxNullBitmap);
|
|
|
|
return bitmap;
|
2009-01-28 16:09:08 +00:00
|
|
|
}
|
2009-12-09 14:52:30 +00:00
|
|
|
|
2009-07-05 04:29:00 +00:00
|
|
|
wxBitmap WiimotePadConfigDialog::CreateBitmapDeadZone(int Radius)
|
2009-02-14 01:15:35 +00:00
|
|
|
{
|
|
|
|
wxBitmap bitmap(Radius*2, Radius*2);
|
|
|
|
wxMemoryDC dc;
|
|
|
|
dc.SelectObject(bitmap);
|
|
|
|
|
|
|
|
// Set outline and fill colors
|
|
|
|
dc.SetPen(*wxLIGHT_GREY_PEN);
|
|
|
|
dc.SetBrush(*wxLIGHT_GREY_BRUSH);
|
|
|
|
|
|
|
|
//dc.SetBackground(*wxGREEN_BRUSH);
|
|
|
|
dc.Clear();
|
|
|
|
dc.DrawCircle(Radius, Radius, Radius);
|
2009-12-09 14:52:30 +00:00
|
|
|
dc.SelectObject(wxNullBitmap);
|
2009-02-14 01:15:35 +00:00
|
|
|
return bitmap;
|
|
|
|
}
|
2009-12-09 14:52:30 +00:00
|
|
|
|
2009-07-05 04:29:00 +00:00
|
|
|
wxBitmap WiimotePadConfigDialog::CreateBitmapClear()
|
2009-02-14 01:15:35 +00:00
|
|
|
{
|
|
|
|
wxBitmap bitmap(BoxW, BoxH);
|
|
|
|
wxMemoryDC dc;
|
|
|
|
dc.SelectObject(bitmap);
|
|
|
|
|
|
|
|
dc.Clear();
|
2009-12-09 14:52:30 +00:00
|
|
|
dc.SelectObject(wxNullBitmap);
|
2009-02-14 01:15:35 +00:00
|
|
|
return bitmap;
|
|
|
|
}
|
2008-12-08 05:25:12 +00:00
|
|
|
|
2009-11-14 17:08:32 +00:00
|
|
|
void WiimotePadConfigDialog::CreatePadGUIControls()
|
2009-07-05 04:29:00 +00:00
|
|
|
{
|
2009-11-14 17:08:32 +00:00
|
|
|
// Search for devices and add them to the device list
|
|
|
|
wxArrayString StrJoyname; // The string array
|
|
|
|
if (WiiMoteEmu::NumGoodPads > 0)
|
2009-02-04 13:35:28 +00:00
|
|
|
{
|
2009-11-14 17:08:32 +00:00
|
|
|
for (int x = 0; x < (int)WiiMoteEmu::joyinfo.size(); x++)
|
|
|
|
StrJoyname.Add(wxString::FromAscii(WiiMoteEmu::joyinfo[x].Name.c_str()));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-12-27 19:31:02 +00:00
|
|
|
StrJoyname.Add(wxT("<No Gamepad Detected>"));
|
2009-11-14 17:08:32 +00:00
|
|
|
}
|
2009-11-12 18:57:35 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
wxArrayString TextDeadZone;
|
|
|
|
for (int i = 0; i <= 50; i++)
|
|
|
|
TextDeadZone.Add(wxString::Format(wxT("%i%%"), i));
|
|
|
|
|
|
|
|
wxArrayString StrDiagonal;
|
2010-01-22 23:19:16 +00:00
|
|
|
for (int i = 0; i <= 10; i++)
|
|
|
|
StrDiagonal.Add(wxString::Format(wxT("%i%%"), 100 - i * 5));
|
2009-12-09 14:52:30 +00:00
|
|
|
|
|
|
|
wxArrayString StrRumble;
|
|
|
|
for (int i = 0; i <= 10; i++)
|
|
|
|
StrRumble.Add(wxString::Format(wxT("%i%%"), i*10));
|
|
|
|
|
2009-02-04 13:35:28 +00:00
|
|
|
// The tilt list
|
|
|
|
wxArrayString StrTilt;
|
2009-12-27 19:31:02 +00:00
|
|
|
StrTilt.Add(wxT("Keyboard"));
|
|
|
|
StrTilt.Add(wxT("Analog 1"));
|
|
|
|
StrTilt.Add(wxT("Analog 2"));
|
|
|
|
StrTilt.Add(wxT("Triggers"));
|
2009-12-09 14:52:30 +00:00
|
|
|
|
2009-02-10 17:25:08 +00:00
|
|
|
// The range is in degrees and are set at even 5 degrees values
|
2009-02-12 08:46:48 +00:00
|
|
|
wxArrayString StrTiltRangeRoll, StrTiltRangePitch;
|
2009-12-14 02:23:14 +00:00
|
|
|
for (int i = 1; i <= 36; i++)
|
2009-02-28 01:26:56 +00:00
|
|
|
StrTiltRangeRoll.Add(wxString::Format(wxT("%i"), i*5));
|
2009-12-14 02:23:14 +00:00
|
|
|
for (int i = 1; i <= 36; i++)
|
2009-02-28 01:26:56 +00:00
|
|
|
StrTiltRangePitch.Add(wxString::Format(wxT("%i"), i*5));
|
2009-01-26 14:13:27 +00:00
|
|
|
|
2009-02-04 13:35:28 +00:00
|
|
|
// The Trigger type list
|
2009-02-06 06:15:59 +00:00
|
|
|
wxArrayString StrTriggerType;
|
2009-12-27 19:31:02 +00:00
|
|
|
StrTriggerType.Add(wxT("SDL")); // -0x8000 to 0x7fff
|
|
|
|
StrTriggerType.Add(wxT("XInput")); // 0x00 to 0xff
|
2009-02-15 02:01:43 +00:00
|
|
|
|
|
|
|
// The Nunchuck stick list
|
|
|
|
wxArrayString StrNunchuck;
|
2009-12-27 19:31:02 +00:00
|
|
|
StrNunchuck.Add(wxT("Keyboard"));
|
|
|
|
StrNunchuck.Add(wxT("Analog 1"));
|
|
|
|
StrNunchuck.Add(wxT("Analog 2"));
|
2009-02-15 18:23:42 +00:00
|
|
|
|
2009-02-24 02:40:17 +00:00
|
|
|
// The Classic Controller triggers list
|
|
|
|
wxArrayString StrCcTriggers;
|
2009-12-27 19:31:02 +00:00
|
|
|
StrCcTriggers.Add(wxT("Keyboard"));
|
|
|
|
StrCcTriggers.Add(wxT("Triggers"));
|
2009-11-14 17:08:32 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// GH3 stick list
|
|
|
|
wxArrayString StrAnalogArray;
|
2009-12-27 19:31:02 +00:00
|
|
|
StrAnalogArray.Add(wxT("Analog 1"));
|
|
|
|
StrAnalogArray.Add(wxT("Analog 2"));
|
2009-12-09 14:52:30 +00:00
|
|
|
|
|
|
|
static const wxChar* anText[] =
|
|
|
|
{
|
|
|
|
wxT("Left X-Axis"),
|
|
|
|
wxT("Left Y-Axis"),
|
|
|
|
wxT("Right X-Axis"),
|
|
|
|
wxT("Right Y-Axis"),
|
|
|
|
wxT("Left Trigger"),
|
|
|
|
wxT("Right Trigger"),
|
|
|
|
};
|
|
|
|
|
|
|
|
static const wxChar* wmText[] =
|
|
|
|
{
|
|
|
|
wxT("A"),
|
|
|
|
wxT("B"),
|
|
|
|
wxT("1"),
|
|
|
|
wxT("2"),
|
|
|
|
wxT("+"),
|
|
|
|
wxT("- "), // Intentional space
|
|
|
|
wxT("Home"),
|
|
|
|
wxT("Left"),
|
|
|
|
wxT("Right"),
|
|
|
|
wxT("Up"),
|
|
|
|
wxT("Down"),
|
|
|
|
wxT("Roll Left"),
|
|
|
|
wxT("Roll Right"),
|
|
|
|
wxT("Pitch Up"),
|
|
|
|
wxT("Pitch Down"),
|
|
|
|
wxT("Shake"),
|
|
|
|
};
|
|
|
|
|
|
|
|
static const wxChar* ncText[] =
|
|
|
|
{
|
|
|
|
wxT("Z"),
|
|
|
|
wxT("C"),
|
|
|
|
wxT("Left"),
|
|
|
|
wxT("Right"),
|
|
|
|
wxT("Up"),
|
|
|
|
wxT("Down"),
|
2009-12-17 14:15:56 +00:00
|
|
|
wxT("Roll Left"),
|
|
|
|
wxT("Roll Right"),
|
|
|
|
wxT("Pitch Up"),
|
|
|
|
wxT("Pitch Down"),
|
2009-12-09 14:52:30 +00:00
|
|
|
wxT("Shake"),
|
|
|
|
};
|
|
|
|
|
|
|
|
static const wxChar* classicText[] =
|
|
|
|
{
|
|
|
|
wxT("A"),
|
|
|
|
wxT("B"),
|
|
|
|
wxT("X"),
|
|
|
|
wxT("Y"),
|
|
|
|
wxT("+"),
|
|
|
|
wxT("- "),
|
|
|
|
wxT("Home"),
|
|
|
|
wxT("Left trigger"),
|
|
|
|
wxT("Right trigger"),
|
|
|
|
wxT("Left Z"),
|
|
|
|
wxT("Right Z"),
|
|
|
|
wxT("Digital Left"),
|
|
|
|
wxT("Digital Right"),
|
|
|
|
wxT("Digital Up"),
|
|
|
|
wxT("Digital Down"),
|
|
|
|
wxT("L Left"),
|
|
|
|
wxT("L Right"),
|
|
|
|
wxT("L Up"),
|
|
|
|
wxT("L Down"),
|
|
|
|
wxT("R Left"),
|
|
|
|
wxT("R Right"),
|
|
|
|
wxT("R Up"),
|
|
|
|
wxT("R Down"),
|
|
|
|
};
|
|
|
|
|
|
|
|
static const wxChar* gh3Text[] =
|
|
|
|
{
|
|
|
|
wxT("Green"),
|
|
|
|
wxT("Red"),
|
|
|
|
wxT("Yellow"),
|
|
|
|
wxT("Blue"),
|
|
|
|
wxT("Orange"),
|
|
|
|
wxT("+"),
|
|
|
|
wxT("- "),
|
|
|
|
wxT("Whammy"),
|
|
|
|
wxT("Left"), //analog stick
|
|
|
|
wxT("Right"),
|
|
|
|
wxT("Up"),
|
|
|
|
wxT("Down"),
|
|
|
|
wxT("Strum Up"),
|
|
|
|
wxT("Strum Down"),
|
|
|
|
};
|
|
|
|
|
|
|
|
// Configuration controls sizes
|
2010-01-24 18:23:47 +00:00
|
|
|
static const int BtW = 70, BtH = 20;
|
|
|
|
// static const int TxtW = 50, TxtH = 20; // These are never used. Will they ever be?
|
2009-12-09 14:52:30 +00:00
|
|
|
// A small type font
|
|
|
|
wxFont m_SmallFont(7, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
|
2009-11-14 17:08:32 +00:00
|
|
|
|
2009-07-05 04:29:00 +00:00
|
|
|
m_Notebook = new wxNotebook(this, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize);
|
|
|
|
|
2009-05-16 04:53:48 +00:00
|
|
|
for (int i = 0; i < MAX_WIIMOTES; i++)
|
2009-11-14 17:08:32 +00:00
|
|
|
{
|
|
|
|
m_Controller[i] = new wxPanel(m_Notebook, ID_CONTROLLERPAGE1 + i, wxDefaultPosition, wxDefaultSize);
|
2009-07-05 04:29:00 +00:00
|
|
|
m_Notebook->AddPage(m_Controller[i], wxString::Format(wxT("Wiimote %d"), i+1));
|
2009-02-20 03:13:22 +00:00
|
|
|
|
2009-02-12 08:46:48 +00:00
|
|
|
// Controller
|
2010-02-22 01:08:42 +00:00
|
|
|
m_Joyname[i] = new wxChoice(m_Controller[i], IDC_JOYNAME, wxDefaultPosition, wxSize(200, -1), StrJoyname, 0, wxDefaultValidator, StrJoyname[0]);
|
2009-12-09 14:52:30 +00:00
|
|
|
m_Joyname[i]->SetToolTip(wxT("Save your settings and configure another joypad"));
|
2009-02-12 08:46:48 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// Dead zone
|
|
|
|
m_ComboDeadZoneLabel[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Dead Zone"));
|
2010-02-22 01:08:42 +00:00
|
|
|
m_ComboDeadZoneLeft[i] = new wxChoice(m_Controller[i], IDC_DEAD_ZONE_LEFT, wxDefaultPosition, wxSize(50, -1), TextDeadZone, 0, wxDefaultValidator, TextDeadZone[0]);
|
|
|
|
m_ComboDeadZoneRight[i] = new wxChoice(m_Controller[i], IDC_DEAD_ZONE_RIGHT, wxDefaultPosition, wxSize(50, -1), TextDeadZone, 0, wxDefaultValidator, TextDeadZone[0]);
|
2009-12-06 01:15:13 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// Circle to square
|
|
|
|
m_CheckC2S[i] = new wxCheckBox(m_Controller[i], IDC_STICK_C2S, wxT("Circle To Square"));
|
|
|
|
m_CheckC2S[i]->SetToolTip(wxT("This will convert a circular stick radius to a square stick radius.\n")
|
|
|
|
wxT("This can be useful for the pitch and roll emulation."));
|
2009-12-06 01:15:13 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// The drop down menu for the circle to square adjustment
|
|
|
|
m_DiagonalLabel[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Diagonal"));
|
|
|
|
m_DiagonalLabel[i]->SetToolTip(wxT("To produce a perfect square circle in the 'Out' window you have to manually set\n")
|
|
|
|
wxT("your diagonal values here from what is shown in the 'In' window."));
|
2010-02-22 01:08:42 +00:00
|
|
|
m_ComboDiagonal[i] = new wxChoice(m_Controller[i], IDC_STICK_DIAGONAL, wxDefaultPosition, wxSize(50, -1), StrDiagonal, 0, wxDefaultValidator, StrDiagonal[0]);
|
2009-12-09 14:52:30 +00:00
|
|
|
|
|
|
|
// Rumble
|
2009-12-06 01:15:13 +00:00
|
|
|
m_CheckRumble[i] = new wxCheckBox(m_Controller[i], IDC_RUMBLE, wxT("Rumble"));
|
|
|
|
m_RumbleStrengthLabel[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Strength"));
|
2010-02-22 01:08:42 +00:00
|
|
|
m_RumbleStrength[i] = new wxChoice(m_Controller[i], IDC_RUMBLE_STRENGTH, wxDefaultPosition, wxSize(50, -1), StrRumble, 0, wxDefaultValidator, StrRumble[0]);
|
2009-02-04 13:35:28 +00:00
|
|
|
|
2009-02-12 08:46:48 +00:00
|
|
|
// Sizers
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sDeadZoneHoriz[i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_sDeadZoneHoriz[i]->Add(m_ComboDeadZoneLeft[i], 0, (wxUP), 0);
|
|
|
|
m_sDeadZoneHoriz[i]->Add(m_ComboDeadZoneRight[i], 0, (wxUP), 0);
|
2009-12-06 01:15:13 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sDeadZone[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_sDeadZone[i]->Add(m_ComboDeadZoneLabel[i], 0, wxALIGN_CENTER | (wxUP), 0);
|
|
|
|
m_sDeadZone[i]->Add(m_sDeadZoneHoriz[i], 0, wxALIGN_CENTER | (wxUP), 2);
|
2009-02-14 01:15:35 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sDiagonal[i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_sDiagonal[i]->Add(m_DiagonalLabel[i], 0, (wxUP), 4);
|
|
|
|
m_sDiagonal[i]->Add(m_ComboDiagonal[i], 0, (wxLEFT), 2);
|
2009-02-12 08:46:48 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sCircle2Square[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_sCircle2Square[i]->Add(m_CheckC2S[i], 0, wxALIGN_CENTER | (wxUP), 0);
|
|
|
|
m_sCircle2Square[i]->Add(m_sDiagonal[i], 0, wxALIGN_CENTER | (wxUP), 2);
|
2009-02-14 01:15:35 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sC2SDeadZone[i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_sC2SDeadZone[i]->Add(m_sDeadZone[i], 0, (wxUP), 0);
|
|
|
|
m_sC2SDeadZone[i]->Add(m_sCircle2Square[i], 0, (wxLEFT), 8);
|
2009-02-14 01:15:35 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sJoyname[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_sJoyname[i]->Add(m_Joyname[i], 0, wxALIGN_CENTER | (wxUP | wxDOWN), 4);
|
|
|
|
m_sJoyname[i]->Add(m_sC2SDeadZone[i], 0, (wxUP | wxDOWN), 4);
|
2009-02-12 08:46:48 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sRumble[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_sRumble[i]->Add(m_CheckRumble[i], 0, wxALIGN_CENTER | (wxUP | wxDOWN), 8);
|
|
|
|
m_sRumble[i]->Add(m_RumbleStrengthLabel[i], 0, wxALIGN_CENTER | (wxUP), 4);
|
|
|
|
m_sRumble[i]->Add(m_RumbleStrength[i], 0, (wxUP | wxDOWN), 2);
|
2009-12-06 01:15:13 +00:00
|
|
|
|
|
|
|
m_gJoyPad[i] = new wxStaticBoxSizer (wxHORIZONTAL, m_Controller[i], wxT("Gamepad"));
|
|
|
|
m_gJoyPad[i]->AddStretchSpacer();
|
2009-12-09 14:52:30 +00:00
|
|
|
m_gJoyPad[i]->Add(m_sJoyname[i], 0, wxEXPAND | (wxLEFT | wxRIGHT | wxDOWN), 5);
|
|
|
|
m_gJoyPad[i]->Add(m_sRumble[i], 0, wxEXPAND | (wxLEFT | wxRIGHT | wxDOWN), 5);
|
2009-12-06 01:15:13 +00:00
|
|
|
m_gJoyPad[i]->AddStretchSpacer();
|
2009-02-04 13:35:28 +00:00
|
|
|
|
2009-02-06 06:15:59 +00:00
|
|
|
// Tilt Wiimote
|
2009-12-17 14:15:56 +00:00
|
|
|
m_tTiltTypeWM[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Wiimote"));
|
|
|
|
m_tTiltTypeNC[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Nunchuck"));
|
|
|
|
|
2010-02-22 01:08:42 +00:00
|
|
|
m_TiltTypeWM[i] = new wxChoice(m_Controller[i], IDC_TILT_TYPE_WM, wxDefaultPosition, wxSize(70, -1), StrTilt, 0, wxDefaultValidator, StrTilt[0]);
|
2009-12-17 14:15:56 +00:00
|
|
|
m_TiltTypeWM[i]->SetToolTip(wxT("Control Wiimote tilting by keyboard or stick or trigger"));
|
|
|
|
|
2010-02-22 01:08:42 +00:00
|
|
|
m_TiltTypeNC[i] = new wxChoice(m_Controller[i], IDC_TILT_TYPE_NC, wxDefaultPosition, wxSize(70, -1), StrTilt, 0, wxDefaultValidator, StrTilt[0]);
|
2009-12-17 14:15:56 +00:00
|
|
|
m_TiltTypeNC[i]->SetToolTip(wxT("Control Nunchuck tilting by keyboard or stick or trigger"));
|
2009-07-09 03:58:53 +00:00
|
|
|
|
2009-12-17 14:15:56 +00:00
|
|
|
m_TiltTextRoll[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Roll Left/Right"));
|
|
|
|
m_TiltTextPitch[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Pitch Up/Down"));
|
2009-02-06 06:15:59 +00:00
|
|
|
|
2010-02-22 01:08:42 +00:00
|
|
|
m_TiltComboRangeRoll[i] = new wxChoice(m_Controller[i], IDC_TILT_ROLL, wxDefaultPosition, wxSize(50, -1), StrTiltRangeRoll, 0, wxDefaultValidator, StrTiltRangeRoll[0]);
|
2009-12-14 02:23:14 +00:00
|
|
|
m_TiltComboRangeRoll[i]->SetToolTip(wxT("The maximum Left/Righ Roll in degrees"));
|
2010-02-22 01:08:42 +00:00
|
|
|
m_TiltComboRangePitch[i] = new wxChoice(m_Controller[i], IDC_TILT_PITCH, wxDefaultPosition, wxSize(50, -1), StrTiltRangePitch, 0, wxDefaultValidator, StrTiltRangePitch[0]);
|
2009-12-14 02:23:14 +00:00
|
|
|
m_TiltComboRangePitch[i]->SetToolTip(wxT("The maximum Up/Down Pitch in degrees"));
|
|
|
|
m_TiltRollSwing[i] = new wxCheckBox(m_Controller[i], IDC_TILT_ROLL_SWING, wxT("Swing"));
|
2009-12-17 14:15:56 +00:00
|
|
|
m_TiltRollSwing[i]->SetToolTip(wxT("Emulate Swing Left/Right instead of Roll Left/Right"));
|
2009-12-14 02:23:14 +00:00
|
|
|
m_TiltPitchSwing[i] = new wxCheckBox(m_Controller[i], IDC_TILT_PITCH_SWING, wxT("Swing"));
|
2009-12-17 14:15:56 +00:00
|
|
|
m_TiltPitchSwing[i]->SetToolTip(wxT("Emulate Swing Up/Down instead of Pitch Up/Down"));
|
2009-12-14 02:23:14 +00:00
|
|
|
m_TiltRollInvert[i] = new wxCheckBox(m_Controller[i], IDC_TILT_ROLL_INVERT, wxT("Invert"));
|
2009-12-17 14:15:56 +00:00
|
|
|
m_TiltRollInvert[i]->SetToolTip(wxT("Invert Left/Right direction (only effective for stick and trigger)"));
|
2009-12-14 02:23:14 +00:00
|
|
|
m_TiltPitchInvert[i] = new wxCheckBox(m_Controller[i], IDC_TILT_PITCH_INVERT, wxT("Invert"));
|
2009-12-17 14:15:56 +00:00
|
|
|
m_TiltPitchInvert[i]->SetToolTip(wxT("Invert Up/Down direction (only effective for stick and trigger)"));
|
2009-02-12 08:46:48 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// Sizers
|
2009-12-17 14:15:56 +00:00
|
|
|
m_sTiltType[i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_sTiltType[i]->Add(m_tTiltTypeWM[i], 0, wxEXPAND | (wxUP | wxDOWN | wxRIGHT), 4);
|
|
|
|
m_sTiltType[i]->Add(m_TiltTypeWM[i], 0, wxEXPAND | (wxDOWN | wxRIGHT), 4);
|
|
|
|
m_sTiltType[i]->Add(m_tTiltTypeNC[i], 0, wxEXPAND | (wxUP | wxDOWN | wxLEFT), 4);
|
|
|
|
m_sTiltType[i]->Add(m_TiltTypeNC[i], 0, wxEXPAND | (wxDOWN | wxLEFT), 4);
|
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sGridTilt[i] = new wxGridBagSizer(0, 0);
|
2009-12-17 14:15:56 +00:00
|
|
|
m_sGridTilt[i]->Add(m_TiltTextRoll[i], wxGBPosition(0, 0), wxGBSpan(1, 1), (wxUP | wxRIGHT), 4);
|
2009-12-14 02:23:14 +00:00
|
|
|
m_sGridTilt[i]->Add(m_TiltComboRangeRoll[i], wxGBPosition(0, 1), wxGBSpan(1, 1), (wxLEFT | wxRIGHT), 4);
|
2009-12-17 14:15:56 +00:00
|
|
|
m_sGridTilt[i]->Add(m_TiltRollSwing[i], wxGBPosition(0, 2), wxGBSpan(1, 1), (wxUP | wxLEFT | wxRIGHT), 4);
|
|
|
|
m_sGridTilt[i]->Add(m_TiltRollInvert[i], wxGBPosition(0, 3), wxGBSpan(1, 1), (wxUP | wxLEFT), 4);
|
|
|
|
m_sGridTilt[i]->Add(m_TiltTextPitch[i], wxGBPosition(1, 0), wxGBSpan(1, 1), (wxUP | wxRIGHT), 4);
|
|
|
|
m_sGridTilt[i]->Add(m_TiltComboRangePitch[i], wxGBPosition(1, 1), wxGBSpan(1, 1), (wxLEFT | wxRIGHT), 4);
|
|
|
|
m_sGridTilt[i]->Add(m_TiltPitchSwing[i], wxGBPosition(1, 2), wxGBSpan(1, 1), (wxUP | wxLEFT | wxRIGHT), 4);
|
|
|
|
m_sGridTilt[i]->Add(m_TiltPitchInvert[i], wxGBPosition(1, 3), wxGBSpan(1, 1), (wxUP | wxLEFT), 4);
|
2009-02-12 08:46:48 +00:00
|
|
|
|
2009-12-06 18:26:20 +00:00
|
|
|
m_gTilt[i] = new wxStaticBoxSizer (wxVERTICAL, m_Controller[i], wxT("Tilt and Swing"));
|
2009-02-09 13:10:29 +00:00
|
|
|
m_gTilt[i]->AddStretchSpacer();
|
2009-12-17 14:15:56 +00:00
|
|
|
m_gTilt[i]->Add(m_sTiltType[i], 0, wxEXPAND | (wxLEFT | wxDOWN), 5);
|
2009-12-14 02:23:14 +00:00
|
|
|
m_gTilt[i]->Add(m_sGridTilt[i], 0, wxEXPAND | (wxLEFT), 5);
|
2009-02-09 13:10:29 +00:00
|
|
|
m_gTilt[i]->AddStretchSpacer();
|
2009-02-06 06:15:59 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// Row 1 Sizers: Connected pads, tilt
|
|
|
|
m_sHorizController[i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_sHorizController[i]->Add(m_gJoyPad[i], 0, wxEXPAND | (wxLEFT), 5);
|
|
|
|
m_sHorizController[i]->Add(m_gTilt[i], 0, wxEXPAND | (wxLEFT), 5);
|
2009-02-10 17:25:08 +00:00
|
|
|
|
2009-02-06 06:15:59 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// Stick Status Panels
|
2009-12-27 19:31:02 +00:00
|
|
|
m_tStatusLeftIn[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Not connected"));
|
|
|
|
m_tStatusLeftOut[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Not connected"));
|
|
|
|
m_tStatusRightIn[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Not connected"));
|
|
|
|
m_tStatusRightOut[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Not connected"));
|
2009-02-09 13:10:29 +00:00
|
|
|
|
|
|
|
m_pLeftInStatus[i] = new wxPanel(m_Controller[i], wxID_ANY, wxDefaultPosition, wxDefaultSize);
|
|
|
|
m_bmpSquareLeftIn[i] = new wxStaticBitmap(m_pLeftInStatus[i], wxID_ANY, CreateBitmap(), wxDefaultPosition, wxDefaultSize);
|
2009-02-14 01:15:35 +00:00
|
|
|
m_bmpDeadZoneLeftIn[i] = new wxStaticBitmap(m_pLeftInStatus[i], wxID_ANY, CreateBitmapDeadZone(0), wxDefaultPosition, wxDefaultSize);
|
2009-02-09 13:10:29 +00:00
|
|
|
m_bmpDotLeftIn[i] = new wxStaticBitmap(m_pLeftInStatus[i], wxID_ANY, CreateBitmapDot(), wxPoint(BoxW / 2, BoxH / 2), wxDefaultSize);
|
2009-02-04 13:35:28 +00:00
|
|
|
|
2009-02-09 13:10:29 +00:00
|
|
|
m_pLeftOutStatus[i] = new wxPanel(m_Controller[i], wxID_ANY, wxDefaultPosition, wxDefaultSize);
|
|
|
|
m_bmpSquareLeftOut[i] = new wxStaticBitmap(m_pLeftOutStatus[i], wxID_ANY, CreateBitmap(), wxDefaultPosition, wxDefaultSize);
|
|
|
|
m_bmpDotLeftOut[i] = new wxStaticBitmap(m_pLeftOutStatus[i], wxID_ANY, CreateBitmapDot(), wxPoint(BoxW / 2, BoxH / 2), wxDefaultSize);
|
2009-02-06 06:15:59 +00:00
|
|
|
|
2009-02-09 13:10:29 +00:00
|
|
|
m_pRightInStatus[i] = new wxPanel(m_Controller[i], wxID_ANY, wxDefaultPosition, wxDefaultSize);
|
|
|
|
m_bmpSquareRightIn[i] = new wxStaticBitmap(m_pRightInStatus[i], wxID_ANY, CreateBitmap(), wxDefaultPosition, wxDefaultSize);
|
2009-02-14 13:03:21 +00:00
|
|
|
m_bmpDeadZoneRightIn[i] = new wxStaticBitmap(m_pRightInStatus[i], wxID_ANY, CreateBitmapDeadZone(0), wxDefaultPosition, wxDefaultSize);
|
2009-02-09 13:10:29 +00:00
|
|
|
m_bmpDotRightIn[i] = new wxStaticBitmap(m_pRightInStatus[i], wxID_ANY, CreateBitmapDot(), wxPoint(BoxW / 2, BoxH / 2), wxDefaultSize);
|
2009-02-06 06:15:59 +00:00
|
|
|
|
2009-02-09 13:10:29 +00:00
|
|
|
m_pRightOutStatus[i] = new wxPanel(m_Controller[i], wxID_ANY, wxDefaultPosition, wxDefaultSize);
|
|
|
|
m_bmpSquareRightOut[i] = new wxStaticBitmap(m_pRightOutStatus[i], wxID_ANY, CreateBitmap(), wxDefaultPosition, wxDefaultSize);
|
|
|
|
m_bmpDotRightOut[i] = new wxStaticBitmap(m_pRightOutStatus[i], wxID_ANY, CreateBitmapDot(), wxPoint(BoxW / 2, BoxH / 2), wxDefaultSize);
|
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// Sizers
|
|
|
|
m_sGridStickLeft[i] = new wxGridBagSizer(0, 0);
|
|
|
|
m_sGridStickLeft[i]->Add(m_pLeftInStatus[i], wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 0);
|
|
|
|
m_sGridStickLeft[i]->Add(m_pLeftOutStatus[i], wxGBPosition(0, 1), wxGBSpan(1, 1), wxLEFT, 10);
|
|
|
|
m_sGridStickLeft[i]->Add(m_tStatusLeftIn[i], wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 0);
|
|
|
|
m_sGridStickLeft[i]->Add(m_tStatusLeftOut[i], wxGBPosition(1, 1), wxGBSpan(1, 1), wxLEFT, 10);
|
|
|
|
|
|
|
|
m_sGridStickRight[i] = new wxGridBagSizer(0, 0);
|
|
|
|
m_sGridStickRight[i]->Add(m_pRightInStatus[i], wxGBPosition(0, 0), wxGBSpan(1, 1), wxALL, 0);
|
|
|
|
m_sGridStickRight[i]->Add(m_pRightOutStatus[i], wxGBPosition(0, 1), wxGBSpan(1, 1), wxLEFT, 10);
|
|
|
|
m_sGridStickRight[i]->Add(m_tStatusRightIn[i], wxGBPosition(1, 0), wxGBSpan(1, 1), wxALL, 0);
|
|
|
|
m_sGridStickRight[i]->Add(m_tStatusRightOut[i], wxGBPosition(1, 1), wxGBSpan(1, 1), wxLEFT, 10);
|
|
|
|
|
|
|
|
m_gStickLeft[i] = new wxStaticBoxSizer (wxHORIZONTAL, m_Controller[i], wxT("Analog 1 Status (In) (Out)"));
|
|
|
|
m_gStickLeft[i]->Add(m_sGridStickLeft[i], 0, (wxLEFT | wxRIGHT), 5);
|
|
|
|
|
|
|
|
m_gStickRight[i] = new wxStaticBoxSizer (wxHORIZONTAL, m_Controller[i], wxT("Analog 2 Status (In) (Out)"));
|
|
|
|
m_gStickRight[i]->Add(m_sGridStickRight[i], 0, (wxLEFT | wxRIGHT), 5);
|
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
// Trigger Status Panels
|
2009-12-09 14:52:30 +00:00
|
|
|
m_TriggerL[i]= new wxStaticText(m_Controller[i], wxID_ANY, wxT("Left: "));
|
|
|
|
m_TriggerR[i]= new wxStaticText(m_Controller[i], wxID_ANY, wxT("Right: "));
|
|
|
|
m_TriggerStatusL[i]= new wxStaticText(m_Controller[i], wxID_ANY, wxT("000"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
|
|
|
|
m_TriggerStatusR[i]= new wxStaticText(m_Controller[i], wxID_ANY, wxT("000"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
|
2009-12-27 19:31:02 +00:00
|
|
|
m_tTriggerSource[i]= new wxStaticText(m_Controller[i], wxID_ANY, wxT("Trigger Source"));
|
2010-02-22 01:08:42 +00:00
|
|
|
m_TriggerType[i] = new wxChoice(m_Controller[i], IDC_TRIGGER_TYPE, wxDefaultPosition, wxSize(70, -1), StrTriggerType, 0, wxDefaultValidator, StrTriggerType[0]);
|
2009-02-04 13:35:28 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// Sizers
|
|
|
|
m_sGridTrigger[i] = new wxGridBagSizer(0, 0);
|
|
|
|
m_sGridTrigger[i]->Add(m_TriggerL[i], wxGBPosition(0, 0), wxGBSpan(1, 1), (wxTOP), 4);
|
|
|
|
m_sGridTrigger[i]->Add(m_TriggerStatusL[i], wxGBPosition(0, 1), wxGBSpan(1, 1), (wxLEFT | wxTOP), 4);
|
|
|
|
m_sGridTrigger[i]->Add(m_TriggerR[i], wxGBPosition(1, 0), wxGBSpan(1, 1), (wxTOP), 4);
|
|
|
|
m_sGridTrigger[i]->Add(m_TriggerStatusR[i], wxGBPosition(1, 1), wxGBSpan(1, 1), (wxLEFT | wxTOP), 4);
|
|
|
|
|
|
|
|
m_gTriggers[i] = new wxStaticBoxSizer (wxVERTICAL, m_Controller[i], wxT("Triggers Status"));
|
|
|
|
m_gTriggers[i]->AddStretchSpacer();
|
|
|
|
m_gTriggers[i]->Add(m_sGridTrigger[i], 0, wxEXPAND | (wxLEFT | wxRIGHT), 5);
|
|
|
|
m_gTriggers[i]->Add(m_tTriggerSource[i], 0, wxEXPAND | (wxUP | wxLEFT | wxRIGHT), 5);
|
|
|
|
m_gTriggers[i]->Add(m_TriggerType[i], 0, wxEXPAND | (wxUP | wxLEFT | wxRIGHT), 5);
|
|
|
|
m_gTriggers[i]->AddStretchSpacer();
|
|
|
|
|
|
|
|
// Row 2 Sizers: Analog status
|
|
|
|
m_sHorizStatus[i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_sHorizStatus[i]->Add(m_gStickLeft[i], 0, wxEXPAND | (wxLEFT), 5);
|
|
|
|
m_sHorizStatus[i]->Add(m_gStickRight[i], 0, wxEXPAND | (wxLEFT), 5);
|
|
|
|
m_sHorizStatus[i]->Add(m_gTriggers[i], 0, wxEXPAND | (wxLEFT), 5);
|
|
|
|
|
|
|
|
|
|
|
|
// Analog Axes and Triggers Mapping
|
|
|
|
m_sAnalogLeft[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_sAnalogMiddle[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_sAnalogRight[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
for (int x = 0; x < 6; x++)
|
2009-12-09 14:52:30 +00:00
|
|
|
{
|
|
|
|
m_statictext_Analog[x][i] = new wxStaticText(m_Controller[i], wxID_ANY, anText[x]);
|
|
|
|
m_Button_Analog[x][i] = new wxButton(m_Controller[i], x + IDB_ANALOG_LEFT_X, wxEmptyString, wxDefaultPosition, wxSize(BtW, BtH));
|
|
|
|
m_Button_Analog[x][i]->SetFont(m_SmallFont);
|
|
|
|
m_Sizer_Analog[x][i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_Sizer_Analog[x][i]->Add(m_statictext_Analog[x][i], 0, (wxUP), 4);
|
|
|
|
m_Sizer_Analog[x][i]->Add(m_Button_Analog[x][i], 0, (wxLEFT), 2);
|
|
|
|
if (x < 2) // Make some balance
|
|
|
|
m_sAnalogLeft[i]->Add(m_Sizer_Analog[x][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
else if (x < 4)
|
|
|
|
m_sAnalogMiddle[i]->Add(m_Sizer_Analog[x][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
else
|
|
|
|
m_sAnalogRight[i]->Add(m_Sizer_Analog[x][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
}
|
2009-02-04 13:35:28 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
m_gAnalog[i] = new wxStaticBoxSizer (wxHORIZONTAL, m_Controller[i], wxT("Analog Axes and Triggers"));
|
|
|
|
m_gAnalog[i]->Add(m_sAnalogLeft[i], 0, wxALIGN_RIGHT | (wxALL), 0);
|
|
|
|
m_gAnalog[i]->Add(m_sAnalogMiddle[i], 0, wxALIGN_RIGHT | (wxLEFT), 5);
|
|
|
|
m_gAnalog[i]->Add(m_sAnalogRight[i], 0, wxALIGN_RIGHT | (wxLEFT), 5);
|
|
|
|
m_gAnalog[i]->AddSpacer(1);
|
2009-02-04 13:35:28 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// Row 3 Sizes: Analog Mapping
|
|
|
|
m_sHorizAnalogMapping[i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_sHorizAnalogMapping[i]->Add(m_gAnalog[i], 0, (wxLEFT), 5);
|
2009-07-09 03:58:53 +00:00
|
|
|
|
2009-07-10 05:30:19 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// Wiimote Mapping
|
|
|
|
m_sWmVertLeft[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_sWmVertRight[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
for (int x = 0; x <= IDB_WM_SHAKE - IDB_WM_A; x++)
|
2009-07-10 05:30:19 +00:00
|
|
|
{
|
2009-12-09 14:52:30 +00:00
|
|
|
m_statictext_Wiimote[x][i] = new wxStaticText(m_Controller[i], wxID_ANY, wmText[x]);
|
2009-07-10 05:30:19 +00:00
|
|
|
m_Button_Wiimote[x][i] = new wxButton(m_Controller[i], x + IDB_WM_A, wxEmptyString, wxDefaultPosition, wxSize(BtW, BtH));
|
|
|
|
m_Button_Wiimote[x][i]->SetFont(m_SmallFont);
|
|
|
|
m_Sizer_Wiimote[x][i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_Sizer_Wiimote[x][i]->Add(m_statictext_Wiimote[x][i], 0, (wxUP), 4);
|
|
|
|
m_Sizer_Wiimote[x][i]->Add(m_Button_Wiimote[x][i], 0, (wxLEFT), 2);
|
2009-12-27 19:31:02 +00:00
|
|
|
if (x < 7 || x == IDB_WM_SHAKE - IDB_WM_A) // Make some balance
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sWmVertLeft[i]->Add(m_Sizer_Wiimote[x][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
2009-07-10 05:30:19 +00:00
|
|
|
else
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sWmVertRight[i]->Add(m_Sizer_Wiimote[x][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
2009-07-10 05:30:19 +00:00
|
|
|
}
|
2009-02-15 18:44:29 +00:00
|
|
|
|
|
|
|
m_gWiimote[i] = new wxStaticBoxSizer (wxHORIZONTAL, m_Controller[i], wxT("Wiimote"));
|
2009-12-17 14:15:56 +00:00
|
|
|
m_gWiimote[i]->Add(m_sWmVertLeft[i], 0, (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
m_gWiimote[i]->Add(m_sWmVertRight[i], 0, (wxLEFT | wxRIGHT | wxDOWN), 1);
|
2009-02-05 00:02:54 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// Extension Mapping
|
2009-12-27 19:31:02 +00:00
|
|
|
if(WiiMoteEmu::WiiMapping[i].iExtensionConnected == WiiMoteEmu::EXT_NUNCHUCK)
|
2009-07-09 04:19:49 +00:00
|
|
|
{
|
|
|
|
// Stick controls
|
|
|
|
m_NunchuckTextStick[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Stick"));
|
2010-02-22 01:08:42 +00:00
|
|
|
m_NunchuckComboStick[i] = new wxChoice(m_Controller[i], IDC_NUNCHUCK_STICK, wxDefaultPosition, wxSize(70, -1), StrNunchuck, 0, wxDefaultValidator, StrNunchuck[0]);
|
2009-07-10 05:30:19 +00:00
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
for (int x = 0; x <= IDB_NC_SHAKE - IDB_NC_Z; x++)
|
2009-07-10 05:30:19 +00:00
|
|
|
{
|
2009-12-09 14:52:30 +00:00
|
|
|
m_statictext_NunChuck[x][i] = new wxStaticText(m_Controller[i], wxID_ANY, ncText[x]);
|
2009-07-10 05:30:19 +00:00
|
|
|
m_Button_NunChuck[x][i] = new wxButton(m_Controller[i], x + IDB_NC_Z, wxEmptyString, wxDefaultPosition, wxSize(BtW, BtH));
|
|
|
|
m_Button_NunChuck[x][i]->SetFont(m_SmallFont);
|
|
|
|
m_Sizer_NunChuck[x][i] = new wxBoxSizer(wxHORIZONTAL);
|
2009-12-17 14:15:56 +00:00
|
|
|
m_Sizer_NunChuck[x][i]->Add(m_statictext_NunChuck[x][i], 0, (wxUP), 4);
|
|
|
|
m_Sizer_NunChuck[x][i]->Add(m_Button_NunChuck[x][i], 0, (wxLEFT), 2);
|
2009-07-10 05:30:19 +00:00
|
|
|
}
|
2009-12-17 14:15:56 +00:00
|
|
|
|
|
|
|
// Sizers
|
|
|
|
m_sNunchuckStick[i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_sNunchuckStick[i]->Add(m_NunchuckTextStick[i], 0, (wxUP), 4);
|
|
|
|
m_sNunchuckStick[i]->Add(m_NunchuckComboStick[i], 0, (wxLEFT), 2);
|
|
|
|
|
|
|
|
m_sNCVertLeft[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_sNCVertRight[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_sNCVertRight[i]->Add(m_sNunchuckStick[i], 0, wxALIGN_RIGHT | (wxALL), 2);
|
|
|
|
m_sNCVertRight[i]->AddSpacer(2);
|
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
for (int x = IDB_NC_Z ; x <= IDB_NC_SHAKE; x++)
|
2009-12-17 14:15:56 +00:00
|
|
|
if (x < IDB_NC_ROLL_L) // Make some balance
|
|
|
|
m_sNCVertLeft[i]->Add(m_Sizer_NunChuck[x - IDB_NC_Z][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
else
|
|
|
|
m_sNCVertRight[i]->Add(m_Sizer_NunChuck[x - IDB_NC_Z][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
|
|
|
|
m_gNunchuck[i] = new wxStaticBoxSizer (wxHORIZONTAL, m_Controller[i], wxT("Nunchuck"));
|
|
|
|
m_gNunchuck[i]->Add(m_sNCVertLeft[i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
m_gNunchuck[i]->Add(m_sNCVertRight[i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
|
2009-07-09 04:19:49 +00:00
|
|
|
}
|
2009-12-27 19:31:02 +00:00
|
|
|
else if(WiiMoteEmu::WiiMapping[i].iExtensionConnected == WiiMoteEmu::EXT_CLASSIC_CONTROLLER)
|
2009-07-10 05:30:19 +00:00
|
|
|
{
|
2009-07-09 04:19:49 +00:00
|
|
|
// Stick controls
|
|
|
|
m_CcTextLeftStick[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Left stick"));
|
2010-02-22 01:08:42 +00:00
|
|
|
m_CcComboLeftStick[i] = new wxChoice(m_Controller[i], IDC_CC_LEFT_STICK, wxDefaultPosition, wxSize(70, -1), StrNunchuck, 0, wxDefaultValidator, StrNunchuck[0]);
|
2009-07-09 04:19:49 +00:00
|
|
|
m_CcTextRightStick[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Right stick"));
|
2010-02-22 01:08:42 +00:00
|
|
|
m_CcComboRightStick[i] = new wxChoice(m_Controller[i], IDC_CC_RIGHT_STICK, wxDefaultPosition, wxSize(70, -1), StrNunchuck, 0, wxDefaultValidator, StrNunchuck[0]);
|
2009-07-09 04:19:49 +00:00
|
|
|
m_CcTextTriggers[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Triggers"));
|
2010-02-22 01:08:42 +00:00
|
|
|
m_CcComboTriggers[i] = new wxChoice(m_Controller[i], IDC_CC_TRIGGERS, wxDefaultPosition, wxSize(70, -1), StrCcTriggers, 0, wxDefaultValidator, StrCcTriggers[0]);
|
2009-07-09 04:19:49 +00:00
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
for (int x = 0; x <= IDB_CC_RD - IDB_CC_A; x++)
|
2009-07-10 05:30:19 +00:00
|
|
|
{
|
|
|
|
m_statictext_Classic[x][i] = new wxStaticText(m_Controller[i], wxID_ANY, classicText[x]);
|
|
|
|
m_Button_Classic[x][i] = new wxButton(m_Controller[i], x + IDB_CC_A, wxEmptyString, wxDefaultPosition, wxSize(BtW, BtH));
|
|
|
|
m_Button_Classic[x][i]->SetFont(m_SmallFont);
|
|
|
|
m_Sizer_Classic[x][i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_Sizer_Classic[x][i]->Add(m_statictext_Classic[x][i], 0, wxALIGN_RIGHT | (wxUP), 4);
|
|
|
|
m_Sizer_Classic[x][i]->Add(m_Button_Classic[x][i], 0, wxALIGN_RIGHT | (wxLEFT), 2);
|
|
|
|
}
|
2009-07-09 04:19:49 +00:00
|
|
|
|
|
|
|
// Sizers
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sCcLeftStick[i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_sCcLeftStick[i]->Add(m_CcTextLeftStick[i], 0, (wxUP), 4);
|
|
|
|
m_sCcLeftStick[i]->Add(m_CcComboLeftStick[i], 0, (wxLEFT), 2);
|
2009-07-09 04:19:49 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sCcRightStick[i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_sCcRightStick[i]->Add(m_CcTextRightStick[i], 0, (wxUP), 4);
|
|
|
|
m_sCcRightStick[i]->Add(m_CcComboRightStick[i], 0, (wxLEFT), 2);
|
|
|
|
|
|
|
|
m_sCcTriggers[i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_sCcTriggers[i]->Add(m_CcTextTriggers[i], 0, (wxUP), 4);
|
|
|
|
m_sCcTriggers[i]->Add(m_CcComboTriggers[i], 0, (wxLEFT), 2);
|
|
|
|
|
|
|
|
m_sCcVertLeft[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_sCcVertLeft[i]->Add(m_sCcLeftStick[i], 0, wxALIGN_RIGHT | (wxALL), 2);
|
|
|
|
m_sCcVertLeft[i]->AddSpacer(2);
|
|
|
|
for (int x = IDB_CC_LL; x <= IDB_CC_LD; x++)
|
|
|
|
m_sCcVertLeft[i]->Add(m_Sizer_Classic[x - IDB_CC_A][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
for (int x = IDB_CC_DL; x <= IDB_CC_DD; x++)
|
|
|
|
m_sCcVertLeft[i]->Add(m_Sizer_Classic[x - IDB_CC_A][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
|
|
|
|
m_sCcVertMiddle[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_sCcVertMiddle[i]->Add(m_sCcRightStick[i], 0, wxALIGN_RIGHT | (wxALL), 2);
|
|
|
|
m_sCcVertMiddle[i]->AddSpacer(2);
|
|
|
|
for (int x = IDB_CC_RL; x <= IDB_CC_RD; x++)
|
|
|
|
m_sCcVertMiddle[i]->Add(m_Sizer_Classic[x - IDB_CC_A][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
for (int x = IDB_CC_A; x <= IDB_CC_Y; x++)
|
|
|
|
m_sCcVertMiddle[i]->Add(m_Sizer_Classic[x - IDB_CC_A][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
|
|
|
|
m_sCcVertRight[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_sCcVertRight[i]->Add(m_sCcTriggers[i], 0, wxALIGN_RIGHT | (wxALL), 2);
|
|
|
|
m_sCcVertRight[i]->AddSpacer(2);
|
|
|
|
for (int x = IDB_CC_TL; x <= IDB_CC_ZR; x++)
|
|
|
|
m_sCcVertRight[i]->Add(m_Sizer_Classic[x - IDB_CC_A][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
for (int x = IDB_CC_P; x <= IDB_CC_H; x++)
|
|
|
|
m_sCcVertRight[i]->Add(m_Sizer_Classic[x - IDB_CC_A][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
2009-07-09 04:19:49 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
m_gClassicController[i] = new wxStaticBoxSizer (wxHORIZONTAL, m_Controller[i], wxT("Classic Controller"));
|
|
|
|
m_gClassicController[i]->Add(m_sCcVertLeft[i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
m_gClassicController[i]->Add(m_sCcVertMiddle[i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
m_gClassicController[i]->Add(m_sCcVertRight[i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
2009-07-09 04:19:49 +00:00
|
|
|
}
|
2009-12-27 19:31:02 +00:00
|
|
|
else if(WiiMoteEmu::WiiMapping[i].iExtensionConnected == WiiMoteEmu::EXT_GUITARHERO)
|
2009-12-09 14:52:30 +00:00
|
|
|
{
|
2009-07-09 04:19:49 +00:00
|
|
|
// Stick controls
|
2009-12-17 14:15:56 +00:00
|
|
|
m_tGH3Analog[i] = new wxStaticText(m_Controller[i], wxID_ANY, wxT("Stick"));
|
2010-02-22 01:08:42 +00:00
|
|
|
m_GH3ComboAnalog[i] = new wxChoice(m_Controller[i], IDC_GH3_ANALOG, wxDefaultPosition, wxSize(70, -1), StrAnalogArray, 0, wxDefaultValidator, StrAnalogArray[0]);
|
2009-02-15 02:01:43 +00:00
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
for (int x = 0; x <= IDB_GH3_STRUM_DOWN - IDB_GH3_GREEN; x++)
|
2009-07-09 04:19:49 +00:00
|
|
|
{
|
|
|
|
m_statictext_GH3[x][i] = new wxStaticText(m_Controller[i], wxID_ANY, gh3Text[x]);
|
2009-12-09 14:52:30 +00:00
|
|
|
m_Button_GH3[x][i] = new wxButton(m_Controller[i], x, wxEmptyString, wxDefaultPosition, wxSize(BtW, BtH));
|
|
|
|
m_Sizer_GH3[x][i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_Sizer_GH3[x][i]->Add(m_statictext_GH3[x][i], 0, (wxUP), 4);
|
|
|
|
m_Sizer_GH3[x][i]->Add(m_Button_GH3[x][i], 0, (wxLEFT), 2);
|
2009-07-09 04:19:49 +00:00
|
|
|
}
|
2009-02-15 02:01:43 +00:00
|
|
|
|
2009-07-09 04:19:49 +00:00
|
|
|
// Sizers
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sGH3Analog[i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_sGH3Analog[i]->Add(m_tGH3Analog[i], 0, (wxUP), 4);
|
|
|
|
m_sGH3Analog[i]->Add(m_GH3ComboAnalog[i], 0, (wxLEFT), 2);
|
2009-07-09 03:58:53 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sGH3VertLeft[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_sGH3VertLeft[i]->Add(m_sGH3Analog[i], 0, wxALIGN_RIGHT | (wxALL), 2);
|
|
|
|
m_sGH3VertLeft[i]->AddSpacer(2);
|
|
|
|
for (int x = IDB_GH3_ANALOG_LEFT; x <= IDB_GH3_STRUM_DOWN; x++)
|
|
|
|
m_sGH3VertLeft[i]->Add(m_Sizer_GH3[x - IDB_GH3_GREEN][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
2009-07-09 03:58:53 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sGH3VertRight[i] = new wxBoxSizer(wxVERTICAL);
|
|
|
|
for (int x = IDB_GH3_GREEN; x <= IDB_GH3_WHAMMY; x++)
|
|
|
|
m_sGH3VertRight[i]->Add(m_Sizer_GH3[x - IDB_GH3_GREEN][i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
2009-07-09 03:58:53 +00:00
|
|
|
|
2009-07-09 04:19:49 +00:00
|
|
|
m_gGuitarHero3Controller[i] = new wxStaticBoxSizer (wxHORIZONTAL, m_Controller[i], wxT("Guitar Hero 3 Controller"));
|
2009-12-09 14:52:30 +00:00
|
|
|
m_gGuitarHero3Controller[i]->Add(m_sGH3VertLeft[i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
|
|
|
m_gGuitarHero3Controller[i]->Add(m_sGH3VertRight[i], 0, wxALIGN_RIGHT | (wxLEFT | wxRIGHT | wxDOWN), 1);
|
2009-07-09 04:19:49 +00:00
|
|
|
}
|
2009-07-09 03:58:53 +00:00
|
|
|
|
2009-12-09 14:52:30 +00:00
|
|
|
// Row 4 Sizers: Wiimote and Extension Mapping
|
|
|
|
m_sHorizControllerMapping[i] = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
m_sHorizControllerMapping[i]->Add(m_gWiimote[i], 0, (wxLEFT), 5);
|
2009-12-27 19:31:02 +00:00
|
|
|
switch(WiiMoteEmu::WiiMapping[i].iExtensionConnected)
|
2009-07-09 04:19:49 +00:00
|
|
|
{
|
2009-12-27 19:31:02 +00:00
|
|
|
case WiiMoteEmu::EXT_NUNCHUCK:
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sHorizControllerMapping[i]->Add(m_gNunchuck[i], 0, (wxLEFT), 5);
|
2009-07-09 04:19:49 +00:00
|
|
|
break;
|
2009-12-27 19:31:02 +00:00
|
|
|
case WiiMoteEmu::EXT_CLASSIC_CONTROLLER:
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sHorizControllerMapping[i]->Add(m_gClassicController[i], 0, (wxLEFT), 5);
|
2009-07-09 04:19:49 +00:00
|
|
|
break;
|
2009-12-27 19:31:02 +00:00
|
|
|
case WiiMoteEmu::EXT_GUITARHERO:
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sHorizControllerMapping[i]->Add(m_gGuitarHero3Controller[i], 0, (wxLEFT), 5);
|
2009-07-09 04:19:49 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2009-02-05 00:02:54 +00:00
|
|
|
|
2009-02-04 13:35:28 +00:00
|
|
|
// Set up sizers and layout
|
2009-12-09 14:52:30 +00:00
|
|
|
// The sizer m_sMain will be expanded inside m_Controller
|
2009-02-04 13:35:28 +00:00
|
|
|
m_sMain[i] = new wxBoxSizer(wxVERTICAL);
|
2009-12-09 14:52:30 +00:00
|
|
|
m_sMain[i]->Add(m_sHorizController[i], 0, wxEXPAND | (wxLEFT | wxRIGHT | wxDOWN), 5);
|
|
|
|
m_sMain[i]->Add(m_sHorizStatus[i], 0, wxEXPAND | (wxLEFT | wxRIGHT | wxDOWN), 5);
|
|
|
|
m_sMain[i]->Add(m_sHorizAnalogMapping[i], 0, wxEXPAND | (wxLEFT | wxRIGHT | wxDOWN), 5);
|
|
|
|
m_sMain[i]->Add(m_sHorizControllerMapping[i], 0, wxEXPAND | (wxLEFT | wxRIGHT | wxDOWN), 5);
|
2009-02-04 13:35:28 +00:00
|
|
|
|
2009-02-06 06:15:59 +00:00
|
|
|
// Set the main sizer
|
|
|
|
m_Controller[i]->SetSizer(m_sMain[i]);
|
2009-01-26 14:13:27 +00:00
|
|
|
}
|
|
|
|
|
2009-12-14 03:30:21 +00:00
|
|
|
// m_Apply = new wxButton(this, ID_APPLY, wxT("Apply"));
|
2009-02-04 13:35:28 +00:00
|
|
|
m_Close = new wxButton(this, ID_CLOSE, wxT("Close"));
|
|
|
|
|
|
|
|
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
|
|
|
|
sButtons->AddStretchSpacer();
|
2009-12-14 03:30:21 +00:00
|
|
|
// sButtons->Add(m_Apply, 0, (wxALL), 0);
|
2009-02-04 13:35:28 +00:00
|
|
|
sButtons->Add(m_Close, 0, (wxLEFT), 5);
|
|
|
|
|
|
|
|
m_MainSizer = new wxBoxSizer(wxVERTICAL);
|
|
|
|
m_MainSizer->Add(m_Notebook, 1, wxEXPAND | wxALL, 5);
|
|
|
|
m_MainSizer->Add(sButtons, 0, wxEXPAND | (wxLEFT | wxRIGHT | wxDOWN), 5);
|
2008-12-08 05:25:12 +00:00
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
SetSizer(m_MainSizer);
|
|
|
|
Layout();
|
2008-12-08 05:25:12 +00:00
|
|
|
Fit();
|
2009-02-06 07:03:09 +00:00
|
|
|
// Center the window if there is room for it
|
|
|
|
#ifdef _WIN32
|
2009-12-11 13:57:25 +00:00
|
|
|
if (GetSystemMetrics(SM_CYFULLSCREEN) > 600)
|
2009-02-06 07:03:09 +00:00
|
|
|
Center();
|
|
|
|
#endif
|
2009-01-28 16:09:08 +00:00
|
|
|
|
2010-01-22 23:19:16 +00:00
|
|
|
m_ControlsCreated = true;
|
2009-12-27 19:31:02 +00:00
|
|
|
}
|
|
|
|
|
2009-07-05 04:29:00 +00:00
|
|
|
void WiimotePadConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-02-10 17:25:08 +00:00
|
|
|
long TmpValue;
|
2009-12-27 19:31:02 +00:00
|
|
|
int id = event.GetId();
|
2009-02-10 17:25:08 +00:00
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
switch (id)
|
2008-12-08 05:25:12 +00:00
|
|
|
{
|
2009-12-09 14:52:30 +00:00
|
|
|
case IDC_JOYNAME:
|
2009-12-27 19:31:02 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].ID = m_Joyname[m_Page]->GetSelection();
|
2010-01-21 06:29:31 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].joy = WiiMoteEmu::joyinfo.at(WiiMoteEmu::WiiMapping[m_Page].ID).joy;
|
2009-12-27 19:31:02 +00:00
|
|
|
break;
|
|
|
|
case IDC_DEAD_ZONE_LEFT:
|
|
|
|
WiiMoteEmu::WiiMapping[m_Page].DeadZoneL = m_ComboDeadZoneLeft[m_Page]->GetSelection();
|
|
|
|
break;
|
|
|
|
case IDC_DEAD_ZONE_RIGHT:
|
|
|
|
WiiMoteEmu::WiiMapping[m_Page].DeadZoneR = m_ComboDeadZoneRight[m_Page]->GetSelection();
|
|
|
|
break;
|
|
|
|
case IDC_STICK_DIAGONAL:
|
2010-01-22 23:19:16 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Diagonal = 100 - m_ComboDiagonal[m_Page]->GetSelection() * 5;
|
2009-12-27 19:31:02 +00:00
|
|
|
break;
|
|
|
|
case IDC_STICK_C2S:
|
|
|
|
WiiMoteEmu::WiiMapping[m_Page].bCircle2Square = m_CheckC2S[m_Page]->IsChecked();
|
|
|
|
break;
|
|
|
|
case IDC_RUMBLE:
|
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Rumble = m_CheckRumble[m_Page]->IsChecked();
|
|
|
|
break;
|
|
|
|
case IDC_RUMBLE_STRENGTH:
|
2010-01-23 13:34:18 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].RumbleStrength = m_RumbleStrength[m_Page]->GetSelection() * 10;
|
2009-02-09 13:10:29 +00:00
|
|
|
break;
|
2009-12-17 14:15:56 +00:00
|
|
|
case IDC_TILT_TYPE_WM:
|
2009-12-27 19:31:02 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Tilt.InputWM = m_TiltTypeWM[m_Page]->GetSelection();
|
2009-12-17 14:15:56 +00:00
|
|
|
break;
|
|
|
|
case IDC_TILT_TYPE_NC:
|
2009-12-27 19:31:02 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Tilt.InputNC = m_TiltTypeNC[m_Page]->GetSelection();
|
2009-02-10 17:25:08 +00:00
|
|
|
break;
|
2009-12-14 02:23:14 +00:00
|
|
|
case IDC_TILT_ROLL:
|
|
|
|
case IDC_TILT_ROLL_SWING:
|
2010-02-22 01:08:42 +00:00
|
|
|
m_TiltComboRangeRoll[m_Page]->GetStringSelection().ToLong(&TmpValue);
|
2009-12-27 19:31:02 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Tilt.RollDegree = TmpValue;
|
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Tilt.RollSwing = m_TiltRollSwing[m_Page]->IsChecked();
|
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Tilt.RollRange = (m_TiltRollSwing[m_Page]->IsChecked()) ? 0 : TmpValue;
|
2009-02-12 08:46:48 +00:00
|
|
|
break;
|
2009-12-14 02:23:14 +00:00
|
|
|
case IDC_TILT_PITCH:
|
|
|
|
case IDC_TILT_PITCH_SWING:
|
2010-02-22 01:08:42 +00:00
|
|
|
m_TiltComboRangePitch[m_Page]->GetStringSelection().ToLong(&TmpValue);
|
2009-12-27 19:31:02 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Tilt.PitchDegree = TmpValue;
|
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Tilt.PitchSwing = m_TiltPitchSwing[m_Page]->IsChecked();
|
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Tilt.PitchRange = (m_TiltPitchSwing[m_Page]->IsChecked()) ? 0 : TmpValue;
|
2009-12-14 02:23:14 +00:00
|
|
|
break;
|
|
|
|
case IDC_TILT_ROLL_INVERT:
|
2009-12-27 19:31:02 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Tilt.RollInvert = m_TiltRollInvert[m_Page]->IsChecked();
|
2009-12-14 02:23:14 +00:00
|
|
|
break;
|
|
|
|
case IDC_TILT_PITCH_INVERT:
|
2009-12-27 19:31:02 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Tilt.PitchInvert = m_TiltPitchInvert[m_Page]->IsChecked();
|
|
|
|
break;
|
|
|
|
case IDC_TRIGGER_TYPE:
|
|
|
|
WiiMoteEmu::WiiMapping[m_Page].TriggerType = m_TriggerType[m_Page]->GetSelection();
|
2009-02-14 01:15:35 +00:00
|
|
|
break;
|
2009-12-09 14:52:30 +00:00
|
|
|
case IDC_NUNCHUCK_STICK:
|
2009-12-27 19:31:02 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Stick.NC = m_NunchuckComboStick[m_Page]->GetSelection();
|
2009-02-15 02:01:43 +00:00
|
|
|
break;
|
2009-12-09 14:52:30 +00:00
|
|
|
case IDC_CC_LEFT_STICK:
|
2009-12-27 19:31:02 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Stick.CCL = m_CcComboLeftStick[m_Page]->GetSelection();
|
2009-02-24 02:40:17 +00:00
|
|
|
break;
|
2009-12-09 14:52:30 +00:00
|
|
|
case IDC_CC_RIGHT_STICK:
|
2009-12-27 19:31:02 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Stick.CCR = m_CcComboRightStick[m_Page]->GetSelection();
|
2009-02-24 02:40:17 +00:00
|
|
|
break;
|
2009-12-09 14:52:30 +00:00
|
|
|
case IDC_CC_TRIGGERS:
|
2009-12-27 19:31:02 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Stick.CCT = m_CcComboTriggers[m_Page]->GetSelection();
|
2009-02-24 02:40:17 +00:00
|
|
|
break;
|
2009-12-09 14:52:30 +00:00
|
|
|
case IDC_GH3_ANALOG:
|
2009-12-27 19:31:02 +00:00
|
|
|
WiiMoteEmu::WiiMapping[m_Page].Stick.GH = m_GH3ComboAnalog[m_Page]->GetSelection();
|
2009-02-14 01:15:35 +00:00
|
|
|
break;
|
2008-12-08 05:25:12 +00:00
|
|
|
}
|
2009-01-25 23:07:15 +00:00
|
|
|
UpdateGUI();
|
|
|
|
}
|
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
void WiimotePadConfigDialog::UpdateGUI()
|
2009-02-20 03:13:22 +00:00
|
|
|
{
|
2010-01-22 23:19:16 +00:00
|
|
|
if(!m_ControlsCreated)
|
2009-12-27 19:31:02 +00:00
|
|
|
return;
|
|
|
|
|
2009-12-31 22:12:32 +00:00
|
|
|
// Disable all pad items if no pads are detected
|
|
|
|
bool PadEnabled = WiiMoteEmu::NumGoodPads != 0;
|
|
|
|
|
|
|
|
m_Joyname[m_Page]->Enable(PadEnabled);
|
|
|
|
m_ComboDeadZoneLeft[m_Page]->Enable(PadEnabled);
|
|
|
|
m_ComboDeadZoneRight[m_Page]->Enable(PadEnabled);
|
|
|
|
m_CheckC2S[m_Page]->Enable(PadEnabled);
|
|
|
|
m_ComboDiagonal[m_Page]->Enable(PadEnabled);
|
|
|
|
m_CheckRumble[m_Page]->Enable(PadEnabled);
|
|
|
|
m_RumbleStrength[m_Page]->Enable(PadEnabled);
|
|
|
|
m_TriggerType[m_Page]->Enable(PadEnabled);
|
|
|
|
for(int i = 0; i <= IDB_TRIGGER_R - IDB_ANALOG_LEFT_X; i++)
|
|
|
|
m_Button_Analog[i][m_Page]->Enable(PadEnabled);
|
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
wxString tmp;
|
|
|
|
|
|
|
|
m_Joyname[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].ID);
|
|
|
|
m_ComboDeadZoneLeft[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].DeadZoneL);
|
|
|
|
m_ComboDeadZoneRight[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].DeadZoneR);
|
2010-01-22 23:19:16 +00:00
|
|
|
m_ComboDiagonal[m_Page]->SetSelection((100 - WiiMoteEmu::WiiMapping[m_Page].Diagonal) / 5);
|
2009-12-27 19:31:02 +00:00
|
|
|
m_CheckC2S[m_Page]->SetValue(WiiMoteEmu::WiiMapping[m_Page].bCircle2Square);
|
|
|
|
m_CheckRumble[m_Page]->SetValue(WiiMoteEmu::WiiMapping[m_Page].Rumble);
|
2010-01-23 13:34:18 +00:00
|
|
|
m_RumbleStrength[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].RumbleStrength / 10);
|
2009-12-27 19:31:02 +00:00
|
|
|
m_TriggerType[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].TriggerType);
|
|
|
|
m_TiltTypeWM[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Tilt.InputWM);
|
|
|
|
m_TiltTypeNC[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Tilt.InputNC);
|
|
|
|
m_TiltComboRangeRoll[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Tilt.RollDegree / 5 - 1); // 5 to 180, step 5
|
|
|
|
m_TiltComboRangeRoll[m_Page]->Enable(!WiiMoteEmu::WiiMapping[m_Page].Tilt.RollSwing);
|
|
|
|
m_TiltComboRangePitch[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Tilt.PitchDegree / 5 - 1); // 5 to 180, step 5
|
|
|
|
m_TiltComboRangePitch[m_Page]->Enable(!WiiMoteEmu::WiiMapping[m_Page].Tilt.PitchSwing);
|
|
|
|
m_TiltRollSwing[m_Page]->SetValue(WiiMoteEmu::WiiMapping[m_Page].Tilt.RollSwing);
|
|
|
|
m_TiltPitchSwing[m_Page]->SetValue(WiiMoteEmu::WiiMapping[m_Page].Tilt.PitchSwing);
|
|
|
|
m_TiltRollInvert[m_Page]->SetValue(WiiMoteEmu::WiiMapping[m_Page].Tilt.RollInvert);
|
|
|
|
m_TiltPitchInvert[m_Page]->SetValue(WiiMoteEmu::WiiMapping[m_Page].Tilt.PitchInvert);
|
|
|
|
|
|
|
|
for (int i = 0; i <= IDB_TRIGGER_R - IDB_ANALOG_LEFT_X; i++)
|
|
|
|
{
|
|
|
|
tmp << WiiMoteEmu::WiiMapping[m_Page].AxisMapping.Code[i];
|
|
|
|
m_Button_Analog[i][m_Page]->SetLabel(tmp);
|
|
|
|
tmp.clear();
|
|
|
|
}
|
2009-02-15 02:01:43 +00:00
|
|
|
|
2009-12-27 19:31:02 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
for (int x = 0; x <= IDB_WM_SHAKE - IDB_WM_A; x++)
|
2009-02-10 20:20:52 +00:00
|
|
|
{
|
2009-12-31 22:12:32 +00:00
|
|
|
m_Button_Wiimote[x][m_Page]->SetLabel(wxString::FromAscii(
|
|
|
|
InputCommon::VKToString(WiiMoteEmu::WiiMapping[m_Page].Button[x + WiiMoteEmu::EWM_A]).c_str()));
|
2009-12-27 19:31:02 +00:00
|
|
|
}
|
|
|
|
if(WiiMoteEmu::WiiMapping[m_Page].iExtensionConnected == WiiMoteEmu::EXT_NUNCHUCK)
|
|
|
|
{
|
2009-12-31 22:12:32 +00:00
|
|
|
m_NunchuckComboStick[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Stick.NC);
|
2009-12-27 19:31:02 +00:00
|
|
|
for (int x = 0; x <= IDB_NC_SHAKE - IDB_NC_Z; x++)
|
|
|
|
m_Button_NunChuck[x][m_Page]->SetLabel(wxString::FromAscii(
|
|
|
|
InputCommon::VKToString(WiiMoteEmu::WiiMapping[m_Page].Button[x + WiiMoteEmu::ENC_Z]).c_str()));
|
|
|
|
}
|
|
|
|
else if(WiiMoteEmu::WiiMapping[m_Page].iExtensionConnected == WiiMoteEmu::EXT_CLASSIC_CONTROLLER)
|
|
|
|
{
|
2009-12-31 22:12:32 +00:00
|
|
|
m_CcComboLeftStick[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Stick.CCL);
|
|
|
|
m_CcComboRightStick[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Stick.CCR);
|
|
|
|
m_CcComboTriggers[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Stick.CCT);
|
2009-12-27 19:31:02 +00:00
|
|
|
for (int x = 0; x <= IDB_CC_RD - IDB_CC_A; x++)
|
|
|
|
m_Button_Classic[x][m_Page]->SetLabel(wxString::FromAscii(
|
|
|
|
InputCommon::VKToString(WiiMoteEmu::WiiMapping[m_Page].Button[x + WiiMoteEmu::ECC_A]).c_str()));
|
|
|
|
}
|
|
|
|
else if(WiiMoteEmu::WiiMapping[m_Page].iExtensionConnected == WiiMoteEmu::EXT_GUITARHERO)
|
|
|
|
{
|
2009-12-31 22:12:32 +00:00
|
|
|
m_GH3ComboAnalog[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Stick.GH);
|
2009-12-27 19:31:02 +00:00
|
|
|
for (int x = 0; x <= IDB_GH3_STRUM_DOWN - IDB_GH3_GREEN; x++)
|
|
|
|
m_Button_GH3[x][m_Page]->SetLabel(wxString::FromAscii(
|
|
|
|
InputCommon::VKToString(WiiMoteEmu::WiiMapping[m_Page].Button[x + WiiMoteEmu::EGH_Green]).c_str()));
|
|
|
|
}
|
|
|
|
#elif defined(HAVE_X11) && HAVE_X11
|
|
|
|
char keyStr[10] = {0};
|
|
|
|
for (int x = 0; x <= IDB_WM_SHAKE - IDB_WM_A; x++)
|
|
|
|
{
|
|
|
|
InputCommon::XKeyToString(WiiMoteEmu::WiiMapping[m_Page].Button[x + WiiMoteEmu::EWM_A], keyStr);
|
|
|
|
m_Button_Wiimote[x][m_Page]->SetLabel(wxString::FromAscii(keyStr));
|
|
|
|
}
|
|
|
|
if(WiiMoteEmu::WiiMapping[m_Page].iExtensionConnected == WiiMoteEmu::EXT_NUNCHUCK)
|
|
|
|
{
|
2009-12-31 22:12:32 +00:00
|
|
|
m_NunchuckComboStick[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Stick.NC);
|
2009-12-27 19:31:02 +00:00
|
|
|
for (int x = 0; x <= IDB_NC_SHAKE - IDB_NC_Z; x++)
|
|
|
|
{
|
|
|
|
InputCommon::XKeyToString(WiiMoteEmu::WiiMapping[m_Page].Button[x + WiiMoteEmu::ENC_Z], keyStr);
|
|
|
|
m_Button_NunChuck[x][m_Page]->SetLabel(wxString::FromAscii(keyStr));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(WiiMoteEmu::WiiMapping[m_Page].iExtensionConnected == WiiMoteEmu::EXT_CLASSIC_CONTROLLER)
|
|
|
|
{
|
2009-12-31 22:12:32 +00:00
|
|
|
m_CcComboLeftStick[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Stick.CCL);
|
|
|
|
m_CcComboRightStick[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Stick.CCR);
|
|
|
|
m_CcComboTriggers[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Stick.CCT);
|
2009-12-27 19:31:02 +00:00
|
|
|
for (int x = 0; x <= IDB_CC_RD - IDB_CC_A; x++)
|
|
|
|
{
|
|
|
|
InputCommon::XKeyToString(WiiMoteEmu::WiiMapping[m_Page].Button[x + WiiMoteEmu::ECC_A], keyStr);
|
|
|
|
m_Button_Classic[x][m_Page]->SetLabel(wxString::FromAscii(keyStr));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(WiiMoteEmu::WiiMapping[m_Page].iExtensionConnected == WiiMoteEmu::EXT_GUITARHERO)
|
|
|
|
{
|
2009-12-31 22:12:32 +00:00
|
|
|
m_GH3ComboAnalog[m_Page]->SetSelection(WiiMoteEmu::WiiMapping[m_Page].Stick.GH);
|
2009-12-27 19:31:02 +00:00
|
|
|
for (int x = 0; x <= IDB_GH3_STRUM_DOWN - IDB_GH3_GREEN; x++)
|
|
|
|
{
|
|
|
|
InputCommon::XKeyToString(WiiMoteEmu::WiiMapping[m_Page].Button[x + WiiMoteEmu::EGH_Green], keyStr);
|
2009-12-29 12:13:47 +00:00
|
|
|
m_Button_GH3[x][m_Page]->SetLabel(wxString::FromAscii(keyStr));
|
2009-12-27 19:31:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
DoChangeDeadZone();
|
|
|
|
|
2009-01-07 08:44:57 +00:00
|
|
|
}
|
2009-05-16 04:53:48 +00:00
|
|
|
|