- Timestamp:
- 11/26/18 01:40:31 (6 years ago)
- Location:
- cpp/frams/param
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/param/mutableparam.cpp
r824 r832 6 6 #include <frams/util/extvalue.h> 7 7 8 #define PROPERTY_WARNING "Using most _property functions is restricted for internal purposes. Use \"property:\" or \"state:\" definitions in your script files to change object properties." 9 8 10 #define FIELDSTRUCT MutableParam 9 11 ParamEntry MutableParam::pe_tab[] = 10 { //TODO: these names are visible for scripts in ExpProperties, ShowProperties, etc. add some reserved prefix to avoid conflicts with script-defined properties!11 { " clear", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "remove all properties", "p", PROCEDURE(p_clear),},12 { " add", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "add property (id,type,name,help)", "p", PROCEDURE(p_addprop),},13 { " remove", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "remove property (index)", "p", PROCEDURE(p_remprop),},14 { " change", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "change property (id,type,name,flags,help)", "p", PROCEDURE(p_changeprop),},15 { " addGroup", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "add group (name)", "p", PROCEDURE(p_addgroup),},16 { " removeGroup", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "remove group (index)", "p", PROCEDURE(p_remgroup),},17 { " changedProperty", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN | PARAM_READONLY, "last changed property #", "d", FIELD(changed), },18 { " changedPropertyId", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN | PARAM_READONLY, "last changed property id", "s", GETONLY(changedname), },12 { 13 { "_propertyClear", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "Remove all properties", "p()", PROCEDURE(p_clear), PROPERTY_WARNING }, 14 { "_propertyAdd", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "Add property (id,type,name,help)", "p(s id,s type description,s name,d flags,s help text)", PROCEDURE(p_addprop), PROPERTY_WARNING }, 15 { "_propertyRemove", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "Remove property", "p(d index)", PROCEDURE(p_remprop), PROPERTY_WARNING }, 16 { "_propertyChange", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "Change property", "p(s id,s type description,s name,d flags,s help text)", PROCEDURE(p_changeprop), PROPERTY_WARNING }, 17 { "_propertyAddGroup", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "Add property group", "p(s name)", PROCEDURE(p_addgroup), PROPERTY_WARNING }, 18 { "_propertyRemoveGroup", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN, "Remove property group", "p(d index)", PROCEDURE(p_remgroup), PROPERTY_WARNING }, 19 { "_property_changed_index", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN | PARAM_READONLY, "Last changed property index", "d", FIELD(changed), }, 20 { "_property_changed_id", 0, PARAM_DONTSAVE | PARAM_USERHIDDEN | PARAM_READONLY, "Last changed property id", "s", GETONLY(changedname), }, 19 21 }; 20 22 #undef FIELDSTRUCT 23 const int MutableParam::staticprops = ARRAY_LENGTH(pe_tab); 21 24 22 25 MutableParam::MutableParam(const char*n, const char*g, int gr0) … … 211 214 void MutableParam::p_addprop(ExtValue *args, ExtValue *ret) 212 215 { 213 int i = addProperty(0, args[ 2].getString().c_str(), args[1].getString().c_str(), args[0].getString().c_str());216 int i = addProperty(0, args[4].getString().c_str(), args[3].getString().c_str(), args[2].getString().c_str(), args[0].getString().c_str(), args[1].getInt()); 214 217 ret->setInt(i); 215 218 } -
cpp/frams/param/mutableparam.h
r824 r832 16 16 class MutableParam : public SimpleAbstractParam, public MutableParamInterface 17 17 { 18 static const int staticprops = 8;18 static const int staticprops; 19 19 static ParamEntry pe_tab[]; 20 20 /** group #0 cannot be removed by scripting */
Note: See TracChangeset
for help on using the changeset viewer.