mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-21 15:48:51 -05:00
stick sensitivity (#3725)
This commit is contained in:
parent
0a59ce6d99
commit
776c3a51ee
@ -1 +1 @@
|
||||
Subproject commit d25e0e977755ec09c22d6540963ffcd825954a23
|
||||
Subproject commit 15d57d806e39d7f19783e26acc1a062d402169c7
|
@ -636,6 +636,45 @@ void SohInputEditorWindow::DrawStickSection(uint8_t port, uint8_t stick, int32_t
|
||||
ImGui::EndGroup();
|
||||
ImGui::SetNextItemOpen(true, ImGuiCond_Once);
|
||||
if (ImGui::TreeNode(StringHelper::Sprintf("Analog Stick Options##%d", id).c_str())) {
|
||||
ImGui::Text("Sensitivity:");
|
||||
|
||||
int32_t sensitivityPercentage = controllerStick->GetSensitivityPercentage();
|
||||
if (sensitivityPercentage == 0) {
|
||||
ImGui::BeginDisabled();
|
||||
}
|
||||
ImGui::PushButtonRepeat(true);
|
||||
if (ImGui::Button(StringHelper::Sprintf("-##Sensitivity%d", id).c_str())) {
|
||||
controllerStick->SetSensitivity(sensitivityPercentage - 1);
|
||||
}
|
||||
ImGui::PopButtonRepeat();
|
||||
if (sensitivityPercentage == 0) {
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
ImGui::SameLine(0.0f, 0.0f);
|
||||
ImGui::SetNextItemWidth(SCALE_IMGUI_SIZE(160.0f));
|
||||
if (ImGui::SliderInt(StringHelper::Sprintf("##Sensitivity%d", id).c_str(), &sensitivityPercentage, 0, 200, "%d%%",
|
||||
ImGuiSliderFlags_AlwaysClamp)) {
|
||||
controllerStick->SetSensitivity(sensitivityPercentage);
|
||||
}
|
||||
ImGui::SameLine(0.0f, 0.0f);
|
||||
if (sensitivityPercentage == 200) {
|
||||
ImGui::BeginDisabled();
|
||||
}
|
||||
ImGui::PushButtonRepeat(true);
|
||||
if (ImGui::Button(StringHelper::Sprintf("+##Sensitivity%d", id).c_str())) {
|
||||
controllerStick->SetSensitivity(sensitivityPercentage + 1);
|
||||
}
|
||||
ImGui::PopButtonRepeat();
|
||||
if (sensitivityPercentage == 200) {
|
||||
ImGui::EndDisabled();
|
||||
}
|
||||
if (!controllerStick->SensitivityIsDefault()) {
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(StringHelper::Sprintf("Reset to Default###resetStickSensitivity%d", id).c_str())) {
|
||||
controllerStick->ResetSensitivityToDefault();
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::Text("Deadzone:");
|
||||
|
||||
int32_t deadzonePercentage = controllerStick->GetDeadzonePercentage();
|
||||
|
Loading…
Reference in New Issue
Block a user