cfg: auto light binding, sdvx light formatting, all light test/clear binds (#574)

<img width="784" height="561" alt="image"
src="https://github.com/user-attachments/assets/3ac6bf6d-2ca8-40e5-80ea-b0fd9e080d7b"
/>

## Link to GitHub Issue or related Pull Request, if one exists

n/a

## Description of change

I've always been annoyed with how long it takes to bind controller
lights, made a few improvements

1) added a button+window for automatically matching device lights to
game lights with the same name
2) added button(s) to cycle through all bound lights to visually confirm
location/function
3) added button to clear all bound lights
4) split SDVX lights into sections (Buttons, Valkyrie, Nemsys, Other)
with formatting, sorted based on current game spec

## Testing
Tested with multiple games and controllers (Faucetwo, custom con) and
matching always works if the descriptor strings are labeled correctly.

Not every controller labels their LEDs the same was as spice, but for
those that do this saves a ton of time clicking every box and testing
one by one.

The SDVX table split/formatting is important because myself (and several
friends) have tried binding to Wing/Controller lights and wondered why
they weren't working in game, when they are legacy Nemsys lights instead
of the strip lights handled by Valk/bi2x. I separated the sections
visually, with tooltips, plus sort the two sections based on active spec
to further minimize the chance of someone trying to use the wrong lights
for their game.
This commit is contained in:
Horo
2026-03-15 02:19:24 -07:00
committed by GitHub
parent be388f7b49
commit 44befb7e9a
3 changed files with 982 additions and 25 deletions
+22
View File
@@ -1,5 +1,6 @@
#pragma once
#include <chrono>
#include <optional>
#include "cfg/game.h"
@@ -58,6 +59,24 @@ namespace overlay::windows {
int lights_devices_selected = -1;
int lights_devices_control_selected = -1;
// lights test all
bool lights_testing = false;
int lights_test_current = -1;
std::chrono::steady_clock::time_point lights_test_time;
// lights auto match
std::vector<rawinput::Device *> auto_match_devices;
int auto_match_device_selected = -1;
bool auto_match_testing = false;
int auto_match_test_current = -1;
std::chrono::steady_clock::time_point auto_match_test_time;
std::string auto_match_test_device;
unsigned int auto_match_test_control = 0;
std::chrono::steady_clock::time_point auto_match_copy_time;
bool auto_match_copied = false;
bool auto_match_soft_enabled = true;
bool auto_match_p2 = false;
// keypads tab
int keypads_selected[2] {};
char keypads_card_path[2][1024] {};
@@ -102,10 +121,13 @@ namespace overlay::windows {
void build_analogs(const std::string &name, std::vector<Analog> *analogs);
void edit_analog_popup(Analog &analog);
void update() override;
void stop_lights_test();
void build_lights(const std::string &name, std::vector<Light> *lights);
void build_light(Light &primary_light, Light *light, const int light_index, const int alt_index);
void clear_light(Light *light, const int alt_index);
void edit_light_popup(Light &primary_light, Light *light, const int alt_index);
void auto_match_lights_popup(std::vector<Light> *lights);
void build_cards();
std::string build_option_value_picker_title(const OptionDefinition& option);