Merge pull request #25650 from willnationsdev/script-icon
Fix script class icons looking for paths at runtime
This commit is contained in:
commit
6c243326bd
1 changed files with 12 additions and 8 deletions
|
@ -3494,6 +3494,8 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
tokenizer->advance();
|
||||
|
||||
if ((tokenizer->get_token() == GDScriptTokenizer::TK_CONSTANT && tokenizer->get_token_constant().get_type() == Variant::STRING)) {
|
||||
#ifdef TOOLS_ENABLED
|
||||
if (Engine::get_singleton()->is_editor_hint()) {
|
||||
Variant constant = tokenizer->get_token_constant();
|
||||
String icon_path = constant.operator String();
|
||||
|
||||
|
@ -3504,6 +3506,8 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||
}
|
||||
|
||||
p_class->icon_path = icon_path;
|
||||
}
|
||||
#endif
|
||||
|
||||
tokenizer->advance();
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue