Rework how manual configuration (previously sizes) are loaded to newly detected controllers, load active profile to newly detected controllers

This commit is contained in:
Adam Honse
2026-02-18 11:39:51 -06:00
parent 012c6c45f1
commit 0e07d222db
4 changed files with 192 additions and 161 deletions

View File

@@ -402,9 +402,14 @@ void DetectionManager::RegisterRGBController(RGBController *rgb_controller)
rgb_controller->flags |= CONTROLLER_FLAG_LOCAL;
/*-----------------------------------------------------*\
| Load sizes for the new controller |
| Load manual configuration for the new controller |
\*-----------------------------------------------------*/
ResourceManager::get()->GetProfileManager()->LoadControllerFromListWithOptions(rgb_controllers_sizes, detection_size_entry_used, rgb_controller, true, false);
ResourceManager::get()->GetProfileManager()->LoadControllerConfiguration(rgb_controller);
/*-----------------------------------------------------*\
| Load active profile for the new controller |
\*-----------------------------------------------------*/
ResourceManager::get()->GetProfileManager()->LoadControllerActiveProfile(rgb_controller);
/*-----------------------------------------------------*\
| Add the new controller to the list |
@@ -653,16 +658,6 @@ void DetectionManager::BackgroundDetectDevices()
initial_detection = false;
}
/*-----------------------------------------------------*\
| Reset the size entry used flags vector |
\*-----------------------------------------------------*/
detection_size_entry_used.resize(rgb_controllers_sizes.size());
for(std::size_t size_idx = 0; size_idx < detection_size_entry_used.size(); size_idx++)
{
detection_size_entry_used[size_idx] = false;
}
/*-----------------------------------------------------*\
| Enumerate HID devices unless using HID safe mode |
\*-----------------------------------------------------*/
@@ -1656,11 +1651,6 @@ bool DetectionManager::ProcessPreDetection()
\*-----------------------------------------------------*/
UpdateDetectorSettings();
/*-----------------------------------------------------*\
| Initialize sizes list |
\*-----------------------------------------------------*/
rgb_controllers_sizes = ResourceManager::get()->GetProfileManager()->GetControllerListFromSizes();
/*-----------------------------------------------------*\
| Clean up any existing detected devices |
\*-----------------------------------------------------*/