mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 04:30:09 -05:00
Merge remote-tracking branch 'origin/master' into feature/NewAtmosphere
# Conflicts: # modules/imgui/src/renderproperties.cpp
This commit is contained in:
@@ -88,6 +88,7 @@ public:
|
||||
bool _showInternals;
|
||||
|
||||
properties::BoolProperty _showHelpText;
|
||||
properties::FloatProperty _helpTextDelay;
|
||||
|
||||
private:
|
||||
void renderAndUpdatePropertyVisibility();
|
||||
|
||||
@@ -60,6 +60,7 @@ public:
|
||||
void setVisibility(properties::Property::Visibility visibility);
|
||||
void setHasRegularProperties(bool hasOnlyRegularProperties);
|
||||
void setShowHelpTooltip(bool showHelpTooltip);
|
||||
void setShowHelpTooltipDelay(double delay);
|
||||
|
||||
void render() override;
|
||||
|
||||
@@ -79,6 +80,7 @@ protected:
|
||||
properties::StringListProperty _treeOrdering;
|
||||
|
||||
bool _showHelpTooltip;
|
||||
double _tooltipDelay;
|
||||
};
|
||||
|
||||
} // namespace openspace::gui
|
||||
|
||||
@@ -43,87 +43,87 @@ void executeScript(const std::string& id, const std::string& value,
|
||||
|
||||
void renderBoolProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderOptionProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderSelectionProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderStringProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderStringListProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDoubleProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderIntProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderIVec2Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderIVec3Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderIVec4Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderFloatProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderVec2Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderVec3Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderVec4Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDVec2Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDVec3Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDVec4Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDMat2Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDMat3Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderDMat4Property(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
void renderTriggerProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular = IsRegularProperty::Yes,
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes);
|
||||
ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0);
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
|
||||
@@ -253,6 +253,12 @@ static const openspace::properties::Property::PropertyInfo ShowHelpInfo = {
|
||||
"explaining what impact they have on the visuals."
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo HelpTextDelayInfo = {
|
||||
"HelpTextDelay",
|
||||
"Tooltip Delay (in s)",
|
||||
"This value determines the delay in seconds after which the tooltip is shown."
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo HiddenInfo = {
|
||||
"IsHidden",
|
||||
"Is Hidden",
|
||||
@@ -282,6 +288,7 @@ GUI::GUI()
|
||||
, _featuredProperties("Featured Properties", GuiPropertyComponent::UseTreeLayout::No)
|
||||
, _showInternals(false)
|
||||
, _showHelpText(ShowHelpInfo, true)
|
||||
, _helpTextDelay(HelpTextDelayInfo, 1.0, 0.0, 10.0)
|
||||
, _currentVisibility(properties::Property::Visibility::Developer)
|
||||
, _allHidden(HiddenInfo, true)
|
||||
{
|
||||
@@ -304,13 +311,29 @@ GUI::GUI()
|
||||
addPropertySubOwner(_iswa);
|
||||
#endif // OPENSPACE_MODULE_ISWA_ENABLED
|
||||
|
||||
addProperty(_showHelpText);
|
||||
_showHelpText.onChange([this](){
|
||||
_globalProperty.setShowHelpTooltip(_showHelpText);
|
||||
_property.setShowHelpTooltip(_showHelpText);
|
||||
_screenSpaceProperty.setShowHelpTooltip(_showHelpText);
|
||||
_virtualProperty.setShowHelpTooltip(_showHelpText);
|
||||
});
|
||||
{
|
||||
auto showHelpTextFunc = [this](){
|
||||
_globalProperty.setShowHelpTooltip(_showHelpText);
|
||||
_property.setShowHelpTooltip(_showHelpText);
|
||||
_screenSpaceProperty.setShowHelpTooltip(_showHelpText);
|
||||
_virtualProperty.setShowHelpTooltip(_showHelpText);
|
||||
};
|
||||
showHelpTextFunc();
|
||||
_showHelpText.onChange(std::move(showHelpTextFunc));
|
||||
addProperty(_showHelpText);
|
||||
}
|
||||
|
||||
{
|
||||
auto helpTextDelayFunc = [this](){
|
||||
_globalProperty.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
_property.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
_screenSpaceProperty.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
_virtualProperty.setShowHelpTooltipDelay(_helpTextDelay);
|
||||
};
|
||||
helpTextDelayFunc();
|
||||
_helpTextDelay.onChange(std::move(helpTextDelayFunc));
|
||||
addProperty(_helpTextDelay);
|
||||
}
|
||||
|
||||
addProperty(_allHidden);
|
||||
}
|
||||
|
||||
@@ -187,6 +187,10 @@ void GuiPropertyComponent::setShowHelpTooltip(bool showHelpTooltip) {
|
||||
_showHelpTooltip = showHelpTooltip;
|
||||
}
|
||||
|
||||
void GuiPropertyComponent::setShowHelpTooltipDelay(double delay) {
|
||||
_tooltipDelay = delay;
|
||||
}
|
||||
|
||||
void GuiPropertyComponent::renderPropertyOwner(properties::PropertyOwner* owner) {
|
||||
if (owner->propertiesRecursive().empty()) {
|
||||
return;
|
||||
@@ -425,7 +429,8 @@ void GuiPropertyComponent::renderProperty(properties::Property* prop,
|
||||
properties::PropertyOwner* owner)
|
||||
{
|
||||
using Func = std::function<
|
||||
void(properties::Property*, const std::string&, IsRegularProperty, ShowToolTip)
|
||||
void(properties::Property*, const std::string&, IsRegularProperty, ShowToolTip,
|
||||
double)
|
||||
>;
|
||||
static const std::map<std::string, Func> FunctionMapping = {
|
||||
{ "BoolProperty", &renderBoolProperty },
|
||||
@@ -463,7 +468,8 @@ void GuiPropertyComponent::renderProperty(properties::Property* prop,
|
||||
prop,
|
||||
owner->name(),
|
||||
IsRegularProperty(_hasOnlyRegularProperties),
|
||||
ShowToolTip(_showHelpTooltip)
|
||||
ShowToolTip(_showHelpTooltip),
|
||||
_tooltipDelay
|
||||
);
|
||||
}
|
||||
else {
|
||||
@@ -471,7 +477,8 @@ void GuiPropertyComponent::renderProperty(properties::Property* prop,
|
||||
prop,
|
||||
"",
|
||||
IsRegularProperty(_hasOnlyRegularProperties),
|
||||
ShowToolTip(_showHelpTooltip)
|
||||
ShowToolTip(_showHelpTooltip),
|
||||
_tooltipDelay
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <modules/imgui/include/gui.h>
|
||||
#include <modules/imgui/include/imgui_include.h>
|
||||
|
||||
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/util/timemanager.h>
|
||||
#include <openspace/util/time.h>
|
||||
@@ -82,8 +81,6 @@ void GuiSpaceTimeComponent::render() {
|
||||
|
||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.f);
|
||||
|
||||
ImGui::Text("%s", "Focus on:");
|
||||
ImGui::SameLine();
|
||||
// Buttons for important SceneGraphNodes
|
||||
for (SceneGraphNode* n : nodes) {
|
||||
const std::vector<std::string>& tags = n->tags();
|
||||
@@ -119,7 +116,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
}
|
||||
int currentPosition = static_cast<int>(std::distance(nodes.begin(), iCurrentFocus));
|
||||
|
||||
bool hasChanged = ImGui::Combo("Focus Node", ¤tPosition, nodeNames.c_str());
|
||||
bool hasChanged = ImGui::Combo("", ¤tPosition, nodeNames.c_str());
|
||||
if (hasChanged) {
|
||||
OsEng.scriptEngine().queueScript(
|
||||
"openspace.setPropertyValue('NavigationHandler.Origin', '" +
|
||||
|
||||
@@ -41,13 +41,14 @@
|
||||
#include <ghoul/misc/misc.h>
|
||||
|
||||
#include <glm/ext.hpp>
|
||||
#include <imgui_internal.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
using namespace properties;
|
||||
|
||||
void renderTooltip(Property* prop) {
|
||||
if (ImGui::IsItemHovered()) {
|
||||
void renderTooltip(Property* prop, double delay) {
|
||||
if (ImGui::IsItemHovered() && (GImGui->HoveredIdTimer > delay)) {
|
||||
ImGui::BeginTooltip();
|
||||
if (!prop->description().empty()) {
|
||||
ImGui::TextWrapped("%s", prop->description().c_str());
|
||||
@@ -91,7 +92,8 @@ void executeScript(const std::string& id, const std::string& value,
|
||||
}
|
||||
|
||||
void renderBoolProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
BoolProperty* p = static_cast<BoolProperty*>(prop);
|
||||
@@ -101,7 +103,7 @@ void renderBoolProperty(Property* prop, const std::string& ownerName,
|
||||
BoolProperty::ValueType value = *p;
|
||||
ImGui::Checkbox(name.c_str(), &value);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -111,7 +113,8 @@ void renderBoolProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderOptionProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
OptionProperty* p = static_cast<OptionProperty*>(prop);
|
||||
@@ -129,7 +132,7 @@ void renderOptionProperty(Property* prop, const std::string& ownerName,
|
||||
for (const OptionProperty::Option& o : options) {
|
||||
ImGui::RadioButton(o.description.c_str(), &value, o.value);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
}
|
||||
ImGui::Separator();
|
||||
@@ -154,6 +157,9 @@ void renderOptionProperty(Property* prop, const std::string& ownerName,
|
||||
|
||||
int oldIdx = idx;
|
||||
ImGui::Combo(name.c_str(), &idx, nodeNames.c_str());
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (idx != oldIdx) {
|
||||
value = options[idx].value;
|
||||
@@ -169,7 +175,8 @@ void renderOptionProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderSelectionProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
SelectionProperty* p = static_cast<SelectionProperty*>(prop);
|
||||
@@ -190,7 +197,7 @@ void renderSelectionProperty(Property* prop, const std::string& ownerName,
|
||||
|
||||
ImGui::Checkbox(description.c_str(), &selected);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (selected) {
|
||||
@@ -212,7 +219,8 @@ void renderSelectionProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderStringProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
StringProperty* p = static_cast<StringProperty*>(prop);
|
||||
@@ -235,7 +243,7 @@ void renderStringProperty(Property* prop, const std::string& ownerName,
|
||||
ImGuiInputTextFlags_EnterReturnsTrue
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (hasNewValue) {
|
||||
@@ -250,7 +258,8 @@ void renderStringProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderStringListProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
StringListProperty* p = static_cast<StringListProperty*>(prop);
|
||||
@@ -275,7 +284,7 @@ void renderStringListProperty(Property* prop, const std::string& ownerName,
|
||||
ImGuiInputTextFlags_EnterReturnsTrue
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (hasNewValue) {
|
||||
@@ -300,7 +309,8 @@ void renderStringListProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDoubleProperty(properties::Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DoubleProperty* p = static_cast<DoubleProperty*>(prop);
|
||||
@@ -313,7 +323,7 @@ void renderDoubleProperty(properties::Property* prop, const std::string& ownerNa
|
||||
|
||||
ImGui::SliderFloat(name.c_str(), &value, min, max, "%.5f", p->exponent());
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != static_cast<float>(p->value())) {
|
||||
@@ -324,7 +334,8 @@ void renderDoubleProperty(properties::Property* prop, const std::string& ownerNa
|
||||
}
|
||||
|
||||
void renderIntProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
IntProperty* p = static_cast<IntProperty*>(prop);
|
||||
@@ -337,7 +348,7 @@ void renderIntProperty(Property* prop, const std::string& ownerName,
|
||||
|
||||
ImGui::SliderInt(name.c_str(), &value, min, max);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -348,7 +359,8 @@ void renderIntProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderIVec2Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
IVec2Property* p = static_cast<IVec2Property*>(prop);
|
||||
@@ -365,7 +377,7 @@ void renderIVec2Property(Property* prop, const std::string& ownerName,
|
||||
max
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -380,7 +392,8 @@ void renderIVec2Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderIVec3Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
IVec3Property* p = static_cast<IVec3Property*>(prop);
|
||||
@@ -398,7 +411,7 @@ void renderIVec3Property(Property* prop, const std::string& ownerName,
|
||||
max
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -412,7 +425,8 @@ void renderIVec3Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderIVec4Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
IVec4Property* p = static_cast<IVec4Property*>(prop);
|
||||
@@ -430,7 +444,7 @@ void renderIVec4Property(Property* prop, const std::string& ownerName,
|
||||
max
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -444,7 +458,8 @@ void renderIVec4Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderFloatProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
FloatProperty* p = static_cast<FloatProperty*>(prop);
|
||||
@@ -456,7 +471,7 @@ void renderFloatProperty(Property* prop, const std::string& ownerName,
|
||||
float max = p->maxValue();
|
||||
ImGui::SliderFloat(name.c_str(), &value, min, max, "%.5f", p->exponent());
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -467,7 +482,8 @@ void renderFloatProperty(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderVec2Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
Vec2Property* p = static_cast<Vec2Property*>(prop);
|
||||
@@ -487,7 +503,7 @@ void renderVec2Property(Property* prop, const std::string& ownerName,
|
||||
p->exponent()
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -502,7 +518,8 @@ void renderVec2Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderVec3Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
Vec3Property* p = static_cast<Vec3Property*>(prop);
|
||||
@@ -530,7 +547,7 @@ void renderVec3Property(Property* prop, const std::string& ownerName,
|
||||
);
|
||||
}
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -545,7 +562,8 @@ void renderVec3Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderVec4Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
Vec4Property* p = static_cast<Vec4Property*>(prop);
|
||||
@@ -573,7 +591,7 @@ void renderVec4Property(Property* prop, const std::string& ownerName,
|
||||
);
|
||||
}
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (value != p->value()) {
|
||||
@@ -588,7 +606,8 @@ void renderVec4Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDVec2Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DVec2Property* p = static_cast<DVec2Property*>(prop);
|
||||
@@ -607,7 +626,7 @@ void renderDVec2Property(Property* prop, const std::string& ownerName,
|
||||
p->exponent()
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (glm::dvec2(value) != p->value()) {
|
||||
@@ -622,7 +641,8 @@ void renderDVec2Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDVec3Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DVec3Property* p = static_cast<DVec3Property*>(prop);
|
||||
@@ -642,7 +662,7 @@ void renderDVec3Property(Property* prop, const std::string& ownerName,
|
||||
p->exponent()
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (changed) {
|
||||
@@ -657,7 +677,8 @@ void renderDVec3Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDVec4Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DVec4Property* p = static_cast<DVec4Property*>(prop);
|
||||
@@ -677,7 +698,7 @@ void renderDVec4Property(Property* prop, const std::string& ownerName,
|
||||
p->exponent()
|
||||
);
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (glm::dvec4(value) != p->value()) {
|
||||
@@ -692,7 +713,8 @@ void renderDVec4Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDMat2Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DMat2Property* p = static_cast<DMat2Property*>(prop);
|
||||
@@ -718,7 +740,7 @@ void renderDMat2Property(Property* prop, const std::string& ownerName,
|
||||
ImGui::SliderFloat2("[1]", glm::value_ptr(value[1]), min, max, "%.5f", p->exponent());
|
||||
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (glm::dmat2(value) != p->value()) {
|
||||
@@ -733,7 +755,8 @@ void renderDMat2Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDMat3Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DMat3Property* p = static_cast<DMat3Property*>(prop);
|
||||
@@ -763,7 +786,7 @@ void renderDMat3Property(Property* prop, const std::string& ownerName,
|
||||
ImGui::SliderFloat3("[2]", glm::value_ptr(value[2]), min, max, "%.5f", p->exponent());
|
||||
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (glm::dmat3(value) != p->value()) {
|
||||
@@ -778,7 +801,8 @@ void renderDMat3Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderDMat4Property(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
DMat4Property* p = static_cast<DMat4Property*>(prop);
|
||||
@@ -811,7 +835,7 @@ void renderDMat4Property(Property* prop, const std::string& ownerName,
|
||||
ImGui::SliderFloat4("[3]", glm::value_ptr(value[3]), min, max, "%.5f", p->exponent());
|
||||
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
if (glm::dmat4(value) != p->value()) {
|
||||
@@ -826,7 +850,8 @@ void renderDMat4Property(Property* prop, const std::string& ownerName,
|
||||
}
|
||||
|
||||
void renderTriggerProperty(Property* prop, const std::string& ownerName,
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip)
|
||||
IsRegularProperty isRegular, ShowToolTip showTooltip,
|
||||
double tooltipDelay)
|
||||
{
|
||||
ghoul_assert(prop, "prop must not be nullptr");
|
||||
std::string name = prop->guiName();
|
||||
@@ -837,7 +862,7 @@ void renderTriggerProperty(Property* prop, const std::string& ownerName,
|
||||
executeScript(prop->fullyQualifiedIdentifier(), "nil", isRegular);
|
||||
}
|
||||
if (showTooltip) {
|
||||
renderTooltip(prop);
|
||||
renderTooltip(prop, tooltipDelay);
|
||||
}
|
||||
|
||||
ImGui::PopID();
|
||||
|
||||
Reference in New Issue
Block a user