Merge pull request #2609 from eska014/export-hints
GDScript export hints: Add float w/ ease, remove duplicate, adapt multiline to established format
This commit is contained in:
commit
f44d15e4fc
@ -2421,6 +2421,16 @@ void GDParser::_parse_class(ClassNode *p_class) {
|
|||||||
}; //fallthrough to use the same
|
}; //fallthrough to use the same
|
||||||
case Variant::REAL: {
|
case Variant::REAL: {
|
||||||
|
|
||||||
|
if (tokenizer->get_token()==GDTokenizer::TK_IDENTIFIER && tokenizer->get_token_identifier()=="EASE") {
|
||||||
|
current_export.hint=PROPERTY_HINT_EXP_EASING;
|
||||||
|
tokenizer->advance();
|
||||||
|
if (tokenizer->get_token()!=GDTokenizer::TK_PARENTHESIS_CLOSE) {
|
||||||
|
_set_error("Expected ')' in hint.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
float sign=1.0;
|
float sign=1.0;
|
||||||
|
|
||||||
if (tokenizer->get_token()==GDTokenizer::TK_OP_SUB) {
|
if (tokenizer->get_token()==GDTokenizer::TK_OP_SUB) {
|
||||||
@ -2571,6 +2581,17 @@ void GDParser::_parse_class(ClassNode *p_class) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tokenizer->get_token()==GDTokenizer::TK_IDENTIFIER && tokenizer->get_token_identifier()=="MULTILINE") {
|
||||||
|
|
||||||
|
current_export.hint=PROPERTY_HINT_MULTILINE_TEXT;
|
||||||
|
tokenizer->advance();
|
||||||
|
if (tokenizer->get_token()!=GDTokenizer::TK_PARENTHESIS_CLOSE) {
|
||||||
|
_set_error("Expected ')' in hint.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
case Variant::COLOR: {
|
case Variant::COLOR: {
|
||||||
|
|
||||||
@ -2607,23 +2628,16 @@ void GDParser::_parse_class(ClassNode *p_class) {
|
|||||||
} else if (tokenizer->get_token()==GDTokenizer::TK_IDENTIFIER) {
|
} else if (tokenizer->get_token()==GDTokenizer::TK_IDENTIFIER) {
|
||||||
|
|
||||||
String identifier = tokenizer->get_token_identifier();
|
String identifier = tokenizer->get_token_identifier();
|
||||||
if (identifier == "flag") {
|
if (!ObjectTypeDB::is_type(identifier,"Resource")) {
|
||||||
current_export.type=Variant::INT;
|
|
||||||
current_export.hint=PROPERTY_HINT_ALL_FLAGS;
|
current_export=PropertyInfo();
|
||||||
}else if (identifier == "multiline"){
|
_set_error("Export hint not a type or resource.");
|
||||||
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();
|
tokenizer->advance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user