diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-08-08 11:05:35 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-08-08 11:05:35 -0300 |
commit | 71b14f98226460143834efdf16a4d7b96adfb796 (patch) | |
tree | 386b24534e8efe7d8fb7ba87d46d995b50e2fed9 /modules/gdscript/gd_parser.cpp | |
parent | 5e326e49030bd52569471b6f2ea312eb7071e4cf (diff) | |
parent | 7843ec6633625455e689e711aa62e9d8337689fa (diff) |
Merge pull request #2323 from dbsGen/patch-2
add flag and multiline hints in GDScript
Diffstat (limited to 'modules/gdscript/gd_parser.cpp')
-rw-r--r-- | modules/gdscript/gd_parser.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index afe8c9aa71..755997ef31 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -2542,16 +2542,23 @@ void GDParser::_parse_class(ClassNode *p_class) { } else if (tokenizer->get_token()==GDTokenizer::TK_IDENTIFIER) { String identifier = tokenizer->get_token_identifier(); - if (!ObjectTypeDB::is_type(identifier,"Resource")) { - - current_export=PropertyInfo(); - _set_error("Export hint not a type or resource."); + if (identifier == "flag") { + current_export.type=Variant::INT; + current_export.hint=PROPERTY_HINT_ALL_FLAGS; + }else if (identifier == "multiline"){ + current_export.type=Variant::STRING; + current_export.hint=PROPERTY_HINT_MULTILINE_TEXT; + } else { + if (!ObjectTypeDB::is_type(identifier,"Resource")) { + + current_export=PropertyInfo(); + _set_error("Export hint not a type or resource."); + } + + current_export.type=Variant::OBJECT; + current_export.hint=PROPERTY_HINT_RESOURCE_TYPE; + current_export.hint_string=identifier; } - - current_export.type=Variant::OBJECT; - current_export.hint=PROPERTY_HINT_RESOURCE_TYPE; - current_export.hint_string=identifier; - tokenizer->advance(); } |