diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-07-09 08:51:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-09 08:51:26 +0200 |
commit | 0c1394e1a3934521e5788a934b13f4f025430b3a (patch) | |
tree | 27846618a24be46496f2e4f5e93918620d783778 /editor | |
parent | 24c462b974ed45be85a7026960482dfcc7b54010 (diff) | |
parent | 542489a86696cba222711a20e31704a62d4b8fed (diff) |
Merge pull request #30125 from akien-mga/docdata-expose-parametric-setget
DocData: Re-expose parametric setters and getters
Diffstat (limited to 'editor')
-rw-r--r-- | editor/doc/doc_data.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index 6ee07d3661..a8ba54d4f8 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -323,8 +323,14 @@ void DocData::generate(bool p_basic_types) { if (E->get().name == "" || (E->get().name[0] == '_' && !(E->get().flags & METHOD_FLAG_VIRTUAL))) continue; //hidden, don't count - if (skip_setter_getter_methods && setters_getters.has(E->get().name) && E->get().name.find("/") == -1) - continue; + if (skip_setter_getter_methods && setters_getters.has(E->get().name)) { + // Don't skip parametric setters and getters, i.e. method which require + // one or more parameters to define what property should be set or retrieved. + // E.g. CPUParticles::set_param(Parameter param, float value). + if (E->get().arguments.size() == 0 /* getter */ || (E->get().arguments.size() == 1 && E->get().return_val.type == Variant::NIL /* setter */)) { + continue; + } + } MethodDoc method; @@ -366,21 +372,6 @@ void DocData::generate(bool p_basic_types) { method.arguments.push_back(argument); } - - /* - String hint; - switch(arginfo.hint) { - case PROPERTY_HINT_DIR: hint="A directory."; break; - case PROPERTY_HINT_RANGE: hint="Range - min: "+arginfo.hint_string.get_slice(",",0)+" max: "+arginfo.hint_string.get_slice(",",1)+" step: "+arginfo.hint_string.get_slice(",",2); break; - case PROPERTY_HINT_ENUM: hint="Values: "; for(int j=0;j<arginfo.hint_string.get_slice_count(",");j++) { if (j>0) hint+=", "; hint+=arginfo.hint_string.get_slice(",",j)+"="+itos(j); } break; - case PROPERTY_HINT_LENGTH: hint="Length: "+arginfo.hint_string; break; - case PROPERTY_HINT_FLAGS: hint="Values: "; for(int j=0;j<arginfo.hint_string.get_slice_count(",");j++) { if (j>0) hint+=", "; hint+=arginfo.hint_string.get_slice(",",j)+"="+itos(1<<j); } break; - case PROPERTY_HINT_FILE: hint="A file:"; break; - //case PROPERTY_HINT_RESOURCE_TYPE: hint="Type: "+arginfo.hint_string; break; - }; - if (hint!="") - _write_string(f,4,hint); -*/ } c.methods.push_back(method); |