Enable negative Alpha in Source Callback for inactive source

setAlpha() to negative value allows to make the source inactive (outside mixing circle)
This commit is contained in:
Bruno Herbelin
2023-02-13 23:51:16 +01:00
parent 21045411e7
commit c7367ad46a
2 changed files with 16 additions and 5 deletions

View File

@@ -4995,11 +4995,11 @@ void InputMappingInterface::SliderParametersCallback(SourceCallback *callback, c
float val = edited->value();
ImGui::SameLine(0, IMGUI_SAME_LINE / 2);
ImGui::SetNextItemWidth(right_align);
if (ImGui::SliderFloat("##CALLBACK_ALPHA", &val, 0.f, 1.f, "%.2f"))
if (ImGui::SliderFloat("##CALLBACK_ALPHA", &val, -1.f, 1.f, "%.2f"))
edited->setValue(val);
ImGui::SameLine(0, IMGUI_SAME_LINE / 2);
ImGuiToolkit::Indication("Target alpha makes the source\nvisible (1.0) or transparent (0.0)", 18, 12);
ImGuiToolkit::Indication("Target alpha makes the source\nvisible (1.0), transparent (0.0),\n or innactive (-1.0)", 18, 12);
}
break;