Skip to content

Commit 080909a

Browse files
committed
fix text in device capture window
1 parent 7995070 commit 080909a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Source/Menus/SettingsInputGUI.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "SettingsInputGUI.h"
22
#include "UInputMan.h"
3+
#include "WindowMan.h"
34

45
#include "GUI.h"
56
#include "GUICollectionBox.h"
@@ -43,6 +44,8 @@ SettingsInputGUI::SettingsInputGUI(GUIControlManager* parentControlManager) :
4344
m_InputMappingConfigMenu = std::make_unique<SettingsInputMappingGUI>(parentControlManager);
4445
m_DeviceCaptureDialog.DeviceCaptureBox = dynamic_cast<GUICollectionBox*>(m_GUIControlManager->GetControl("CollectionBoxDeviceCapture"));
4546
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));
4649
}
4750

4851
void SettingsInputGUI::SetEnabled(bool enable) const {
@@ -170,7 +173,7 @@ void SettingsInputGUI::ShowOrHidePlayerInputDeviceSensitivityControls(int player
170173

171174
void SettingsInputGUI::UpdateMouseKeyboardSelectControls() {
172175
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;
174177
m_PlayerInputSettingsBoxes.at(player).KeyboardMouseSelectBox->SetVisible(showControls);
175178
m_PlayerInputSettingsBoxes.at(player).KeyboardMouseSelectBox->SetEnabled(showControls);
176179
}
@@ -211,9 +214,13 @@ void SettingsInputGUI::UpdatePlayerInputSensitivityControlValues(int player) {
211214
void SettingsInputGUI::UpdatePlayerKeyboardMouseButtonLabels(int player) {
212215
if (SDL_MouseID mouse = g_UInputMan.GetControlScheme(player)->GetDeviceID().mouseKeyboard.mouse; mouse != 0) {
213216
m_PlayerInputSettingsBoxes[player].MouseSelectButton->SetText("Mouse " + std::to_string(mouse));
217+
} else {
218+
m_PlayerInputSettingsBoxes[player].MouseSelectButton->SetText("Set Mouse");
214219
}
215220
if (SDL_KeyboardID keyboard = g_UInputMan.GetControlScheme(player)->GetDeviceID().mouseKeyboard.keyboard; keyboard != 0) {
216221
m_PlayerInputSettingsBoxes[player].KeyboardSelectButton->SetText("Keyboard " + std::to_string(keyboard));
222+
} else {
223+
m_PlayerInputSettingsBoxes[player].KeyboardSelectButton->SetText("Set Keyboard");
217224
}
218225
}
219226

@@ -241,6 +248,7 @@ void SettingsInputGUI::HideDeviceCaptureBox() {
241248
m_DeviceCaptureDialog.Active = false;
242249
g_UInputMan.TrapMousePos(false);
243250
g_UInputMan.ClearMouseButtons();
251+
m_GUIControlManager->GetInput()->ClearMouseState();
244252
}
245253

246254
void SettingsInputGUI::HandleConfigDeviceMapping() {

0 commit comments

Comments
 (0)