mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
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:
@@ -82,18 +82,23 @@ public:
|
||||
return this->index != 0xFF;
|
||||
}
|
||||
|
||||
inline void clearBindings() {
|
||||
device_identifier = "";
|
||||
index = 0xFF;
|
||||
inline void resetValues() {
|
||||
setSensitivity(1.f);
|
||||
setDeadzone(0.f);
|
||||
invert = false;
|
||||
smoothing = false;
|
||||
deadzone_mirror = false;
|
||||
setMultiplier(1);
|
||||
setRelativeMode(false);
|
||||
setDelayBufferDepth(0);
|
||||
}
|
||||
|
||||
inline void clearBindings() {
|
||||
device_identifier = "";
|
||||
index = 0xFF;
|
||||
resetValues();
|
||||
}
|
||||
|
||||
inline const std::string &getName() const {
|
||||
return this->name;
|
||||
}
|
||||
|
||||
@@ -1727,6 +1727,13 @@ namespace overlay::windows {
|
||||
std::vector<int> analogs_midi_indices;
|
||||
if (this->analogs_devices_selected >= 0) {
|
||||
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) {
|
||||
case rawinput::MOUSE: {
|
||||
|
||||
@@ -2036,6 +2043,11 @@ namespace overlay::windows {
|
||||
ImGui::CloseCurrentPopup();
|
||||
}
|
||||
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Reset")) {
|
||||
analog.resetValues();
|
||||
}
|
||||
|
||||
// clean up
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user