@@ -23,13 +23,11 @@ void InputEditorWindow::InitElement() {
23
23
mButtonsBitmasks = { BTN_A, BTN_B, BTN_START, BTN_L, BTN_R, BTN_Z, BTN_CUP, BTN_CDOWN, BTN_CLEFT, BTN_CRIGHT };
24
24
mDpadBitmasks = { BTN_DUP, BTN_DDOWN, BTN_DLEFT, BTN_DRIGHT };
25
25
26
- mDeviceIndexVisiblity .clear ();
27
- mDeviceIndexVisiblity [ShipDeviceIndex::Keyboard] = true ;
28
- mDeviceIndexVisiblity [ShipDeviceIndex::Mouse] = true ;
29
- mDeviceIndexVisiblity [ShipDeviceIndex::Blue] = true ;
30
- for (auto index = 1 ; index < ShipDeviceIndex::Max; index ++) {
31
- mDeviceIndexVisiblity [static_cast <ShipDeviceIndex>(index )] = false ;
32
- }
26
+ mDeviceIndexVisibility .clear ();
27
+ mDeviceIndexVisibility [ShipDeviceIndex::Keyboard] = true ;
28
+ mDeviceIndexVisibility [ShipDeviceIndex::Mouse] = true ;
29
+ mDeviceIndexVisibility [ShipDeviceIndex::SDLGamepad] = true ;
30
+ mDeviceIndexVisibility [ShipDeviceIndex::Max] = false ;
33
31
}
34
32
35
33
#define INPUT_EDITOR_WINDOW_GAME_INPUT_BLOCK_ID 95237929
@@ -181,22 +179,10 @@ void InputEditorWindow::GetButtonColorsForShipDeviceIndex(ShipDeviceIndex lusInd
181
179
buttonColor = BUTTON_COLOR_MOUSE_BEIGE;
182
180
buttonHoveredColor = BUTTON_COLOR_MOUSE_BEIGE_HOVERED;
183
181
break ;
184
- case ShipDeviceIndex::Blue :
182
+ case ShipDeviceIndex::SDLGamepad :
185
183
buttonColor = BUTTON_COLOR_GAMEPAD_BLUE;
186
184
buttonHoveredColor = BUTTON_COLOR_GAMEPAD_BLUE_HOVERED;
187
185
break ;
188
- case ShipDeviceIndex::Red:
189
- buttonColor = BUTTON_COLOR_GAMEPAD_RED;
190
- buttonHoveredColor = BUTTON_COLOR_GAMEPAD_RED_HOVERED;
191
- break ;
192
- case ShipDeviceIndex::Orange:
193
- buttonColor = BUTTON_COLOR_GAMEPAD_ORANGE;
194
- buttonHoveredColor = BUTTON_COLOR_GAMEPAD_ORANGE_HOVERED;
195
- break ;
196
- case ShipDeviceIndex::Green:
197
- buttonColor = BUTTON_COLOR_GAMEPAD_GREEN;
198
- buttonHoveredColor = BUTTON_COLOR_GAMEPAD_GREEN_HOVERED;
199
- break ;
200
186
default :
201
187
buttonColor = BUTTON_COLOR_GAMEPAD_PURPLE;
202
188
buttonHoveredColor = BUTTON_COLOR_GAMEPAD_PURPLE_HOVERED;
@@ -248,7 +234,7 @@ void InputEditorWindow::DrawButtonLineEditMappingButton(uint8_t port, CONTROLLER
248
234
if (mapping == nullptr ) {
249
235
return ;
250
236
}
251
- if (!mDeviceIndexVisiblity [mapping->GetShipDeviceIndex ()]) {
237
+ if (!mDeviceIndexVisibility [mapping->GetShipDeviceIndex ()]) {
252
238
return ;
253
239
}
254
240
@@ -518,7 +504,7 @@ void InputEditorWindow::DrawStickDirectionLineEditMappingButton(uint8_t port, ui
518
504
if (mapping == nullptr ) {
519
505
return ;
520
506
}
521
- if (!mDeviceIndexVisiblity [mapping->GetShipDeviceIndex ()]) {
507
+ if (!mDeviceIndexVisibility [mapping->GetShipDeviceIndex ()]) {
522
508
return ;
523
509
}
524
510
@@ -1429,11 +1415,11 @@ void InputEditorWindow::DrawDeviceVisibilityButtons() {
1429
1415
GetButtonColorsForShipDeviceIndex (ShipDeviceIndex::Keyboard, keyboardButtonColor, keyboardButtonHoveredColor);
1430
1416
ImGui::PushStyleColor (ImGuiCol_Button, keyboardButtonColor);
1431
1417
ImGui::PushStyleColor (ImGuiCol_ButtonHovered, keyboardButtonHoveredColor);
1432
- bool keyboardVisible = mDeviceIndexVisiblity [ShipDeviceIndex::Keyboard];
1418
+ bool keyboardVisible = mDeviceIndexVisibility [ShipDeviceIndex::Keyboard];
1433
1419
if (ImGui::Button (StringHelper::Sprintf (" %s %s Keyboard" , keyboardVisible ? ICON_FA_EYE : ICON_FA_EYE_SLASH,
1434
1420
ICON_FA_KEYBOARD_O)
1435
1421
.c_str ())) {
1436
- mDeviceIndexVisiblity [ShipDeviceIndex::Keyboard] = !keyboardVisible;
1422
+ mDeviceIndexVisibility [ShipDeviceIndex::Keyboard] = !keyboardVisible;
1437
1423
}
1438
1424
ImGui::PopStyleColor ();
1439
1425
ImGui::PopStyleColor ();
@@ -1443,11 +1429,11 @@ void InputEditorWindow::DrawDeviceVisibilityButtons() {
1443
1429
GetButtonColorsForShipDeviceIndex (ShipDeviceIndex::Mouse, mouseButtonColor, mouseButtonHoveredColor);
1444
1430
ImGui::PushStyleColor (ImGuiCol_Button, mouseButtonColor);
1445
1431
ImGui::PushStyleColor (ImGuiCol_ButtonHovered, mouseButtonHoveredColor);
1446
- bool mouseVisible = mDeviceIndexVisiblity [ShipDeviceIndex::Mouse];
1432
+ bool mouseVisible = mDeviceIndexVisibility [ShipDeviceIndex::Mouse];
1447
1433
if (ImGui::Button (
1448
1434
StringHelper::Sprintf (" %s %s mouse" , mouseVisible ? ICON_FA_EYE : ICON_FA_EYE_SLASH, ICON_FA_KEYBOARD_O)
1449
1435
.c_str ())) {
1450
- mDeviceIndexVisiblity [ShipDeviceIndex::Mouse] = !mouseVisible;
1436
+ mDeviceIndexVisibility [ShipDeviceIndex::Mouse] = !mouseVisible;
1451
1437
}
1452
1438
ImGui::PopStyleColor ();
1453
1439
ImGui::PopStyleColor ();
@@ -1462,13 +1448,13 @@ void InputEditorWindow::DrawDeviceVisibilityButtons() {
1462
1448
1463
1449
ImGui::PushStyleColor (ImGuiCol_Button, buttonColor);
1464
1450
ImGui::PushStyleColor (ImGuiCol_ButtonHovered, buttonHoveredColor);
1465
- bool visible = mDeviceIndexVisiblity [lusIndex];
1451
+ bool visible = mDeviceIndexVisibility [lusIndex];
1466
1452
if (ImGui::Button (
1467
1453
StringHelper::Sprintf (" %s %s %s (%s)" , visible ? ICON_FA_EYE : ICON_FA_EYE_SLASH,
1468
1454
connected ? ICON_FA_GAMEPAD : ICON_FA_CHAIN_BROKEN, name.c_str (),
1469
1455
connected ? StringHelper::Sprintf (" SDL %d" , sdlIndex).c_str () : " Disconnected" )
1470
1456
.c_str ())) {
1471
- mDeviceIndexVisiblity [lusIndex] = !visible;
1457
+ mDeviceIndexVisibility [lusIndex] = !visible;
1472
1458
}
1473
1459
ImGui::PopStyleColor ();
1474
1460
ImGui::PopStyleColor ();
0 commit comments