Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Script.get_global_name() #80487

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

theraot
Copy link
Contributor

@theraot theraot commented Aug 10, 2023

@theraot theraot requested a review from a team as a code owner August 10, 2023 14:22
@Calinou Calinou added this to the 4.x milestone Aug 10, 2023
@AThousandShips
Copy link
Member

Needs to be documented

@theraot theraot force-pushed the expose_set_global_name branch from bd136af to cba89bd Compare August 10, 2023 14:41
@theraot theraot requested a review from a team as a code owner August 10, 2023 14:41
@theraot theraot force-pushed the expose_set_global_name branch from cba89bd to 74a45af Compare August 10, 2023 14:53
@dalexeev
Copy link
Member

I don't mind this change, but there is a related bug in GDScript:

class InnerClass:
    pass

func _ready():
    print((InnerClass as GDScript).get_global_name()) # InnerClass

StringName GDScript::get_global_name() const {
return name;
}

void GDScriptCompiler::make_scripts(GDScript *p_script, const GDScriptParser::ClassNode *p_class, bool p_keep_state) {
p_script->fully_qualified_name = p_class->fqcn;
p_script->name = p_class->identifier ? p_class->identifier->name : "";

@fkeyzuwu
Copy link
Contributor

fkeyzuwu commented Nov 21, 2023

I don't mind this change, but there is a related bug in GDScript:

class InnerClass:
    pass

func _ready():
    print((InnerClass as GDScript).get_global_name()) # InnerClass

StringName GDScript::get_global_name() const {
return name;
}

void GDScriptCompiler::make_scripts(GDScript *p_script, const GDScriptParser::ClassNode *p_class, bool p_keep_state) {
p_script->fully_qualified_name = p_class->fqcn;
p_script->name = p_class->identifier ? p_class->identifier->name : "";

This seems to be fixed, since now get_global_name() returns global_name and not name. So now it returns an empty string (I tested manually, it works)

@dalexeev
Copy link
Member

This seems to be fixed, since now get_global_name() returns global_name and not name. So now it returns an empty string (I tested manually, it works)

Yes, it was fixed in #81079.

Copy link
Member

@dalexeev dalexeev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but maybe the docs could be extended.

@dalexeev dalexeev requested review from a team November 21, 2023 12:51
@baileysostek
Copy link

Any movement on this? Is this a candidate for the next dev build or anything?

@YuriSizov YuriSizov modified the milestones: 4.x, 4.3 Dec 13, 2023
@YuriSizov YuriSizov force-pushed the expose_set_global_name branch from 74a45af to e7e35e8 Compare December 18, 2023 14:13
@YuriSizov
Copy link
Contributor

Updated the docs and rebased on your behalf.

@YuriSizov YuriSizov merged commit 80c3ed6 into godotengine:master Dec 18, 2023
15 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose Script.get_global_name()
7 participants