From 1fad79857301d20e86e01f18c39261b08b89ab0f Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 28 Jul 2020 21:56:45 +0930 Subject: [PATCH] Project64-input: Be able to configure controller PAK --- Source/Project64-input/OptionsUI.cpp | 30 ++++++++++++++++++++++ Source/Project64-input/Project64-input.rc | Bin 18206 -> 18502 bytes Source/Project64-input/resource.h | Bin 9192 -> 9284 bytes 3 files changed, 30 insertions(+) diff --git a/Source/Project64-input/OptionsUI.cpp b/Source/Project64-input/OptionsUI.cpp index 6290c044c..f33243d2b 100644 --- a/Source/Project64-input/OptionsUI.cpp +++ b/Source/Project64-input/OptionsUI.cpp @@ -28,8 +28,29 @@ public: SetWindowText(stdstr_f("Options - Player %d", m_ControlIndex + 1).ToUTF16().c_str()); CButton(GetDlgItem(IDC_REAL_N64_RANGE)).SetCheck(m_Controller.RealN64Range ? BST_CHECKED : BST_UNCHECKED); CButton(GetDlgItem(IDC_REMOVE_DUPLICATE)).SetCheck(m_Controller.RemoveDuplicate ? BST_CHECKED : BST_UNCHECKED); + + CComboBox ControllerPak(GetDlgItem(IDC_PAKTYPE)); + int Index = ControllerPak.AddString(L"None"); + ControllerPak.SetItemData(Index, PLUGIN_NONE); + if (m_ControlInfo.Plugin == PLUGIN_NONE) + { + ControllerPak.SetCurSel(Index); + } + Index = ControllerPak.AddString(L"Mem Pak"); + ControllerPak.SetItemData(Index, PLUGIN_MEMPAK); + if (m_ControlInfo.Plugin == PLUGIN_MEMPAK) + { + ControllerPak.SetCurSel(Index); + } + Index = ControllerPak.AddString(L"Rumble Pak"); + ControllerPak.SetItemData(Index, PLUGIN_RUMBLE_PAK); + if (m_ControlInfo.Plugin == PLUGIN_RUMBLE_PAK) + { + ControllerPak.SetCurSel(Index); + } return TRUE; } + LRESULT OnOkCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) { bool bChanged = false; @@ -45,6 +66,15 @@ public: m_Controller.RemoveDuplicate = RemoveDuplicate; bChanged = true; } + + CComboBox ControllerPak(GetDlgItem(IDC_PAKTYPE)); + int32_t Pak = ControllerPak.GetItemData(ControllerPak.GetCurSel()); + if (Pak != m_ControlInfo.Plugin) + { + m_ControlInfo.Plugin = Pak; + bChanged = true; + } + if (bChanged) { GetParent().SendMessage(PSM_CHANGED); diff --git a/Source/Project64-input/Project64-input.rc b/Source/Project64-input/Project64-input.rc index da10a1687d466a15c196082b686c95e06740d982..2c959dcb225baf5fa0b1b3fe2bcac0c2db14f33b 100644 GIT binary patch delta 209 zcmbQ&$9QZ4f(i@}=*-~H;LG5|;6GWOTRhW~!G*z@A)X$fpK0Rlii&6ZN6cd#|HpYl?ZqM diff --git a/Source/Project64-input/resource.h b/Source/Project64-input/resource.h index 0421cf878ae3de4407200e60c74938f3b8c1c8b9..957b293aea36afeff718a80f646af0a86e8abb95 100644 GIT binary patch delta 52 zcmaFie#B!#i{j)wWr4{7OdPxc42}%m3?U4W3;_(TlLZCTCx4LRVzk&?ulSO2@+DTW I$#u$E0IFCI_W%F@ delta 24 gcmX@&@xpyWi{j=7icc6P*C~okR!|n1{7yLx0FR~$RsaA1