cfg: tweaks to analog binding UI (#434)

## Link to GitHub Issue, if one exists
n/a

## Description of change
Add the raw device handle string to tooltip.
Add `Reset` button that clears all values.

## Testing
manual testing
This commit is contained in:
bicarus-dev
2025-12-06 01:47:00 -08:00
committed by GitHub
parent 76f401de95
commit 4e86cb16a2
2 changed files with 20 additions and 3 deletions
+8 -3
View File
@@ -82,18 +82,23 @@ public:
return this->index != 0xFF; return this->index != 0xFF;
} }
inline void clearBindings() { inline void resetValues() {
device_identifier = "";
index = 0xFF;
setSensitivity(1.f); setSensitivity(1.f);
setDeadzone(0.f); setDeadzone(0.f);
invert = false; invert = false;
smoothing = false; smoothing = false;
deadzone_mirror = false;
setMultiplier(1); setMultiplier(1);
setRelativeMode(false); setRelativeMode(false);
setDelayBufferDepth(0); setDelayBufferDepth(0);
} }
inline void clearBindings() {
device_identifier = "";
index = 0xFF;
resetValues();
}
inline const std::string &getName() const { inline const std::string &getName() const {
return this->name; return this->name;
} }
+12
View File
@@ -1727,6 +1727,13 @@ namespace overlay::windows {
std::vector<int> analogs_midi_indices; std::vector<int> analogs_midi_indices;
if (this->analogs_devices_selected >= 0) { if (this->analogs_devices_selected >= 0) {
auto device = this->analogs_devices.at(this->analogs_devices_selected); auto device = this->analogs_devices.at(this->analogs_devices_selected);
// add a tooltip to devices selector
if (!device->name.empty()) {
ImGui::SameLine();
ImGui::HelpMarker(device->name.c_str());
}
switch (device->type) { switch (device->type) {
case rawinput::MOUSE: { case rawinput::MOUSE: {
@@ -2036,6 +2043,11 @@ namespace overlay::windows {
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
ImGui::SameLine();
if (ImGui::Button("Reset")) {
analog.resetValues();
}
// clean up // clean up
ImGui::EndPopup(); ImGui::EndPopup();
} }