mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 09:22:18 -05:00
fix same name controller entry being unselectable (#1031)
This fix being unable to select both entry of controller that has same ID and Name (for example Mayflash mf103 in my tests got two port both ports has same name and ID.
This commit is contained in:
parent
0f7a88bd5a
commit
d61d4e508a
@ -95,7 +95,11 @@ namespace Ship {
|
|||||||
|
|
||||||
if (ControllerName != nullptr && ImGui::BeginCombo("##ControllerEntries", ControllerName)) {
|
if (ControllerName != nullptr && ImGui::BeginCombo("##ControllerEntries", ControllerName)) {
|
||||||
for (uint8_t i = 0; i < devices.size(); i++) {
|
for (uint8_t i = 0; i < devices.size(); i++) {
|
||||||
if (ImGui::Selectable(devices[i]->GetControllerName(), i == vDevices[CurrentPort])) {
|
std::string DeviceName = devices[i]->GetControllerName();
|
||||||
|
if (DeviceName != "Keyboard" && DeviceName != "Auto") {
|
||||||
|
DeviceName+="##"+std::to_string(i);
|
||||||
|
}
|
||||||
|
if (ImGui::Selectable(DeviceName.c_str(), i == vDevices[CurrentPort])) {
|
||||||
Window::ControllerApi->SetPhysicalDevice(CurrentPort, i);
|
Window::ControllerApi->SetPhysicalDevice(CurrentPort, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user