| @@ -18,6 +18,7 @@ struct Param { | |||||
| float displayMultiplier = 1.f; | float displayMultiplier = 1.f; | ||||
| std::string label; | std::string label; | ||||
| std::string unit; | 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) { | 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; | this->value = defaultValue; | ||||
| @@ -2,6 +2,7 @@ | |||||
| #include "ui/MenuOverlay.hpp" | #include "ui/MenuOverlay.hpp" | ||||
| #include "ui/TextField.hpp" | #include "ui/TextField.hpp" | ||||
| #include "app/Scene.hpp" | #include "app/Scene.hpp" | ||||
| #include "app/ParamQuantity.hpp" | |||||
| #include "context.hpp" | #include "context.hpp" | ||||
| #include "settings.hpp" | #include "settings.hpp" | ||||
| #include "random.hpp" | #include "random.hpp" | ||||
| @@ -64,8 +65,18 @@ void ParamWidget::step() { | |||||
| } | } | ||||
| if (tooltip) { | if (tooltip) { | ||||
| if (quantity) | |||||
| // Quantity string | |||||
| if (quantity) { | |||||
| tooltip->text = quantity->getString(); | tooltip->text = quantity->getString(); | ||||
| } | |||||
| // Param description | |||||
| ParamQuantity *paramQuantity = dynamic_cast<ParamQuantity*>(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(); | tooltip->box.pos = getAbsoluteOffset(box.size).round(); | ||||
| } | } | ||||