X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Fsrc%2Fsynfig%2Fvaluenode_twotone.cpp;h=3777686e6e1afbe5006801dfa914f6e41bbaeed0;hb=dbc88fd05c8d29849d2e6227d23605508eb188ae;hp=3c18ce0c01f5273c184335c0e69f33bd3b889115;hpb=a095981e18cc37a8ecc7cd237cc22b9c10329264;p=synfig.git diff --git a/synfig-core/src/synfig/valuenode_twotone.cpp b/synfig-core/src/synfig/valuenode_twotone.cpp index 3c18ce0..3777686 100644 --- a/synfig-core/src/synfig/valuenode_twotone.cpp +++ b/synfig-core/src/synfig/valuenode_twotone.cpp @@ -55,6 +55,8 @@ using namespace synfig; synfig::ValueNode_TwoTone::ValueNode_TwoTone(const ValueBase &value):LinkableValueNode(synfig::ValueBase::TYPE_GRADIENT) { + Vocab ret(get_children_vocab()); + set_children_vocab(ret); switch(value.get_type()) { case ValueBase::TYPE_GRADIENT: @@ -64,8 +66,6 @@ synfig::ValueNode_TwoTone::ValueNode_TwoTone(const ValueBase &value):LinkableVal default: throw Exception::BadType(ValueBase::type_local_name(value.get_type())); } - - DCAST_HACK_ENABLE(); } LinkableValueNode* @@ -187,3 +187,24 @@ ValueNode_TwoTone::check_type(ValueBase::Type type) { return type==ValueBase::TYPE_GRADIENT; } + +LinkableValueNode::Vocab +ValueNode_TwoTone::get_children_vocab_vfunc()const +{ + if(children_vocab.size()) + return children_vocab; + + LinkableValueNode::Vocab ret; + + ret.push_back(ParamDesc(ValueBase(),"color1") + .set_local_name(_("Color 1")) + .set_description(_("The start color of the gradient")) + ); + + ret.push_back(ParamDesc(ValueBase(),"color2") + .set_local_name(_("Color 2")) + .set_description(_("The end color of the gradient")) + ); + + return ret; +}