diff --git a/include/engine/Param.hpp b/include/engine/Param.hpp index cdef1fdd..0a18ebc1 100644 --- a/include/engine/Param.hpp +++ b/include/engine/Param.hpp @@ -18,6 +18,7 @@ struct Param { float displayMultiplier = 1.f; std::string label; std::string unit; + std::string description; void setup(float minValue, float maxValue, float defaultValue, std::string label = "", std::string unit = "", float displayBase = 0.f, float displayMultiplier = 1.f) { this->value = defaultValue; diff --git a/src/app/ParamWidget.cpp b/src/app/ParamWidget.cpp index 7f1b0f45..e7c62c85 100644 --- a/src/app/ParamWidget.cpp +++ b/src/app/ParamWidget.cpp @@ -2,6 +2,7 @@ #include "ui/MenuOverlay.hpp" #include "ui/TextField.hpp" #include "app/Scene.hpp" +#include "app/ParamQuantity.hpp" #include "context.hpp" #include "settings.hpp" #include "random.hpp" @@ -64,8 +65,18 @@ void ParamWidget::step() { } if (tooltip) { - if (quantity) + // Quantity string + if (quantity) { tooltip->text = quantity->getString(); + } + // Param description + ParamQuantity *paramQuantity = dynamic_cast(quantity); + if (paramQuantity) { + std::string description = paramQuantity->getParam()->description; + if (!description.empty()) + tooltip->text += "\n" + description; + } + // Position at bottom-right of parameter tooltip->box.pos = getAbsoluteOffset(box.size).round(); }