overlay: show name of analog control in popup title (#667)

This commit is contained in:
bicarus
2026-05-02 00:01:33 -07:00
committed by GitHub
parent af8d8dae9f
commit 7b862768b0
2 changed files with 9 additions and 7 deletions
+8 -6
View File
@@ -2253,8 +2253,9 @@ namespace overlay::windows {
} }
// analog binding // analog binding
const std::string title = "Analog Binding (" + analog.getName() + ")";
if (ImGui::Button("Set")) { if (ImGui::Button("Set")) {
ImGui::OpenPopup("Analog Binding"); ImGui::OpenPopup(title.c_str());
// get devices // get devices
this->analogs_devices.clear(); this->analogs_devices.clear();
@@ -2284,7 +2285,7 @@ namespace overlay::windows {
} }
} }
edit_analog_popup(analog); edit_analog_popup(analog, title);
// row hover detection (invisible selectable that spans entire row) // row hover detection (invisible selectable that spans entire row)
ImGui::InvisibleTableRowSelectable(); ImGui::InvisibleTableRowSelectable();
@@ -2298,8 +2299,8 @@ namespace overlay::windows {
} }
} }
void Config::edit_analog_popup(Analog &analog) { void Config::edit_analog_popup(Analog &analog, std::string title) {
if (ImGui::BeginPopupModal("Analog Binding", NULL, ImGuiWindowFlags_AlwaysAutoResize)) { if (ImGui::BeginPopupModal(title.c_str(), NULL, ImGuiWindowFlags_AlwaysAutoResize)) {
// device selector // device selector
auto analog_device_changed = ImGui::Combo( auto analog_device_changed = ImGui::Combo(
@@ -2596,7 +2597,7 @@ namespace overlay::windows {
// delay buffer // delay buffer
int delay = analog.getDelayBufferDepth(); int delay = analog.getDelayBufferDepth();
if (ImGui::InputInt("Delay", &delay, 1, 10)) { if (ImGui::InputInt("Delay (experimental)", &delay, 1, 10)) {
delay = CLAMP(delay, 0, 256); delay = CLAMP(delay, 0, 256);
analog.setDelayBufferDepth(delay); analog.setDelayBufferDepth(delay);
} }
@@ -2605,7 +2606,8 @@ namespace overlay::windows {
"Adds a delay to input. This is poll-based, not time-based.\n\n" "Adds a delay to input. This is poll-based, not time-based.\n\n"
"WARNING: delay depends on how often the game polls for input! " "WARNING: delay depends on how often the game polls for input! "
"Strongly recommended that you go into the game's test menu instead " "Strongly recommended that you go into the game's test menu instead "
"of adjusting in spicecfg."); "of adjusting in spicecfg. Close all overlays as that will affect "
"how input delay is calculated.");
} }
} }
+1 -1
View File
@@ -162,7 +162,7 @@ namespace overlay::windows {
unsigned int get_keypad_top_row(const Button &button); unsigned int get_keypad_top_row(const Button &button);
void build_analogs(const std::string &name, std::vector<Analog> *analogs); void build_analogs(const std::string &name, std::vector<Analog> *analogs);
void edit_analog_popup(Analog &analog); void edit_analog_popup(Analog &analog, std::string title);
void update() override; void update() override;
void stop_lights_test(); void stop_lights_test();