Skip to content

Commit

Permalink
Add categories to GDScript exported variables
Browse files Browse the repository at this point in the history
Closes #4378 via the 4th proposal, as it is easiest to implement
  • Loading branch information
bojidar-bg committed Aug 15, 2017
1 parent 1939e83 commit cfe71c0
Show file tree
Hide file tree
Showing 7 changed files with 958 additions and 807 deletions.
4 changes: 2 additions & 2 deletions core/script_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,10 @@ void PlaceHolderScriptInstance::get_property_list(List<PropertyInfo> *p_properti

for (const List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
PropertyInfo pinfo = E->get();
if (!values.has(pinfo.name)) {
if (!values.has(pinfo.name) && !(pinfo.usage & PROPERTY_USAGE_GROUP)) {
pinfo.usage |= PROPERTY_USAGE_SCRIPT_DEFAULT_VALUE;
}
p_properties->push_back(E->get());
p_properties->push_back(pinfo);
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/gdscript/gd_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,7 @@ Error GDCompiler::_parse_class(GDScript *p_script, GDScript *p_owner, const GDPa
return ERR_ALREADY_EXISTS;
}

if (p_class->variables[i]._export.type != Variant::NIL) {
if (p_class->variables[i]._export.type != Variant::NIL || p_class->variables[i]._export.usage & PROPERTY_USAGE_GROUP) {

p_script->member_info[name] = p_class->variables[i]._export;
#ifdef TOOLS_ENABLED
Expand Down
Loading

0 comments on commit cfe71c0

Please sign in to comment.