diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index e3ce0d465f..e968b206e9 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -1181,6 +1181,22 @@ int BindCommand(Device *dev, unsigned int uid, unsigned int port, unsigned int s } DeleteBinding(port, slot, dev, b); } + if (!config.multipleBinding) { + for (int port2=0; port2<2; port2++) { + for (int slot2=0; slot2<4; slot2++) { + if (port2==port && slot2 == slot) continue; + PadBindings *p = dev->pads[port2]+slot2; + for (int i=0; i < p->numBindings; i++) { + Binding *b = p->bindings+i; + int uid2 = dev->virtualControls[b->controlIndex].uid; + if (b->controlIndex == controlIndex || (!((uid2^uid) & 0xFFFFFF) && ((uid|uid2) & (UID_POV | UID_AXIS)))) { + DeleteBinding(port2, slot2, dev, b); + i--; + } + } + } + } + } return count; } @@ -1631,10 +1647,10 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM) L"Guitar"); } } - UpdatePadList(hWnd); UpdatePadPages(); hWndGeneral = hWnd; RefreshEnabledDevicesAndDisplay(0, hWnd, 0); + UpdatePadList(hWnd); CheckDlgButton(hWnd, IDC_BACKGROUND, BST_CHECKED * config.background); CheckDlgButton(hWnd, IDC_FORCE_HIDE, BST_CHECKED * config.forceHide); @@ -1676,6 +1692,7 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L case WM_DEVICECHANGE: if (wParam == DBT_DEVNODES_CHANGED) { RefreshEnabledDevicesAndDisplay(1, hWndGeneral, 1); + UpdatePadList(hWnd); } break; case WM_COMMAND: @@ -1684,8 +1701,11 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L int pad = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); HWND hWndCombo = GetDlgItem(hWnd, IDC_PAD_TYPE); int sel = SendMessage(hWndCombo, CB_GETCURSEL, 0, 0); - if (pad >= 0 && sel >= 0 && sel != config.padConfigs[sel][0].type) { - config.padConfigs[sel][0].type = (PadType)sel; + if (pad >= 0 && sel >= 0 && sel != config.padConfigs[pad][0].type) { + config.padConfigs[pad][0].type = (PadType)sel; + UpdatePadList(hWnd); + UpdatePadPages(); + RefreshEnabledDevicesAndDisplay(0, hWnd, 1); PropSheet_Changed(hWndProp, hWnd); } } @@ -1729,6 +1749,7 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L } else if (HIWORD(wParam)==BN_CLICKED && LOWORD(wParam) == ID_REFRESH) { RefreshEnabledDevicesAndDisplay(1, hWnd, 1); + UpdatePadList(hWnd); } else if (HIWORD(wParam)==BN_CLICKED && LOWORD(wParam) == IDC_ANALOG_START1) { int pad = ListView_GetNextItem(hWndList, -1, LVNI_SELECTED); @@ -1797,6 +1818,7 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L config.forceHide = (IsDlgButtonChecked(hWnd, IDC_FORCE_HIDE) == BST_CHECKED); RefreshEnabledDevicesAndDisplay(0, hWnd, 1); + UpdatePadList(hWnd); PropSheet_Changed(hWndProp, hWnd); /* diff --git a/plugins/LilyPad/LilyPad.rc b/plugins/LilyPad/LilyPad.rc index f903c77b46..02e58ca82b 100644 --- a/plugins/LilyPad/LilyPad.rc +++ b/plugins/LilyPad/LilyPad.rc @@ -75,20 +75,20 @@ BEGIN PUSHBUTTON "L3",ID_L3,195,93,45,15 PUSHBUTTON "R3",ID_R3,371,93,46,15 GROUPBOX "D-Pad",IDC_DPAD,251,44,110,68 - PUSHBUTTON "Up",ID_DPAD_UP,285,54,35,15 - PUSHBUTTON "Left",ID_DPAD_LEFT,267,73,35,15 - PUSHBUTTON "Right",ID_DPAD_RIGHT,307,73,35,15 - PUSHBUTTON "Down",ID_DPAD_DOWN,285,92,35,15 + PUSHBUTTON "Up",ID_DPAD_UP,285,55,35,15 + PUSHBUTTON "Left",ID_DPAD_LEFT,267,74,35,15 + PUSHBUTTON "Right",ID_DPAD_RIGHT,307,74,35,15 + PUSHBUTTON "Down",ID_DPAD_DOWN,285,93,35,15 GROUPBOX "Left Analog Stick",IDC_LSTICK,195,115,108,70 - PUSHBUTTON "Up",ID_LSTICK_UP,228,125,35,15 - PUSHBUTTON "Left",ID_LSTICK_LEFT,210,144,35,15 - PUSHBUTTON "Right",ID_LSTICK_RIGHT,250,144,35,15 - PUSHBUTTON "Down",ID_LSTICK_DOWN,228,164,35,15 + PUSHBUTTON "Up",ID_LSTICK_UP,228,126,35,15 + PUSHBUTTON "Left",ID_LSTICK_LEFT,210,145,35,15 + PUSHBUTTON "Right",ID_LSTICK_RIGHT,250,145,35,15 + PUSHBUTTON "Down",ID_LSTICK_DOWN,228,165,35,15 GROUPBOX "Right Analog Stick",IDC_RSTICK,309,115,108,70 - PUSHBUTTON "Up",ID_RSTICK_UP,342,125,35,15 - PUSHBUTTON "Left",ID_RSTICK_LEFT,324,144,35,15 - PUSHBUTTON "Right",ID_RSTICK_RIGHT,364,144,35,15 - PUSHBUTTON "Down",ID_RSTICK_DOWN,342,164,35,15 + PUSHBUTTON "Up",ID_RSTICK_UP,342,126,35,15 + PUSHBUTTON "Left",ID_RSTICK_LEFT,324,145,35,15 + PUSHBUTTON "Right",ID_RSTICK_RIGHT,364,145,35,15 + PUSHBUTTON "Down",ID_RSTICK_DOWN,342,165,35,15 GROUPBOX "",ID_FF,195,6,222,248 COMBOBOX IDC_FF_EFFECT,203,20,206,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_FF_AXIS1,"msctls_trackbar32",WS_TABSTOP,199,40,214,17 @@ -115,19 +115,19 @@ BEGIN CONTROL "Axis 6",IDC_FF_AXIS6_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,240,91,10 CONTROL "Flip",IDC_FF_AXIS6_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,240,35,10 EDITTEXT IDC_FF_AXIS6_SCALE,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING - PUSHBUTTON "Test",ID_TEST,196,260,62,15 - GROUPBOX "Binding Details",ID_SENSITIVITY,195,187,222,67 - EDITTEXT IDC_AXIS_DEVICE1,201,200,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - COMBOBOX IDC_AXIS_DIRECTION,201,216,63,47,CBS_DROPDOWNLIST | WS_TABSTOP - EDITTEXT IDC_AXIS_CONTROL1,201,238,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,215,138,17 - CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,238,27,10 - CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,238,34,10 - EDITTEXT IDC_AXIS_SENSITIVITY1,375,238,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING - PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,62,15 - PUSHBUTTON "Lock Input",ID_LOCK,196,260,62,15 - PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,62,15 - PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,296,62,15 + PUSHBUTTON "Test",ID_TEST,196,260,59,15 + PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,59,15 + GROUPBOX "Binding Details",ID_SENSITIVITY,195,188,222,66 + EDITTEXT IDC_AXIS_DEVICE1,203,202,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + COMBOBOX IDC_AXIS_DIRECTION,202,218,70,47,CBS_DROPDOWNLIST | WS_TABSTOP + EDITTEXT IDC_AXIS_CONTROL1,203,240,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,217,138,17 + CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,240,27,10 + CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,240,34,10 + EDITTEXT IDC_AXIS_SENSITIVITY1,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING + PUSHBUTTON "Lock Input",ID_LOCK,196,260,59,15 + PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,59,15 + PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,296,59,15 GROUPBOX "New Force Feedback Effect",IDC_STATIC,262,260,155,51 COMBOBOX IDC_FORCEFEEDBACK,269,273,142,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Big Motor",ID_BIG_MOTOR,269,291,64,14 @@ -179,19 +179,19 @@ BEGIN CONTROL "Axis 6",IDC_FF_AXIS6_ENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,205,240,91,10 CONTROL "Flip",IDC_FF_AXIS6_FLIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,302,240,35,10 EDITTEXT IDC_FF_AXIS6_SCALE,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING - PUSHBUTTON "Test",ID_TEST,196,260,62,15 - GROUPBOX "Binding Details",ID_SENSITIVITY,195,187,222,67 - EDITTEXT IDC_AXIS_DEVICE1,201,200,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - COMBOBOX IDC_AXIS_DIRECTION,201,216,63,47,CBS_DROPDOWNLIST | WS_TABSTOP - EDITTEXT IDC_AXIS_CONTROL1,201,238,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP - CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,215,138,17 - CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,238,27,10 - CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,238,34,10 - EDITTEXT IDC_AXIS_SENSITIVITY1,375,238,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING - PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,62,15 - PUSHBUTTON "Lock Input",ID_LOCK,196,260,62,15 - PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,62,15 - PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,296,62,15 + PUSHBUTTON "Test",ID_TEST,196,260,59,15 + PUSHBUTTON "Back to Controls",ID_CONTROLS,196,296,59,15 + GROUPBOX "Binding Details",ID_SENSITIVITY,195,188,222,66 + EDITTEXT IDC_AXIS_DEVICE1,203,202,208,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + COMBOBOX IDC_AXIS_DIRECTION,202,218,70,47,CBS_DROPDOWNLIST | WS_TABSTOP + EDITTEXT IDC_AXIS_CONTROL1,203,240,74,12,ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP + CONTROL "",IDC_SLIDER1,"msctls_trackbar32",WS_TABSTOP,276,217,138,17 + CONTROL "Flip",IDC_FLIP1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,280,240,27,10 + CONTROL "Turbo",IDC_TURBO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,309,240,34,10 + EDITTEXT IDC_AXIS_SENSITIVITY1,375,240,33,12,ES_RIGHT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP,WS_EX_RTLREADING + PUSHBUTTON "Lock Input",ID_LOCK,196,260,59,15 + PUSHBUTTON "Lock Direction",ID_LOCK_DIRECTION,196,278,59,15 + PUSHBUTTON "Lock Buttons",ID_LOCK_BUTTONS,196,296,59,15 GROUPBOX "New Force Feedback Effect",IDC_STATIC,262,260,155,51 COMBOBOX IDC_FORCEFEEDBACK,269,273,142,106,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Big Motor",ID_BIG_MOTOR,269,291,64,14 @@ -211,10 +211,10 @@ BEGIN "Button",BS_AUTORADIOBUTTON,23,64,175,10 GROUPBOX "Game Device APIs",IDC_STATIC,16,81,191,49 CONTROL "DirectInput",IDC_G_DI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,92,65,10 - CONTROL "XInput",IDC_G_XI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,104,39,10 + CONTROL "XInput (Xbox 360 controllers only)",IDC_G_XI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,104,125,10 CONTROL "Monitor when in background",IDC_BACKGROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,116,106,10 GROUPBOX "Mouse API",IDC_STATIC,216,16,192,85 - CONTROL "Windows messaging",IDC_M_WM,"Button",BS_AUTORADIOBUTTON | WS_GROUP,224,27,112,10 + CONTROL "Windows messaging (Recommended)",IDC_M_WM,"Button",BS_AUTORADIOBUTTON | WS_GROUP,224,27,134,10 CONTROL "Raw input (XP and later only)",IDC_M_RAW,"Button",BS_AUTORADIOBUTTON,224,39,112,10 CONTROL "DirectInput",IDC_M_DI,"Button",BS_AUTORADIOBUTTON,224,51,112,10 CONTROL "Disable",IDC_M_DISABLE,"Button",BS_AUTORADIOBUTTON,224,63,39,10