X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Fsrc%2Fsynfig%2Fvaluenode_linear.cpp;h=cc716a8f8128fe90e7626ff73c2e0ebe24173577;hb=dbc88fd05c8d29849d2e6227d23605508eb188ae;hp=418305df4c6f3a8d80c4ff1b4dd50a8c124a7979;hpb=71e30a766e852b1a96ad035adc4ba21e5a422f70;p=synfig.git diff --git a/synfig-core/src/synfig/valuenode_linear.cpp b/synfig-core/src/synfig/valuenode_linear.cpp index 418305d..cc716a8 100644 --- a/synfig-core/src/synfig/valuenode_linear.cpp +++ b/synfig-core/src/synfig/valuenode_linear.cpp @@ -55,6 +55,8 @@ using namespace synfig; ValueNode_Linear::ValueNode_Linear(const ValueBase &value): LinkableValueNode(value.get_type()) { + Vocab ret(get_children_vocab()); + set_children_vocab(ret); switch(get_type()) { case ValueBase::TYPE_ANGLE: @@ -225,3 +227,40 @@ ValueNode_Linear::get_link_index_from_name(const String &name)const throw Exception::BadLinkName(name); } + + +LinkableValueNode::Vocab +ValueNode_Linear::get_children_vocab_vfunc()const +{ + if(children_vocab.size()) + return children_vocab; + + LinkableValueNode::Vocab ret; + + switch(get_type()) + { + case ValueBase::TYPE_ANGLE: + case ValueBase::TYPE_COLOR: + case ValueBase::TYPE_INTEGER: + case ValueBase::TYPE_REAL: + case ValueBase::TYPE_TIME: + ret.push_back(ParamDesc(ValueBase(),"slope") + .set_local_name(_("Rate")) + .set_description(_("Value that is multiplied by the current time (in seconds)")) + ); + break; + case ValueBase::TYPE_VECTOR: + default: + ret.push_back(ParamDesc(ValueBase(),"slope") + .set_local_name(_("Slope")) + .set_description(_("Value that is multiplied by the current time (in seconds)")) + ); + } + + ret.push_back(ParamDesc(ValueBase(),"offset") + .set_local_name(_("Offset")) + .set_description(_("Returned value when the current time is zero")) + ); + + return ret; +}