|
1 | 1 | #include "SettingsInputGUI.h"
|
2 | 2 | #include "UInputMan.h"
|
| 3 | +#include "WindowMan.h" |
3 | 4 |
|
4 | 5 | #include "GUI.h"
|
5 | 6 | #include "GUICollectionBox.h"
|
@@ -43,6 +44,8 @@ SettingsInputGUI::SettingsInputGUI(GUIControlManager* parentControlManager) :
|
43 | 44 | m_InputMappingConfigMenu = std::make_unique<SettingsInputMappingGUI>(parentControlManager);
|
44 | 45 | m_DeviceCaptureDialog.DeviceCaptureBox = dynamic_cast<GUICollectionBox*>(m_GUIControlManager->GetControl("CollectionBoxDeviceCapture"));
|
45 | 46 | m_DeviceCaptureDialog.SelectorTextLabel = dynamic_cast<GUILabel*>(m_GUIControlManager->GetControl("LabelDeviceCaptureInstruction1"));
|
| 47 | + GUICollectionBox* settingsRootBox = dynamic_cast<GUICollectionBox*>(m_GUIControlManager->GetControl("CollectionBoxSettingsBase")); |
| 48 | + m_DeviceCaptureDialog.DeviceCaptureBox->SetPositionAbs(settingsRootBox->GetXPos() + ((settingsRootBox->GetWidth() - m_DeviceCaptureDialog.DeviceCaptureBox->GetWidth()) / 2), settingsRootBox->GetYPos() + ((settingsRootBox->GetHeight() - m_DeviceCaptureDialog.DeviceCaptureBox->GetHeight()) / 2)); |
46 | 49 | }
|
47 | 50 |
|
48 | 51 | void SettingsInputGUI::SetEnabled(bool enable) const {
|
@@ -170,7 +173,7 @@ void SettingsInputGUI::ShowOrHidePlayerInputDeviceSensitivityControls(int player
|
170 | 173 |
|
171 | 174 | void SettingsInputGUI::UpdateMouseKeyboardSelectControls() {
|
172 | 175 | for (int player = 0; player < MaxPlayerCount; player++) {
|
173 |
| - bool showControls = g_UInputMan.IsMultiMouseKeyboardEnabled() && g_UInputMan.GetControlScheme(player)->GetDevice() == InputDevice::DEVICE_MOUSE_KEYB; |
| 176 | + bool showControls = g_UInputMan.CheckMultiMouseKeyboardEnabled() && g_UInputMan.GetControlScheme(player)->GetDevice() == InputDevice::DEVICE_MOUSE_KEYB; |
174 | 177 | m_PlayerInputSettingsBoxes.at(player).KeyboardMouseSelectBox->SetVisible(showControls);
|
175 | 178 | m_PlayerInputSettingsBoxes.at(player).KeyboardMouseSelectBox->SetEnabled(showControls);
|
176 | 179 | }
|
@@ -211,9 +214,13 @@ void SettingsInputGUI::UpdatePlayerInputSensitivityControlValues(int player) {
|
211 | 214 | void SettingsInputGUI::UpdatePlayerKeyboardMouseButtonLabels(int player) {
|
212 | 215 | if (SDL_MouseID mouse = g_UInputMan.GetControlScheme(player)->GetDeviceID().mouseKeyboard.mouse; mouse != 0) {
|
213 | 216 | m_PlayerInputSettingsBoxes[player].MouseSelectButton->SetText("Mouse " + std::to_string(mouse));
|
| 217 | + } else { |
| 218 | + m_PlayerInputSettingsBoxes[player].MouseSelectButton->SetText("Set Mouse"); |
214 | 219 | }
|
215 | 220 | if (SDL_KeyboardID keyboard = g_UInputMan.GetControlScheme(player)->GetDeviceID().mouseKeyboard.keyboard; keyboard != 0) {
|
216 | 221 | m_PlayerInputSettingsBoxes[player].KeyboardSelectButton->SetText("Keyboard " + std::to_string(keyboard));
|
| 222 | + } else { |
| 223 | + m_PlayerInputSettingsBoxes[player].KeyboardSelectButton->SetText("Set Keyboard"); |
217 | 224 | }
|
218 | 225 | }
|
219 | 226 |
|
@@ -241,6 +248,7 @@ void SettingsInputGUI::HideDeviceCaptureBox() {
|
241 | 248 | m_DeviceCaptureDialog.Active = false;
|
242 | 249 | g_UInputMan.TrapMousePos(false);
|
243 | 250 | g_UInputMan.ClearMouseButtons();
|
| 251 | + m_GUIControlManager->GetInput()->ClearMouseState(); |
244 | 252 | }
|
245 | 253 |
|
246 | 254 | void SettingsInputGUI::HandleConfigDeviceMapping() {
|
|
0 commit comments