nodes: use flag instead of hidden array in factory
This commit is contained in:
@@ -65,8 +65,8 @@
|
||||
#include "time/timeremap/timeremap.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
QList<Node*> NodeFactory::library_;
|
||||
QVector<int> NodeFactory::hidden_;
|
||||
|
||||
void NodeFactory::Initialize()
|
||||
{
|
||||
@@ -78,10 +78,6 @@ void NodeFactory::Initialize()
|
||||
|
||||
library_.append(created_node);
|
||||
}
|
||||
|
||||
hidden_.append(kTextGeneratorV1);
|
||||
hidden_.append(kTextGeneratorV2);
|
||||
hidden_.append(kGroupNode);
|
||||
}
|
||||
|
||||
void NodeFactory::Destroy()
|
||||
@@ -107,8 +103,7 @@ Menu *NodeFactory::CreateMenu(QWidget* parent, bool create_none_item, Node::Cate
|
||||
continue;
|
||||
}
|
||||
|
||||
if (hidden_.contains(i)) {
|
||||
// Skip this node
|
||||
if (n->GetFlags() & Node::kDontShowInCreateMenu) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -100,8 +100,6 @@ public:
|
||||
private:
|
||||
static QList<Node*> library_;
|
||||
|
||||
static QVector<int> hidden_;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ TextGeneratorV1::TextGeneratorV1()
|
||||
AddInput(kFontInput, NodeValue::kFont);
|
||||
|
||||
AddInput(kFontSizeInput, NodeValue::kFloat, 72.0f);
|
||||
|
||||
SetFlags(kDontShowInCreateMenu);
|
||||
}
|
||||
|
||||
QString TextGeneratorV1::Name() const
|
||||
|
||||
@@ -57,6 +57,8 @@ TextGeneratorV2::TextGeneratorV2()
|
||||
|
||||
SetStandardValue(kColorInput, QVariant::fromValue(Color(1.0f, 1.0f, 1.0)));
|
||||
SetStandardValue(kSizeInput, QVector2D(400, 300));
|
||||
|
||||
SetFlags(kDontShowInCreateMenu);
|
||||
}
|
||||
|
||||
QString TextGeneratorV2::Name() const
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace olive {
|
||||
NodeGroup::NodeGroup() :
|
||||
output_passthrough_(nullptr)
|
||||
{
|
||||
SetFlags(kDontShowInCreateMenu);
|
||||
}
|
||||
|
||||
QString NodeGroup::Name() const
|
||||
|
||||
+2
-1
@@ -101,7 +101,8 @@ public:
|
||||
kNone = 0,
|
||||
kDontShowInParamView = 0x1,
|
||||
kVideoEffect = 0x2,
|
||||
kAudioEffect = 0x4
|
||||
kAudioEffect = 0x4,
|
||||
kDontShowInCreateMenu = 0x8
|
||||
};
|
||||
|
||||
struct ContextPair {
|
||||
|
||||
Reference in New Issue
Block a user