mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-05 08:10:40 -07:00
overlay: small tweaks to auto light matching (#575)
## Link to GitHub Issue or related Pull Request, if one exists #574 ## Description of change * Add binds for Nostroller * Update matching logic to ignore common device-side output names like "Button" "Light" and "LED" (e.g., `Button 1` from a device now matches on `P1 1`) * For RGB matching, in addition to `Light R` on the device also try `LightR` (Nostroller needs this) * Add a confirmation dialog for `Clear All` * Address minor bugs ## Testing Seems to work on arcin, and Nostroller. Still need to retest Faucetwo. Hopefully I didn't break Phoenixwan.
This commit is contained in:
@@ -26,6 +26,14 @@ namespace overlay::windows {
|
||||
CONFIG_TAB_SEARCH,
|
||||
};
|
||||
|
||||
struct MatchEntry {
|
||||
std::string game_name;
|
||||
std::string device_name;
|
||||
int light_index;
|
||||
int control_index;
|
||||
bool soft;
|
||||
};
|
||||
|
||||
class Config : public Window {
|
||||
private:
|
||||
|
||||
@@ -129,6 +137,13 @@ namespace overlay::windows {
|
||||
void edit_light_popup(Light &primary_light, Light *light, const int alt_index);
|
||||
void auto_match_lights_popup(std::vector<Light> *lights);
|
||||
|
||||
std::string match_lights(
|
||||
rawinput::Device *device,
|
||||
std::vector<Light> *lights,
|
||||
std::vector<std::string> &raw_names,
|
||||
std::vector<MatchEntry> &matched,
|
||||
std::vector<MatchEntry> &unmatched);
|
||||
|
||||
void build_cards();
|
||||
std::string build_option_value_picker_title(const OptionDefinition& option);
|
||||
void build_option_value_picker(Option& option);
|
||||
|
||||
Reference in New Issue
Block a user