diff --git a/config.cpp b/config.cpp index cf73df5b..5c1b87b7 100644 --- a/config.cpp +++ b/config.cpp @@ -437,6 +437,7 @@ struct custom_parameter : public parameter { cld last_value, anim_value; function custom_viewer; function custom_value; + function custom_set_value; function custom_affect; function custom_load; function custom_save; @@ -481,6 +482,7 @@ struct custom_parameter : public parameter { } virtual cld get_cld() override { return custom_value(); } + virtual void set_cld_raw(cld x) override { if(custom_set_value) return custom_set_value(x); } virtual string save() override { if(custom_save) return custom_save(); else return "not saveable"; } virtual bool dosave() override { if(custom_do_save) return custom_do_save(); else return false; } virtual void reset() override { if(custom_reset) custom_reset(); } @@ -819,6 +821,7 @@ EX shared_ptr param_custom_ld(ld& val, const parameter_names& u->last_value = dft; u->custom_viewer = menuitem; u->custom_value = [&val] () { return val; }; + u->custom_set_value = [&val] (cld x) { val = real(x); }; u->custom_affect = [&val] (void *v) { return &val == v; }; u->custom_load = [&val] (const string& s) { val = parseld(s); }; u->custom_save = [&val] { return fts(val, 10); };