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;
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user