diff options
author | George Marques <george@gmarqu.es> | 2021-03-17 14:58:05 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2021-03-30 08:29:38 -0300 |
commit | 160c26049566a8f392420d459d8a738e8e3b753d (patch) | |
tree | 27394e44ac5ca7c1c2a6df4f3b2dea7fce9f275e /modules/gdscript/gdscript_compiler.cpp | |
parent | 3e4ecd9669f1d84689eff48282191d176175d0a5 (diff) | |
download | redot-engine-160c26049566a8f392420d459d8a738e8e3b753d.tar.gz |
GDScript: Allow export of enum variables
Also fix the enum type in variables to be integer.
Diffstat (limited to 'modules/gdscript/gdscript_compiler.cpp')
-rw-r--r-- | modules/gdscript/gdscript_compiler.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index 22380d152e..62bb6a9f9e 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -137,16 +137,12 @@ GDScriptDataType GDScriptCompiler::_gdtype_from_datatype(const GDScriptParser::D } } } break; + case GDScriptParser::DataType::ENUM: case GDScriptParser::DataType::ENUM_VALUE: result.has_type = true; result.kind = GDScriptDataType::BUILTIN; result.builtin_type = Variant::INT; break; - case GDScriptParser::DataType::ENUM: - result.has_type = true; - result.kind = GDScriptDataType::BUILTIN; - result.builtin_type = Variant::DICTIONARY; - break; case GDScriptParser::DataType::UNRESOLVED: { ERR_PRINT("Parser bug: converting unresolved type."); return GDScriptDataType(); @@ -2218,9 +2214,8 @@ Error GDScriptCompiler::_parse_class_level(GDScript *p_script, const GDScriptPar prop_info.hint = export_info.hint; prop_info.hint_string = export_info.hint_string; prop_info.usage = export_info.usage; - } else { - prop_info.usage = PROPERTY_USAGE_SCRIPT_VARIABLE; } + prop_info.usage |= PROPERTY_USAGE_SCRIPT_VARIABLE; #ifdef TOOLS_ENABLED p_script->doc_variables[name] = variable->doc_description; #endif |