#include <synfigapp/canvasinterface.h>
#include <synfig/valuenode_const.h>
+#include <synfigapp/general.h>
+
#endif
using namespace std;
/* === M A C R O S ========================================================= */
-ACTION_INIT(Action::ValueDescConvert);
+ACTION_INIT_NO_GET_LOCAL_NAME(Action::ValueDescConvert);
ACTION_SET_NAME(Action::ValueDescConvert,"value_desc_convert");
-ACTION_SET_LOCAL_NAME(Action::ValueDescConvert,"Convert");
+ACTION_SET_LOCAL_NAME(Action::ValueDescConvert,N_("Convert"));
ACTION_SET_TASK(Action::ValueDescConvert,"convert");
ACTION_SET_CATEGORY(Action::ValueDescConvert,Action::CATEGORY_VALUEDESC);
ACTION_SET_PRIORITY(Action::ValueDescConvert,0);
Action::ValueDescConvert::ValueDescConvert()
{
+ time=(Time::begin()-1);
+}
+
+synfig::String
+Action::ValueDescConvert::get_local_name()const
+{
+ // TRANSLATORS: This is used in the 'history' dialog when a ValueNode is converted. The first %s is what is converted, the 2nd is the local name of the ValueNode's type.
+ return strprintf(_("Convert '%s' to ValueNode type '%s'"),
+ value_desc.get_description().c_str(),
+ LinkableValueNode::book()[type].local_name.c_str());
}
Action::ParamVocab
.set_desc(_("The type of ValueNode that you want to be converted to"))
);
+ ret.push_back(ParamDesc("time",Param::TYPE_TIME)
+ .set_local_name(_("Time"))
+ );
+
return ret;
}
return true;
}
+ if(name=="time" && param.get_type()==Param::TYPE_TIME)
+ {
+ time=param.get_time();
+
+ return true;
+ }
+
return Action::CanvasSpecific::set_param(name,param);
}
{
if(!value_desc || type.empty())
return false;
+ if(time==(Time::begin()-1))
+ {
+ synfig::error("Missing time");
+ return false;
+ }
return Action::CanvasSpecific::is_ready();
}
if(value_desc.is_const())
value=value_desc.get_value();
else if(value_desc.is_value_node())
- value=(*value_desc.get_value_node())(0);
+ value=(*value_desc.get_value_node())(time);
else
throw Error(_("Unable to decipher ValueDesc (Bug?)"));